ramips: convert MT7603 EEPROM to NVMEM format
[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 macaddr_factory_1e000: macaddr@1e000 {
95 reg = <0x1e000 0x6>;
96 };
97
98 macaddr_factory_1e006: macaddr@1e006 {
99 reg = <0x1e006 0x6>;
100 };
101 };
102
103 partition@400000 {
104 label = "kernel";
105 reg = <0x400000 0x400000>;
106 };
107
108 partition@800000 {
109 label = "ubi";
110 reg = <0x800000 0x2e00000>;
111 };
112
113 partition@3600000 {
114 label = "Config";
115 reg = <0x3600000 0x100000>;
116 read-only;
117 };
118
119 partition@3700000 {
120 label = "firmware_2";
121 reg = <0x3700000 0x3200000>;
122 };
123
124 partition@6900000 {
125 label = "Config_2";
126 reg = <0x6900000 0x100000>;
127 read-only;
128 };
129
130 partition@6a00000 {
131 label = "persist";
132 reg = <0x6a00000 0x100000>;
133 };
134
135 partition@6b00000 {
136 label = "idmkey";
137 reg = <0x6b00000 0x100000>;
138 read-only;
139 };
140
141 partition@6c00000 {
142 label = "Backup";
143 reg = <0x6c00000 0x1380000>;
144 read-only;
145 };
146 };
147 };
148
149 &gmac0 {
150 nvmem-cells = <&macaddr_factory_1e000>;
151 nvmem-cell-names = "mac-address";
152 };
153
154 &gmac1 {
155 status = "okay";
156 label = "wan";
157 phy-handle = <&ethphy0>;
158
159 nvmem-cells = <&macaddr_factory_1e006>;
160 nvmem-cell-names = "mac-address";
161 };
162
163 &mdio {
164 ethphy0: ethernet-phy@0 {
165 reg = <0>;
166 };
167 };
168
169 &switch0 {
170 ports {
171 port@1 {
172 status = "okay";
173 label = "lan4";
174 };
175
176 port@2 {
177 status = "okay";
178 label = "lan3";
179 };
180
181 port@3 {
182 status = "okay";
183 label = "lan2";
184 };
185
186 port@4 {
187 status = "okay";
188 label = "lan1";
189 };
190 };
191 };
192
193 &pcie {
194 status = "okay";
195 };
196
197 &pcie0 {
198 wifi@0,0 {
199 compatible = "mediatek,mt76";
200 reg = <0x0000 0 0 0 0>;
201 ieee80211-freq-limit = <2400000 2500000>;
202
203 nvmem-cells = <&eeprom_factory_0>;
204 nvmem-cell-names = "eeprom";
205 };
206 };
207
208 &pcie1 {
209 wifi@0,0 {
210 compatible = "mediatek,mt76";
211 reg = <0x0000 0 0 0 0>;
212
213 mediatek,mtd-eeprom = <&factory 0x8000>;
214 ieee80211-freq-limit = <5000000 6000000>;
215 };
216 };
217
218 &state_default {
219 gpio {
220 groups = "uart2", "uart3", "wdt";
221 function = "gpio";
222 };
223 };
224
225 &xhci {
226 status = "disabled";
227 };