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