mediatek: use mac-base
[openwrt/staging/jow.git] / target / linux / mediatek / dts / mt7981b-cudy-wr3000-v1.dts
1 // SPDX-License-Identifier: (GPL-2.0 OR MIT)
2
3 /dts-v1/;
4
5 #include "mt7981.dtsi"
6
7 / {
8 model = "Cudy WR3000 v1";
9 compatible = "cudy,wr3000-v1", "mediatek,mt7981";
10
11 aliases {
12 ethernet0 = &gmac0;
13 label-mac-device = &lan1;
14 led-boot = &led_status;
15 led-failsafe = &led_status;
16 led-running = &led_status;
17 led-upgrade = &led_status;
18 serial0 = &uart0;
19 };
20
21 chosen {
22 stdout-path = "serial0:115200n8";
23 };
24
25 gpio-keys {
26 compatible = "gpio-keys";
27
28 reset {
29 label = "reset";
30 linux,code = <KEY_RESTART>;
31 gpios = <&pio 1 GPIO_ACTIVE_LOW>;
32 };
33
34 wps {
35 label = "wps";
36 linux,code = <KEY_WPS_BUTTON>;
37 gpios = <&pio 0 GPIO_ACTIVE_HIGH>;
38 };
39 };
40
41 leds {
42 compatible = "gpio-leds";
43
44 led_status: led@0 {
45 label = "blue:status";
46 gpios = <&pio 10 GPIO_ACTIVE_LOW>;
47 };
48
49 led@1 {
50 label = "blue:internet";
51 gpios = <&pio 11 GPIO_ACTIVE_LOW>;
52 };
53
54 led@2 {
55 label = "blue:wan";
56 gpios = <&pio 5 GPIO_ACTIVE_LOW>;
57 };
58
59 led@3 {
60 label = "blue:lan";
61 gpios = <&pio 9 GPIO_ACTIVE_LOW>;
62 };
63
64 led@4 {
65 label = "blue:wifi2";
66 gpios = <&pio 6 GPIO_ACTIVE_LOW>;
67 linux,default-trigger = "phy0tpt";
68 };
69
70 led@5 {
71 label = "blue:wifi5";
72 gpios = <&pio 7 GPIO_ACTIVE_LOW>;
73 linux,default-trigger = "phy1tpt";
74 };
75 };
76 };
77
78 &uart0 {
79 status = "okay";
80 };
81
82 &watchdog {
83 status = "okay";
84 };
85
86 &eth {
87 pinctrl-names = "default";
88 pinctrl-0 = <&mdio_pins>;
89
90 status = "okay";
91
92 gmac0: mac@0 {
93 compatible = "mediatek,eth-mac";
94 reg = <0>;
95 phy-mode = "2500base-x";
96
97 nvmem-cell-names = "mac-address";
98 nvmem-cells = <&macaddr_bdinfo_de00 0>;
99
100 fixed-link {
101 speed = <2500>;
102 full-duplex;
103 pause;
104 };
105 };
106
107 gmac1: mac@1 {
108 compatible = "mediatek,eth-mac";
109 reg = <1>;
110 status = "disabled";
111 };
112 };
113
114 &mdio_bus {
115 switch: switch@1f {
116 compatible = "mediatek,mt7531";
117 reg = <31>;
118 reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
119 };
120 };
121
122 &spi0 {
123 pinctrl-names = "default";
124 pinctrl-0 = <&spi0_flash_pins>;
125 status = "disabled";
126 };
127
128 &spi2 {
129 pinctrl-names = "default";
130 pinctrl-0 = <&spi2_flash_pins>;
131 status = "okay";
132
133 flash@0 {
134 #address-cells = <1>;
135 #size-cells = <1>;
136
137 compatible = "jedec,spi-nor";
138 reg = <0>;
139
140 spi-max-frequency = <25000000>;
141 spi-tx-bus-width = <4>;
142 spi-rx-bus-width = <4>;
143
144 partitions {
145 compatible = "fixed-partitions";
146 #address-cells = <1>;
147 #size-cells = <1>;
148
149 partition@00000 {
150 label = "BL2";
151 reg = <0x00000 0x40000>;
152 read-only;
153 };
154
155 partition@40000 {
156 label = "u-boot-env";
157 reg = <0x40000 0x10000>;
158 read-only;
159 };
160
161 factory: partition@50000 {
162 label = "Factory";
163 reg = <0x50000 0x10000>;
164 read-only;
165 };
166
167 bdinfo: partition@60000 {
168 label = "bdinfo";
169 reg = <0x60000 0x10000>;
170 read-only;
171
172 nvmem-layout {
173 compatible = "fixed-layout";
174 #address-cells = <1>;
175 #size-cells = <1>;
176
177 macaddr_bdinfo_de00: macaddr@de00 {
178 compatible = "mac-base";
179 reg = <0xde00 0x6>;
180 #nvmem-cell-cells = <1>;
181 };
182 };
183 };
184
185 partition@70000 {
186 label = "FIP";
187 reg = <0x70000 0x80000>;
188 read-only;
189 };
190
191 partition@f0000 {
192 compatible = "denx,fit";
193 label = "firmware";
194 reg = <0xf0000 0xf10000>;
195 };
196 };
197 };
198 };
199
200 &pio {
201 spi0_flash_pins: spi0-pins {
202 mux {
203 function = "spi";
204 groups = "spi0", "spi0_wp_hold";
205 };
206 };
207
208 spi2_flash_pins: spi2-pins {
209 mux {
210 function = "spi";
211 groups = "spi2", "spi2_wp_hold";
212 };
213
214 conf-pu {
215 pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
216 drive-strength = <8>;
217 bias-pull-up = <103>;
218 };
219
220 conf-pd {
221 pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
222 drive-strength = <8>;
223 bias-pull-down = <103>;
224 };
225 };
226 };
227
228 &switch {
229 ports {
230 #address-cells = <1>;
231 #size-cells = <0>;
232
233 port@0 {
234 reg = <0>;
235 label = "wan";
236
237 nvmem-cell-names = "mac-address";
238 nvmem-cells = <&macaddr_bdinfo_de00 1>;
239 };
240
241 lan1: port@1 {
242 reg = <1>;
243 label = "lan1";
244
245 nvmem-cell-names = "mac-address";
246 nvmem-cells = <&macaddr_bdinfo_de00 0>;
247 };
248
249 port@2 {
250 reg = <2>;
251 label = "lan2";
252
253 nvmem-cell-names = "mac-address";
254 nvmem-cells = <&macaddr_bdinfo_de00 0>;
255 };
256
257 port@3 {
258 reg = <3>;
259 label = "lan3";
260
261 nvmem-cell-names = "mac-address";
262 nvmem-cells = <&macaddr_bdinfo_de00 0>;
263 };
264
265 port@6 {
266 reg = <6>;
267 label = "cpu";
268 ethernet = <&gmac0>;
269 phy-mode = "2500base-x";
270
271 fixed-link {
272 speed = <2500>;
273 full-duplex;
274 pause;
275 };
276 };
277 };
278 };
279
280 &wifi {
281 status = "okay";
282 mediatek,mtd-eeprom = <&factory 0x0>;
283 };