mediatek: convert to nvmem-layout
[openwrt/staging/hauke.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>;
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 reg = <0xde00 0x6>;
179 };
180 };
181 };
182
183 partition@70000 {
184 label = "FIP";
185 reg = <0x70000 0x80000>;
186 read-only;
187 };
188
189 partition@f0000 {
190 compatible = "denx,fit";
191 label = "firmware";
192 reg = <0xf0000 0xf10000>;
193 };
194 };
195 };
196 };
197
198 &pio {
199 spi0_flash_pins: spi0-pins {
200 mux {
201 function = "spi";
202 groups = "spi0", "spi0_wp_hold";
203 };
204 };
205
206 spi2_flash_pins: spi2-pins {
207 mux {
208 function = "spi";
209 groups = "spi2", "spi2_wp_hold";
210 };
211
212 conf-pu {
213 pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
214 drive-strength = <8>;
215 bias-pull-up = <103>;
216 };
217
218 conf-pd {
219 pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
220 drive-strength = <8>;
221 bias-pull-down = <103>;
222 };
223 };
224 };
225
226 &switch {
227 ports {
228 #address-cells = <1>;
229 #size-cells = <0>;
230
231 port@0 {
232 reg = <0>;
233 label = "wan";
234
235 nvmem-cell-names = "mac-address";
236 nvmem-cells = <&macaddr_bdinfo_de00>;
237 mac-address-increment = <1>;
238 };
239
240 lan1: port@1 {
241 reg = <1>;
242 label = "lan1";
243
244 nvmem-cell-names = "mac-address";
245 nvmem-cells = <&macaddr_bdinfo_de00>;
246 };
247
248 port@2 {
249 reg = <2>;
250 label = "lan2";
251
252 nvmem-cell-names = "mac-address";
253 nvmem-cells = <&macaddr_bdinfo_de00>;
254 };
255
256 port@3 {
257 reg = <3>;
258 label = "lan3";
259
260 nvmem-cell-names = "mac-address";
261 nvmem-cells = <&macaddr_bdinfo_de00>;
262 };
263
264 port@6 {
265 reg = <6>;
266 label = "cpu";
267 ethernet = <&gmac0>;
268 phy-mode = "2500base-x";
269
270 fixed-link {
271 speed = <2500>;
272 full-duplex;
273 pause;
274 };
275 };
276 };
277 };
278
279 &wifi {
280 status = "okay";
281 mediatek,mtd-eeprom = <&factory 0x0>;
282 };