1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2# Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
3
4%YAML 1.2
5---
6$id: http://devicetree.org/schemas/net/wireless/mediatek,mt76.yaml#
7$schema: http://devicetree.org/meta-schemas/core.yaml#
8
9title: MediaTek mt76 wireless devices Generic Binding
10
11maintainers:
12  - Felix Fietkau <nbd@nbd.name>
13  - Lorenzo Bianconi <lorenzo@kernel.org>
14  - Ryder Lee <ryder.lee@mediatek.com>
15
16description: |
17  This node provides properties for configuring the MediaTek mt76xx
18  wireless device. The node is expected to be specified as a child
19  node of the PCI controller to which the wireless chip is connected.
20  Alternatively, it can specify the wireless part of the MT7628/MT7688
21  or MT7622 SoC.
22
23allOf:
24  - $ref: ieee80211.yaml#
25
26properties:
27  compatible:
28    enum:
29      - mediatek,mt76
30      - mediatek,mt7628-wmac
31      - mediatek,mt7622-wmac
32
33  reg:
34    maxItems: 1
35
36  interrupts:
37    maxItems: 1
38
39  power-domains:
40    maxItems: 1
41
42  mediatek,infracfg:
43    $ref: /schemas/types.yaml#/definitions/phandle
44    description:
45      Phandle to the infrastructure bus fabric syscon node.
46      This property is MT7622 specific
47
48  ieee80211-freq-limit: true
49
50  mediatek,eeprom-data:
51    $ref: /schemas/types.yaml#/definitions/uint32-array
52    description:
53      EEPROM data embedded as array.
54
55  mediatek,mtd-eeprom:
56    $ref: /schemas/types.yaml#/definitions/phandle-array
57    description:
58      Phandle to a MTD partition + offset containing EEPROM data
59
60  big-endian:
61    $ref: /schemas/types.yaml#/definitions/flag
62    description:
63      Specify if the radio eeprom partition is written in big-endian
64
65  mediatek,eeprom-merge-otp:
66    type: boolean
67    description:
68      Merge EEPROM data with OTP data. Can be used on boards where the flash
69      calibration data is generic and specific calibration data should be
70      pulled from the OTP ROM
71
72  led:
73    type: object
74    $ref: /schemas/leds/common.yaml#
75    additionalProperties: false
76    properties:
77      led-sources:
78        maxItems: 1
79
80  power-limits:
81    type: object
82    additionalProperties: false
83    patternProperties:
84      "^r[0-9]+":
85        type: object
86        additionalProperties: false
87        properties:
88          regdomain:
89            $ref: /schemas/types.yaml#/definitions/string
90            description:
91              Regdomain refers to a legal regulatory region. Different
92              countries define different levels of allowable transmitter
93              power, time that a channel can be occupied, and different
94              available channels
95            enum:
96              - FCC
97              - ETSI
98              - JP
99
100        patternProperties:
101          "^txpower-[256]g$":
102            type: object
103            additionalProperties: false
104            patternProperties:
105              "^b[0-9]+$":
106                type: object
107                additionalProperties: false
108                properties:
109                  channels:
110                    $ref: /schemas/types.yaml#/definitions/uint32-array
111                    minItems: 2
112                    maxItems: 2
113                    description:
114                      Pairs of first and last channel number of the selected
115                      band
116
117                  rates-cck:
118                    $ref: /schemas/types.yaml#/definitions/uint8-array
119                    minItems: 4
120                    maxItems: 4
121                    description:
122                      4 half-dBm per-rate power limit values
123
124                  rates-ofdm:
125                    $ref: /schemas/types.yaml#/definitions/uint8-array
126                    minItems: 8
127                    maxItems: 8
128                    description:
129                      8 half-dBm per-rate power limit values
130
131                  rates-mcs:
132                    $ref: /schemas/types.yaml#/definitions/uint8-matrix
133                    description:
134                      Sets of per-rate power limit values for 802.11n/802.11ac
135                      rates for multiple channel bandwidth settings.
136                      Each set starts with the number of channel bandwidth
137                      settings for which the rate set applies, followed by
138                      either 8 or 10 power limit values. The order of the
139                      channel bandwidth settings is 20, 40, 80 and 160 MHz.
140                    maxItems: 4
141                    items:
142                      minItems: 9
143                      maxItems: 11
144
145                  rates-ru:
146                    $ref: /schemas/types.yaml#/definitions/uint8-matrix
147                    description:
148                      Sets of per-rate power limit values for 802.11ax rates
149                      for multiple channel bandwidth or resource unit settings.
150                      Each set starts with the number of channel bandwidth or
151                      resource unit settings for which the rate set applies,
152                      followed by 12 power limit values. The order of the
153                      channel resource unit settings is RU26, RU52, RU106,
154                      RU242/SU20, RU484/SU40, RU996/SU80 and RU2x996/SU160.
155                    items:
156                      minItems: 13
157                      maxItems: 13
158
159                  txs-delta:
160                    $ref: /schemas/types.yaml#/definitions/uint32-array
161                    description:
162                      Half-dBm power delta for different numbers of antennas
163
164required:
165  - compatible
166  - reg
167
168additionalProperties: false
169
170examples:
171  - |
172    pcie0 {
173      #address-cells = <3>;
174      #size-cells = <2>;
175      wifi@0,0 {
176        compatible = "mediatek,mt76";
177        reg = <0x0000 0 0 0 0>;
178        ieee80211-freq-limit = <5000000 6000000>;
179        mediatek,mtd-eeprom = <&factory 0x8000>;
180        big-endian;
181
182        led {
183          led-sources = <2>;
184        };
185
186        power-limits {
187          r0 {
188            regdomain = "FCC";
189            txpower-5g {
190               b0 {
191                   channels = <36 48>;
192                   rates-ofdm = /bits/ 8 <23 23 23 23 23 23 23 23>;
193                   rates-mcs = /bits/ 8 <1 23 23 23 23 23 23 23 23 23 23>,
194                                        <3 22 22 22 22 22 22 22 22 22 22>;
195                   rates-ru = /bits/ 8 <3 22 22 22 22 22 22 22 22 22 22 22 22>,
196                                       <4 20 20 20 20 20 20 20 20 20 20 20 20>;
197               };
198               b1 {
199                   channels = <100 181>;
200                   rates-ofdm = /bits/ 8 <14 14 14 14 14 14 14 14>;
201                   rates-mcs = /bits/ 8  <4 14 14 14 14 14 14 14 14 14 14>;
202                   txs-delta = <12 9 6>;
203                   rates-ru = /bits/ 8  <7 14 14 14 14 14 14 14 14 14 14 14 14>;
204               };
205             };
206          };
207        };
208      };
209    };
210
211  - |
212    wifi@10300000 {
213      compatible = "mediatek,mt7628-wmac";
214      reg = <0x10300000 0x100000>;
215
216      interrupt-parent = <&cpuintc>;
217      interrupts = <6>;
218
219      mediatek,mtd-eeprom = <&factory 0x0>;
220    };
221
222  - |
223    #include <dt-bindings/interrupt-controller/arm-gic.h>
224    #include <dt-bindings/interrupt-controller/irq.h>
225    wifi@18000000 {
226      compatible = "mediatek,mt7622-wmac";
227      reg = <0x10300000 0x100000>;
228      interrupts = <GIC_SPI 211 IRQ_TYPE_LEVEL_LOW>;
229
230      mediatek,infracfg = <&infracfg>;
231
232      power-domains = <&scpsys 3>;
233    };
234