ipq40xx: utilize nvmem-cells for macs & (pre-)calibration data
[openwrt/staging/chunkeey.git] / target / linux / ipq40xx / files / arch / arm / boot / dts / qcom-ipq4019-wtr-m2133hp.dts
1 // SPDX-License-Identifier: ISC
2 /*
3 * Copyright (c) 2015 - 2016, The Linux Foundation. All rights reserved.
4 * Copyright (c) 2020 Yanase Yuki <dev@zpc.sakura.ne.jp>
5 */
6
7 #include "qcom-ipq4019.dtsi"
8 #include <dt-bindings/input/input.h>
9 #include <dt-bindings/gpio/gpio.h>
10 #include <dt-bindings/soc/qcom,tcsr.h>
11
12 / {
13 model = "Buffalo WTR-M2133HP";
14 compatible = "buffalo,wtr-m2133hp", "qcom,ipq4019";
15
16 memory {
17 device_type = "memory";
18 reg = <0x80000000 0x20000000>;
19 };
20
21 chosen {
22 /*
23 * U-Boot adds "ubi.mtd=rootfs root=mtd:ubi_rootfs" to
24 * kernel command line. But we use different partition names,
25 * so we have to set correct parameters.
26 */
27 bootargs-append = " ubi.mtd=ubi root=/dev/ubiblock0_1";
28 };
29
30 aliases {
31 led-boot = &led_power_blue;
32 led-failsafe = &led_power_orange;
33 led-running = &led_power_white;
34 led-upgrade = &led_power_blue;
35 label-mac-device = &gmac0;
36 };
37
38 soc {
39 rng@22000 {
40 status = "okay";
41 };
42
43 tcsr@1949000 {
44 compatible = "qcom,tcsr";
45 reg = <0x1949000 0x100>;
46 qcom,wifi_glb_cfg = <TCSR_WIFI_GLB_CFG>;
47 };
48
49 tcsr@194b000 {
50 compatible = "qcom,tcsr";
51 reg = <0x194b000 0x100>;
52 qcom,usb-hsphy-mode-select = <TCSR_USB_HSPHY_HOST_MODE>;
53 status = "okay";
54 };
55
56 ess_tcsr@1953000 {
57 compatible = "qcom,tcsr";
58 reg = <0x1953000 0x1000>;
59 qcom,ess-interface-select = <TCSR_ESS_PSGMII>;
60 };
61
62 tcsr@1957000 {
63 compatible = "qcom,tcsr";
64 reg = <0x1957000 0x100>;
65 qcom,wifi_noc_memtype_m0_m2 = <TCSR_WIFI_NOC_MEMTYPE_M0_M2>;
66 };
67
68 crypto@8e3a000 {
69 status = "okay";
70 };
71
72 watchdog@b017000 {
73 status = "okay";
74 };
75
76 ess-switch@c000000 {
77 status = "okay";
78 switch_lan_bmp = <0x1c>;
79 };
80
81 ess-psgmii@98000 {
82 status = "okay";
83 };
84
85 edma@c080000 {
86 status = "okay";
87 };
88
89 usb3@8af8800 {
90 status = "okay";
91 };
92 };
93
94 leds {
95 compatible = "gpio-leds";
96
97 led_power_white: power_white {
98 label = "white:power";
99 gpios = <&tlmm 40 GPIO_ACTIVE_HIGH>;
100 };
101
102 led_power_orange: power_orange {
103 label = "orange:power";
104 gpios = <&tlmm 25 GPIO_ACTIVE_HIGH>;
105 };
106
107 led_power_blue: power_blue {
108 label = "blue:power";
109 gpios = <&tlmm 43 GPIO_ACTIVE_HIGH>;
110 };
111
112 router_white {
113 label = "white:router";
114 gpios = <&tlmm 28 GPIO_ACTIVE_HIGH>;
115 };
116
117 router_orange {
118 label = "orange:router";
119 gpios = <&tlmm 46 GPIO_ACTIVE_HIGH>;
120 };
121
122 internet_white {
123 label = "white:internet";
124 gpios = <&tlmm 27 GPIO_ACTIVE_HIGH>;
125 };
126
127 internet_orange {
128 label = "orange:internet";
129 gpios = <&tlmm 45 GPIO_ACTIVE_HIGH>;
130 };
131
132 wireless_white {
133 label = "white:wireless";
134 gpios = <&tlmm 24 GPIO_ACTIVE_HIGH>;
135 };
136
137 wireless_orange {
138 label = "orange:wireless";
139 gpios = <&tlmm 44 GPIO_ACTIVE_HIGH>;
140 };
141 };
142
143 keys {
144 compatible = "gpio-keys";
145
146 auto_mode {
147 label = "auto_mode";
148 gpios = <&tlmm 9 GPIO_ACTIVE_LOW>;
149 linux,code = <BTN_0>;
150 linux,input-type = <EV_SW>;
151 };
152
153 router_mode {
154 label = "router_mode";
155 gpios = <&tlmm 10 GPIO_ACTIVE_LOW>;
156 linux,code = <BTN_1>;
157 linux,input-type = <EV_SW>;
158 };
159
160 ap_mode {
161 label = "ap_mode";
162 gpios = <&tlmm 11 GPIO_ACTIVE_LOW>;
163 linux,code = <BTN_2>;
164 linux,input-type = <EV_SW>;
165 };
166
167 reset {
168 label = "reset";
169 gpios = <&tlmm 18 GPIO_ACTIVE_LOW>;
170 linux,code = <KEY_RESTART>;
171 };
172
173 wps {
174 label = "AOSS Button";
175 gpios = <&tlmm 32 GPIO_ACTIVE_LOW>;
176 linux,code = <KEY_WPS_BUTTON>;
177 };
178 };
179 };
180
181 &tlmm {
182 serial_0_pins: serial0_pinmux {
183 mux {
184 pins = "gpio16", "gpio17";
185 function = "blsp_uart0";
186 bias-disable;
187 };
188 };
189
190 mdio_pins: mdio_pinmux {
191 mux_1 {
192 pins = "gpio6";
193 function = "mdio";
194 bias-pull-up;
195 };
196
197 mux_2 {
198 pins = "gpio7";
199 function = "mdc";
200 bias-pull-up;
201 };
202 };
203
204 nand_pins: nand_pins {
205 pullups {
206 pins = "gpio52", "gpio53", "gpio58",
207 "gpio59";
208 function = "qpic";
209 bias-pull-up;
210 };
211
212 pulldowns {
213 pins = "gpio54", "gpio55", "gpio56",
214 "gpio57", "gpio60", "gpio61",
215 "gpio62", "gpio63", "gpio64",
216 "gpio65", "gpio66", "gpio67",
217 "gpio68", "gpio69";
218 function = "qpic";
219 bias-pull-down;
220 };
221 };
222
223 usb_power {
224 line-name = "USB power";
225 gpios = <34 GPIO_ACTIVE_HIGH>;
226 gpio-hog;
227 output-high;
228 };
229 };
230
231 &blsp_dma {
232 status = "okay";
233 };
234
235 &blsp1_uart1 {
236 pinctrl-0 = <&serial_0_pins>;
237 pinctrl-names = "default";
238 status = "okay";
239 };
240
241 &cryptobam {
242 status = "okay";
243 };
244
245 &pcie0 {
246 status = "okay";
247
248 bridge@0,0 {
249 reg = <0x00000000 0 0 0 0>;
250 #address-cells = <3>;
251 #size-cells = <2>;
252 ranges;
253
254 wifi@0,0 {
255 compatible = "qcom,ath10k";
256 reg = <0 0 0 0 0>;
257 nvmem-cell-names = "pre-calibration", "mac-address";
258 nvmem-cells = <&precal_art_9000>, <&macaddr_orgdata_32>;
259 qcom,ath10k-calibration-variant = "Buffalo-WTR-M2133HP";
260 };
261 };
262 };
263
264 &qpic_bam {
265 status = "okay";
266 };
267
268 &nand {
269 pinctrl-0 = <&nand_pins>;
270 pinctrl-names = "default";
271 status = "okay";
272
273 nand@0 {
274 partitions {
275 compatible = "fixed-partitions";
276 #address-cells = <1>;
277 #size-cells = <1>;
278
279 partition@0 {
280 label = "SBL1";
281 reg = <0x0000000 0x0100000>;
282 read-only;
283 };
284
285 partition@100000 {
286 label = "MIBIB";
287 reg = <0x0100000 0x0100000>;
288 read-only;
289 };
290
291 partition@200000 {
292 label = "BOOTCONFIG";
293 reg = <0x0200000 0x0100000>;
294 read-only;
295 };
296
297 partition@300000 {
298 label = "QSEE";
299 reg = <0x0300000 0x0100000>;
300 read-only;
301 };
302
303 partition@400000 {
304 label = "QSEE_1";
305 reg = <0x0400000 0x0100000>;
306 read-only;
307 };
308
309 partition@500000 {
310 label = "CDT";
311 reg = <0x0500000 0x0080000>;
312 read-only;
313 };
314
315 partition@580000 {
316 label = "CDT_1";
317 reg = <0x0580000 0x0080000>;
318 read-only;
319 };
320
321 partition@600000 {
322 label = "BOOTCONFIG1";
323 reg = <0x0600000 0x0080000>;
324 read-only;
325 };
326
327 partition@680000 {
328 label = "APPSBLENV";
329 reg = <0x0680000 0x0080000>;
330 };
331
332 partition@700000 {
333 label = "APPSBL";
334 reg = <0x0700000 0x0200000>;
335 read-only;
336 };
337
338 partition@900000 {
339 label = "APPSBL_1";
340 reg = <0x0900000 0x0200000>;
341 read-only;
342 };
343
344 partition@b00000 {
345 label = "ART";
346 reg = <0x0b00000 0x0080000>;
347 read-only;
348 compatible = "nvmem-cells";
349 #address-cells = <1>;
350 #size-cells = <1>;
351
352 precal_art_1000: precal@1000 {
353 reg = <0x1000 0x2f20>;
354 };
355
356 precal_art_5000: precal@5000 {
357 reg = <0x5000 0x2f20>;
358 };
359
360 precal_art_9000: precal@9000 {
361 reg = <0x5000 0x2f20>;
362 };
363 };
364
365 partition@b80000 {
366 label = "ART_1";
367 reg = <0x0b80000 0x0080000>;
368 read-only;
369 };
370
371 orgdata: partition@c00000 {
372 label = "ORGDATA";
373 reg = <0x0c00000 0x0080000>;
374 read-only;
375 compatible = "nvmem-cells";
376 #address-cells = <1>;
377 #size-cells = <1>;
378
379 macaddr_orgdata_20: macaddr@20 {
380 reg = <0x20 0x6>;
381 };
382 macaddr_orgdata_26: macaddr@26 {
383 reg = <0x26 0x6>;
384 };
385 macaddr_orgdata_2c: macaddr@2c {
386 reg = <0x2c 0x6>;
387 };
388 macaddr_orgdata_32: macaddr@32 {
389 reg = <0x32 0x6>;
390 };
391 };
392
393 partition@c80000 {
394 label = "ORGDATA_1";
395 reg = <0x0c80000 0x0080000>;
396 read-only;
397 };
398
399 partition@d00000 {
400 label = "ubi";
401 reg = <0x0d00000 0x2900000>;
402 };
403
404 partition@3600000 {
405 label = "rootfs_recover";
406 reg = <0x3600000 0x2900000>;
407 read-only;
408 };
409
410 partition@5f00000 {
411 label = "user_property";
412 reg = <0x5f00000 0x1a20000>;
413 read-only;
414 };
415 };
416 };
417 };
418
419 &wifi0 {
420 status = "okay";
421 nvmem-cell-names = "pre-calibration", "mac-address";
422 nvmem-cells = <&precal_art_1000>, <&macaddr_orgdata_26>;
423 qcom,ath10k-calibration-variant = "Buffalo-WTR-M2133HP";
424 ieee80211-freq-limit = <2400000 2483000>;
425 };
426
427 &wifi1 {
428 status = "okay";
429 nvmem-cell-names = "pre-calibration", "mac-address";
430 nvmem-cells = <&precal_art_5000>, <&macaddr_orgdata_2c>;
431 qcom,ath10k-calibration-variant = "Buffalo-WTR-M2133HP";
432 };
433
434 &mdio {
435 status = "okay";
436 pinctrl-0 = <&mdio_pins>;
437 pinctrl-names = "default";
438 reset-gpios = <&tlmm 47 GPIO_ACTIVE_LOW>;
439 };
440
441 &gmac0 {
442 nvmem-cells = <&macaddr_orgdata_20>;
443 nvmem-cell-names = "mac-address";
444 };
445
446 &gmac1 {
447 nvmem-cells = <&macaddr_orgdata_20>;
448 nvmem-cell-names = "mac-address";
449 };
450
451 &usb3_ss_phy {
452 status = "okay";
453 };
454
455 &usb3_hs_phy {
456 status = "okay";
457 };