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