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