ramips: fix nvmem-cells for routers based on TP-Link Archer
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_asus_rt-ax53u.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7 #include <dt-bindings/leds/common.h>
8
9 / {
10 compatible = "asus,rt-ax53u", "mediatek,mt7621-soc";
11 model = "ASUS RT-AX53U";
12
13 aliases {
14 led-boot = &led_power;
15 led-failsafe = &led_power;
16 led-running = &led_power;
17 led-upgrade = &led_power;
18 label-mac-device = &gmac0;
19 };
20
21 chosen {
22 bootargs = "console=ttyS0,115200";
23 bootargs-override = "console=ttyS0,115200";
24 };
25
26 leds {
27 compatible = "gpio-leds";
28
29 led_power: power {
30 color = <LED_COLOR_ID_BLUE>;
31 function = LED_FUNCTION_POWER;
32 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
33 };
34
35 led_usb {
36 color = <LED_COLOR_ID_BLUE>;
37 function = LED_FUNCTION_USB;
38 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
39 trigger-sources = <&ehci_port2>;
40 linux,default-trigger = "usbport";
41 };
42 };
43
44 keys {
45 compatible = "gpio-keys";
46
47 key-restart {
48 label = "reset";
49 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
50 linux,code = <KEY_RESTART>;
51 };
52
53 key-wps {
54 label = "wps";
55 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
56 linux,code = <KEY_WPS_BUTTON>;
57 };
58 };
59 };
60
61 &nand {
62 status = "okay";
63
64 mediatek,nmbm;
65 mediatek,bmt-remap-range =
66 <0x000000 0x7e0000>,
67 <0x35e0000 0x7800000>;
68
69 partitions {
70 compatible = "fixed-partitions";
71 #address-cells = <1>;
72 #size-cells = <1>;
73
74 partition@0 {
75 label = "u-boot";
76 reg = <0x0 0x80000>;
77 read-only;
78 };
79
80 /*
81 * u-boot gets split here while keeping u-boot read-only,
82 * which allows safe usage of fw_setenv
83 */
84 partition@80000 {
85 label = "u-boot-env";
86 reg = <0x80000 0x60000>;
87 };
88
89 partition@e0000 {
90 label = "nvram";
91 reg = <0xe0000 0x100000>;
92 read-only;
93 };
94
95 partition@1e0000 {
96 label = "factory";
97 reg = <0x1e0000 0x100000>;
98 read-only;
99
100 nvmem-layout {
101 compatible = "fixed-layout";
102 #address-cells = <1>;
103 #size-cells = <1>;
104
105 eeprom_factory_0: eeprom@0 {
106 reg = <0x0 0xe00>;
107 };
108
109 macaddr_factory_4: macaddr@4 {
110 reg = <0x4 0x6>;
111 };
112
113 precal_factory_e10: precal@e10 {
114 reg = <0xe10 0x19c10>;
115 };
116 };
117 };
118
119 partition@2e0000 {
120 label = "factory2";
121 reg = <0x2e0000 0x100000>;
122 read-only;
123 };
124
125 partition@3e0000 {
126 label = "firmware";
127 reg = <0x3e0000 0x3200000>;
128
129 compatible = "fixed-partitions";
130 #address-cells = <1>;
131 #size-cells = <1>;
132
133 partition@0 {
134 label = "kernel";
135 reg = <0x0 0x400000>;
136 };
137
138 partition@400000 {
139 label = "ubi";
140 reg = <0x400000 0x2e00000>;
141 };
142 };
143
144 partition@35e0000 {
145 label = "firmware2";
146 reg = <0x35e0000 0x3200000>;
147 };
148
149 partition@67e0000 {
150 label = "jffs2";
151 reg = <0x67e0000 0x1020000>;
152 };
153
154 /* Last 8M are reserved for NMBM management (bad blocks) */
155 };
156 };
157
158 &pcie {
159 status = "okay";
160 };
161
162 &pcie1 {
163 wifi@0,0 {
164 compatible = "mediatek,mt76";
165 reg = <0x0000 0 0 0 0>;
166 nvmem-cells = <&eeprom_factory_0>, <&precal_factory_e10>;
167 nvmem-cell-names = "eeprom", "precal";
168 mediatek,disable-radar-background;
169 };
170 };
171
172 &gmac0 {
173 nvmem-cells = <&macaddr_factory_4>;
174 nvmem-cell-names = "mac-address";
175 };
176
177 &gmac1 {
178 status = "okay";
179 label = "wan";
180 phy-handle = <&ethphy0>;
181
182 nvmem-cells = <&macaddr_factory_4>;
183 nvmem-cell-names = "mac-address";
184 };
185
186 &mdio {
187 ethphy0: ethernet-phy@0 {
188 reg = <0>;
189 };
190 };
191
192 &switch0 {
193 ports {
194 port@1 {
195 status = "okay";
196 label = "lan1";
197 };
198
199 port@2 {
200 status = "okay";
201 label = "lan2";
202 };
203
204 port@3 {
205 status = "okay";
206 label = "lan3";
207 };
208 };
209 };
210
211 &state_default {
212 gpio {
213 groups = "i2c", "uart2", "uart3", "jtag", "wdt";
214 function = "gpio";
215 };
216 };
217