1*c9ccf3a3SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*c9ccf3a3SEmmanuel Vadot# Copyright (c) 2020, Silicon Laboratories, Inc.
3*c9ccf3a3SEmmanuel Vadot%YAML 1.2
4*c9ccf3a3SEmmanuel Vadot---
5*c9ccf3a3SEmmanuel Vadot
6*c9ccf3a3SEmmanuel Vadot$id: http://devicetree.org/schemas/staging/net/wireless/silabs,wfx.yaml#
7*c9ccf3a3SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
8*c9ccf3a3SEmmanuel Vadot
9*c9ccf3a3SEmmanuel Vadottitle: Silicon Labs WFxxx devicetree bindings
10*c9ccf3a3SEmmanuel Vadot
11*c9ccf3a3SEmmanuel Vadotmaintainers:
12*c9ccf3a3SEmmanuel Vadot  - Jérôme Pouiller <jerome.pouiller@silabs.com>
13*c9ccf3a3SEmmanuel Vadot
14*c9ccf3a3SEmmanuel Vadotdescription: >
15*c9ccf3a3SEmmanuel Vadot  Support for the Wifi chip WFxxx from Silicon Labs. Currently, the only device
16*c9ccf3a3SEmmanuel Vadot  from the WFxxx series is the WF200 described here:
17*c9ccf3a3SEmmanuel Vadot     https://www.silabs.com/documents/public/data-sheets/wf200-datasheet.pdf
18*c9ccf3a3SEmmanuel Vadot
19*c9ccf3a3SEmmanuel Vadot  The WF200 can be connected via SPI or via SDIO.
20*c9ccf3a3SEmmanuel Vadot
21*c9ccf3a3SEmmanuel Vadot  For SDIO:
22*c9ccf3a3SEmmanuel Vadot
23*c9ccf3a3SEmmanuel Vadot    Declaring the WFxxx chip in device tree is mandatory (usually, the VID/PID is
24*c9ccf3a3SEmmanuel Vadot    sufficient for the SDIO devices).
25*c9ccf3a3SEmmanuel Vadot
26*c9ccf3a3SEmmanuel Vadot    It is recommended to declare a mmc-pwrseq on SDIO host above WFx. Without
27*c9ccf3a3SEmmanuel Vadot    it, you may encounter issues during reboot. The mmc-pwrseq should be
28*c9ccf3a3SEmmanuel Vadot    compatible with mmc-pwrseq-simple. Please consult
29*c9ccf3a3SEmmanuel Vadot    Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.yaml for more
30*c9ccf3a3SEmmanuel Vadot    information.
31*c9ccf3a3SEmmanuel Vadot
32*c9ccf3a3SEmmanuel Vadot  For SPI:
33*c9ccf3a3SEmmanuel Vadot
34*c9ccf3a3SEmmanuel Vadot    In add of the properties below, please consult
35*c9ccf3a3SEmmanuel Vadot    Documentation/devicetree/bindings/spi/spi-controller.yaml for optional SPI
36*c9ccf3a3SEmmanuel Vadot    related properties.
37*c9ccf3a3SEmmanuel Vadot
38*c9ccf3a3SEmmanuel Vadotproperties:
39*c9ccf3a3SEmmanuel Vadot  compatible:
40*c9ccf3a3SEmmanuel Vadot    items:
41*c9ccf3a3SEmmanuel Vadot      - enum:
42*c9ccf3a3SEmmanuel Vadot          - silabs,brd4001a # WGM160P Evaluation Board
43*c9ccf3a3SEmmanuel Vadot          - silabs,brd8022a # WF200 Evaluation Board
44*c9ccf3a3SEmmanuel Vadot          - silabs,brd8023a # WFM200 Evaluation Board
45*c9ccf3a3SEmmanuel Vadot      - const: silabs,wf200 # Chip alone without antenna
46*c9ccf3a3SEmmanuel Vadot
47*c9ccf3a3SEmmanuel Vadot  reg:
48*c9ccf3a3SEmmanuel Vadot    description:
49*c9ccf3a3SEmmanuel Vadot      When used on SDIO bus, <reg> must be set to 1. When used on SPI bus, it is
50*c9ccf3a3SEmmanuel Vadot      the chip select address of the device as defined in the SPI devices
51*c9ccf3a3SEmmanuel Vadot      bindings.
52*c9ccf3a3SEmmanuel Vadot    maxItems: 1
53*c9ccf3a3SEmmanuel Vadot
54*c9ccf3a3SEmmanuel Vadot  spi-max-frequency: true
55*c9ccf3a3SEmmanuel Vadot
56*c9ccf3a3SEmmanuel Vadot  interrupts:
57*c9ccf3a3SEmmanuel Vadot    description: The interrupt line. Should be IRQ_TYPE_EDGE_RISING. When SPI is
58*c9ccf3a3SEmmanuel Vadot      used, this property is required. When SDIO is used, the "in-band"
59*c9ccf3a3SEmmanuel Vadot      interrupt provided by the SDIO bus is used unless an interrupt is defined
60*c9ccf3a3SEmmanuel Vadot      in the Device Tree.
61*c9ccf3a3SEmmanuel Vadot    maxItems: 1
62*c9ccf3a3SEmmanuel Vadot
63*c9ccf3a3SEmmanuel Vadot  reset-gpios:
64*c9ccf3a3SEmmanuel Vadot    description: (SPI only) Phandle of gpio that will be used to reset chip
65*c9ccf3a3SEmmanuel Vadot      during probe. Without this property, you may encounter issues with warm
66*c9ccf3a3SEmmanuel Vadot      boot.
67*c9ccf3a3SEmmanuel Vadot
68*c9ccf3a3SEmmanuel Vadot      For SDIO, the reset gpio should declared using a mmc-pwrseq.
69*c9ccf3a3SEmmanuel Vadot    maxItems: 1
70*c9ccf3a3SEmmanuel Vadot
71*c9ccf3a3SEmmanuel Vadot  wakeup-gpios:
72*c9ccf3a3SEmmanuel Vadot    description: Phandle of gpio that will be used to wake-up chip. Without this
73*c9ccf3a3SEmmanuel Vadot      property, driver will disable most of power saving features.
74*c9ccf3a3SEmmanuel Vadot    maxItems: 1
75*c9ccf3a3SEmmanuel Vadot
76*c9ccf3a3SEmmanuel Vadot  silabs,antenna-config-file:
77*c9ccf3a3SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/string
78*c9ccf3a3SEmmanuel Vadot    description: Use an alternative file for antenna configuration (aka
79*c9ccf3a3SEmmanuel Vadot      "Platform Data Set" in Silabs jargon). Default depends of "compatible"
80*c9ccf3a3SEmmanuel Vadot      string. For "silabs,wf200", the default is 'wf200.pds'.
81*c9ccf3a3SEmmanuel Vadot
82*c9ccf3a3SEmmanuel Vadot  local-mac-address: true
83*c9ccf3a3SEmmanuel Vadot
84*c9ccf3a3SEmmanuel Vadot  mac-address: true
85*c9ccf3a3SEmmanuel Vadot
86*c9ccf3a3SEmmanuel VadotadditionalProperties: false
87*c9ccf3a3SEmmanuel Vadot
88*c9ccf3a3SEmmanuel Vadotrequired:
89*c9ccf3a3SEmmanuel Vadot  - compatible
90*c9ccf3a3SEmmanuel Vadot  - reg
91*c9ccf3a3SEmmanuel Vadot
92*c9ccf3a3SEmmanuel Vadotexamples:
93*c9ccf3a3SEmmanuel Vadot  - |
94*c9ccf3a3SEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
95*c9ccf3a3SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
96*c9ccf3a3SEmmanuel Vadot
97*c9ccf3a3SEmmanuel Vadot    spi {
98*c9ccf3a3SEmmanuel Vadot        #address-cells = <1>;
99*c9ccf3a3SEmmanuel Vadot        #size-cells = <0>;
100*c9ccf3a3SEmmanuel Vadot
101*c9ccf3a3SEmmanuel Vadot        wifi@0 {
102*c9ccf3a3SEmmanuel Vadot            compatible = "silabs,brd8022a", "silabs,wf200";
103*c9ccf3a3SEmmanuel Vadot            pinctrl-names = "default";
104*c9ccf3a3SEmmanuel Vadot            pinctrl-0 = <&wfx_irq &wfx_gpios>;
105*c9ccf3a3SEmmanuel Vadot            reg = <0>;
106*c9ccf3a3SEmmanuel Vadot            interrupts-extended = <&gpio 16 IRQ_TYPE_EDGE_RISING>;
107*c9ccf3a3SEmmanuel Vadot            wakeup-gpios = <&gpio 12 GPIO_ACTIVE_HIGH>;
108*c9ccf3a3SEmmanuel Vadot            reset-gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
109*c9ccf3a3SEmmanuel Vadot            spi-max-frequency = <42000000>;
110*c9ccf3a3SEmmanuel Vadot        };
111*c9ccf3a3SEmmanuel Vadot    };
112*c9ccf3a3SEmmanuel Vadot
113*c9ccf3a3SEmmanuel Vadot  - |
114*c9ccf3a3SEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
115*c9ccf3a3SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
116*c9ccf3a3SEmmanuel Vadot
117*c9ccf3a3SEmmanuel Vadot    wfx_pwrseq: wfx_pwrseq {
118*c9ccf3a3SEmmanuel Vadot        compatible = "mmc-pwrseq-simple";
119*c9ccf3a3SEmmanuel Vadot        pinctrl-names = "default";
120*c9ccf3a3SEmmanuel Vadot        pinctrl-0 = <&wfx_reset>;
121*c9ccf3a3SEmmanuel Vadot        reset-gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
122*c9ccf3a3SEmmanuel Vadot    };
123*c9ccf3a3SEmmanuel Vadot
124*c9ccf3a3SEmmanuel Vadot    mmc {
125*c9ccf3a3SEmmanuel Vadot        mmc-pwrseq = <&wfx_pwrseq>;
126*c9ccf3a3SEmmanuel Vadot        #address-cells = <1>;
127*c9ccf3a3SEmmanuel Vadot        #size-cells = <0>;
128*c9ccf3a3SEmmanuel Vadot
129*c9ccf3a3SEmmanuel Vadot        wifi@1 {
130*c9ccf3a3SEmmanuel Vadot            compatible = "silabs,brd8022a", "silabs,wf200";
131*c9ccf3a3SEmmanuel Vadot            pinctrl-names = "default";
132*c9ccf3a3SEmmanuel Vadot            pinctrl-0 = <&wfx_wakeup>;
133*c9ccf3a3SEmmanuel Vadot            reg = <1>;
134*c9ccf3a3SEmmanuel Vadot            wakeup-gpios = <&gpio 12 GPIO_ACTIVE_HIGH>;
135*c9ccf3a3SEmmanuel Vadot        };
136*c9ccf3a3SEmmanuel Vadot    };
137*c9ccf3a3SEmmanuel Vadot...
138