82f3d350143e66a89ef1bb877f4e75631f0b8f86
[openwrt/staging/hauke.git] / target / linux / mediatek / dts / mt7981b-xiaomi-mi-router-wr30u.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 /dts-v1/;
4 #include <dt-bindings/input/input.h>
5 #include <dt-bindings/gpio/gpio.h>
6
7 #include "mt7981.dtsi"
8
9 / {
10 aliases {
11 serial0 = &uart0;
12 led-boot = &led_system_yellow;
13 led-failsafe = &led_system_yellow;
14 led-running = &led_system_blue;
15 led-upgrade = &led_system_yellow;
16 };
17
18 chosen {
19 stdout-path = "serial0:115200n8";
20 };
21
22 memory {
23 reg = <0 0x40000000 0 0x10000000>;
24 };
25
26 gpio-keys {
27 compatible = "gpio-keys";
28
29 reset {
30 label = "reset";
31 gpios = <&pio 1 GPIO_ACTIVE_LOW>;
32 linux,code = <KEY_RESTART>;
33 };
34
35 mesh {
36 label = "mesh";
37 gpios = <&pio 0 GPIO_ACTIVE_LOW>;
38 linux,code = <BTN_9>;
39 linux,input-type = <EV_SW>;
40 };
41 };
42
43 leds {
44 compatible = "gpio-leds";
45
46 led_system_blue: system_blue {
47 label = "blue:system";
48 gpios = <&pio 9 GPIO_ACTIVE_LOW>;
49 };
50
51 led_system_yellow: system_yellow {
52 label = "yellow:system";
53 gpios = <&pio 10 GPIO_ACTIVE_LOW>;
54 };
55
56 led_network_blue {
57 label = "blue:network";
58 gpios = <&pio 11 GPIO_ACTIVE_LOW>;
59 };
60
61 led_network_yellow {
62 label = "yellow:network";
63 gpios = <&pio 12 GPIO_ACTIVE_LOW>;
64 };
65 };
66 };
67
68 &eth {
69 status = "okay";
70
71 gmac0: mac@0 {
72 compatible = "mediatek,eth-mac";
73 reg = <0>;
74 phy-mode = "2500base-x";
75
76 nvmem-cells = <&macaddr_factory_4>;
77 nvmem-cell-names = "mac-address";
78 mac-address-increment = <(-1)>;
79
80 fixed-link {
81 speed = <2500>;
82 full-duplex;
83 pause;
84 };
85 };
86 };
87
88 &mdio_bus {
89 switch: switch@1f {
90 compatible = "mediatek,mt7531";
91 reg = <31>;
92 reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
93 interrupt-controller;
94 #interrupt-cells = <1>;
95 interrupt-parent = <&pio>;
96 interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
97 };
98 };
99
100 &switch {
101 ports {
102 #address-cells = <1>;
103 #size-cells = <0>;
104
105 port@0 {
106 reg = <0>;
107 label = "wan";
108 };
109
110 port@1 {
111 reg = <1>;
112 label = "lan2";
113 };
114
115 port@2 {
116 reg = <2>;
117 label = "lan3";
118 };
119
120 port@3 {
121 reg = <3>;
122 label = "lan4";
123 };
124
125 port@6 {
126 reg = <6>;
127 ethernet = <&gmac0>;
128 phy-mode = "2500base-x";
129
130 fixed-link {
131 speed = <2500>;
132 full-duplex;
133 pause;
134 };
135 };
136 };
137 };
138
139 &spi0 {
140 pinctrl-names = "default";
141 pinctrl-0 = <&spi0_flash_pins>;
142 status = "okay";
143
144 spi_nand: flash@0 {
145 #address-cells = <1>;
146 #size-cells = <1>;
147 compatible = "spi-nand";
148 reg = <0>;
149
150 spi-max-frequency = <52000000>;
151 spi-tx-bus-width = <4>;
152 spi-rx-bus-width = <4>;
153
154 partitions: partitions {
155 compatible = "fixed-partitions";
156 #address-cells = <1>;
157 #size-cells = <1>;
158
159 partition@0 {
160 label = "BL2";
161 reg = <0x00 0x100000>;
162 read-only;
163 };
164
165 partition@100000 {
166 label = "Nvram";
167 reg = <0x100000 0x40000>;
168 };
169
170 partition@140000 {
171 label = "Bdata";
172 reg = <0x140000 0x40000>;
173 };
174
175 factory: partition@180000 {
176 label = "Factory";
177 reg = <0x180000 0x200000>;
178 read-only;
179
180 nvmem-layout {
181 compatible = "fixed-layout";
182 #address-cells = <1>;
183 #size-cells = <1>;
184
185 macaddr_factory_4: macaddr@4 {
186 reg = <0x4 0x6>;
187 };
188 };
189 };
190
191 partition@380000 {
192 label = "FIP";
193 reg = <0x380000 0x200000>;
194 read-only;
195 };
196
197 partition@580000 {
198 label = "crash";
199 reg = <0x580000 0x40000>;
200 read-only;
201 };
202
203 partition@5c0000 {
204 label = "crash_log";
205 reg = <0x5c0000 0x40000>;
206 read-only;
207 };
208
209 partition@7600000 {
210 label = "KF";
211 reg = <0x7600000 0x40000>;
212 read-only;
213 };
214 };
215 };
216 };
217
218 &pio {
219 spi0_flash_pins: spi0-pins {
220 mux {
221 function = "spi";
222 groups = "spi0", "spi0_wp_hold";
223 };
224
225 conf-pu {
226 pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
227 drive-strength = <MTK_DRIVE_8mA>;
228 bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
229 };
230
231 conf-pd {
232 pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
233 drive-strength = <MTK_DRIVE_8mA>;
234 bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
235 };
236 };
237 };
238
239 &wifi {
240 status = "okay";
241
242 mediatek,mtd-eeprom = <&factory 0x0>;
243 };
244
245 &uart0 {
246 status = "okay";
247 };
248
249 &watchdog {
250 status = "okay";
251 };