ramips: convert MT7613 and MT7615 EEPROM to NVMEM format for MT7621
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_iodata_wn-dx1200gr.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
8 / {
9 compatible = "iodata,wn-dx1200gr", "mediatek,mt7621-soc";
10 model = "I-O DATA WN-DX1200GR";
11
12 aliases {
13 led-boot = &led_power;
14 led-failsafe = &led_power;
15 led-running = &led_power;
16 led-upgrade = &led_power;
17 label-mac-device = &gmac1;
18 };
19
20 leds {
21 compatible = "gpio-leds";
22
23 wps {
24 label = "blue:wps";
25 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
26 };
27
28 led_power: power {
29 label = "green:power";
30 gpios = <&gpio 9 GPIO_ACTIVE_HIGH>;
31 };
32 };
33
34 keys {
35 compatible = "gpio-keys";
36
37 reset {
38 label = "reset";
39 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
40 linux,code = <KEY_RESTART>;
41 };
42
43 repeater {
44 label = "repeater";
45 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
46 linux,code = <BTN_0>;
47 linux,input-type = <EV_SW>;
48 };
49
50 wps {
51 label = "wps";
52 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
53 linux,code = <KEY_WPS_BUTTON>;
54 };
55 };
56 };
57
58 &nand {
59 status = "okay";
60
61 mediatek,bbt;
62 mediatek,bmt-remap-range =
63 <0x0000000 0x0800000>,
64 <0x3600000 0x4980000>;
65
66 partitions {
67 compatible = "fixed-partitions";
68 #address-cells = <1>;
69 #size-cells = <1>;
70
71 partition@0 {
72 label = "u-boot";
73 reg = <0x0 0x100000>;
74 read-only;
75 };
76
77 partition@100000 {
78 label = "u-boot-env";
79 reg = <0x100000 0x100000>;
80 read-only;
81 };
82
83 factory: partition@200000 {
84 compatible = "nvmem-cells";
85 label = "factory";
86 reg = <0x200000 0x200000>;
87 #address-cells = <1>;
88 #size-cells = <1>;
89
90 eeprom_factory_0: eeprom@0 {
91 reg = <0x0 0x400>;
92 };
93
94 eeprom_factory_8000: eeprom@8000 {
95 reg = <0x8000 0x4da8>;
96 };
97
98 macaddr_factory_1e000: macaddr@1e000 {
99 reg = <0x1e000 0x6>;
100 };
101
102 macaddr_factory_1e006: macaddr@1e006 {
103 reg = <0x1e006 0x6>;
104 };
105 };
106
107 partition@400000 {
108 label = "kernel";
109 reg = <0x400000 0x400000>;
110 };
111
112 partition@800000 {
113 label = "ubi";
114 reg = <0x800000 0x2e00000>;
115 };
116
117 partition@3600000 {
118 label = "Config";
119 reg = <0x3600000 0x100000>;
120 read-only;
121 };
122
123 partition@3700000 {
124 label = "firmware_2";
125 reg = <0x3700000 0x3200000>;
126 };
127
128 partition@6900000 {
129 label = "Config_2";
130 reg = <0x6900000 0x100000>;
131 read-only;
132 };
133
134 partition@6a00000 {
135 label = "persist";
136 reg = <0x6a00000 0x100000>;
137 };
138
139 partition@6b00000 {
140 label = "idmkey";
141 reg = <0x6b00000 0x100000>;
142 read-only;
143 };
144
145 partition@6c00000 {
146 label = "Backup";
147 reg = <0x6c00000 0x1380000>;
148 read-only;
149 };
150 };
151 };
152
153 &gmac0 {
154 nvmem-cells = <&macaddr_factory_1e000>;
155 nvmem-cell-names = "mac-address";
156 };
157
158 &gmac1 {
159 status = "okay";
160 label = "wan";
161 phy-handle = <&ethphy0>;
162
163 nvmem-cells = <&macaddr_factory_1e006>;
164 nvmem-cell-names = "mac-address";
165 };
166
167 &mdio {
168 ethphy0: ethernet-phy@0 {
169 reg = <0>;
170 };
171 };
172
173 &switch0 {
174 ports {
175 port@1 {
176 status = "okay";
177 label = "lan4";
178 };
179
180 port@2 {
181 status = "okay";
182 label = "lan3";
183 };
184
185 port@3 {
186 status = "okay";
187 label = "lan2";
188 };
189
190 port@4 {
191 status = "okay";
192 label = "lan1";
193 };
194 };
195 };
196
197 &pcie {
198 status = "okay";
199 };
200
201 &pcie0 {
202 wifi@0,0 {
203 compatible = "mediatek,mt76";
204 reg = <0x0000 0 0 0 0>;
205 ieee80211-freq-limit = <2400000 2500000>;
206
207 nvmem-cells = <&eeprom_factory_0>;
208 nvmem-cell-names = "eeprom";
209 };
210 };
211
212 &pcie1 {
213 wifi@0,0 {
214 compatible = "mediatek,mt76";
215 reg = <0x0000 0 0 0 0>;
216 ieee80211-freq-limit = <5000000 6000000>;
217
218 nvmem-cells = <&eeprom_factory_8000>;
219 nvmem-cell-names = "eeprom";
220 };
221 };
222
223 &state_default {
224 gpio {
225 groups = "uart2", "uart3", "wdt";
226 function = "gpio";
227 };
228 };
229
230 &xhci {
231 status = "disabled";
232 };