4b2754b001251e53a5d5f356de9df0b3bb377888
[openwrt/openwrt.git] / target / linux / mediatek / dts / mt7986a-xiaomi-redmi-router-ax6000.dtsi
1 // SPDX-License-Identifier: (GPL-2.0 OR MIT)
2
3 /dts-v1/;
4 #include <dt-bindings/input/input.h>
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/leds/common.h>
7
8 #include "mt7986a.dtsi"
9
10 / {
11 aliases {
12 serial0 = &uart0;
13 led-boot = &led_status_rgb;
14 led-failsafe = &led_status_rgb;
15 led-running = &led_status_rgb;
16 led-upgrade = &led_status_rgb;
17 };
18
19 chosen {
20 stdout-path = "serial0:115200n8";
21 };
22
23 memory {
24 reg = <0 0x40000000 0 0x20000000>;
25 };
26
27 keys {
28 compatible = "gpio-keys";
29
30 reset {
31 label = "reset";
32 gpios = <&pio 9 GPIO_ACTIVE_LOW>;
33 linux,code = <KEY_RESTART>;
34 };
35
36 mesh {
37 label = "mesh";
38 gpios = <&pio 10 GPIO_ACTIVE_LOW>;
39 linux,code = <BTN_9>;
40 linux,input-type = <EV_SW>;
41 };
42 };
43 };
44
45 &eth {
46 status = "okay";
47
48 gmac0: mac@0 {
49 compatible = "mediatek,eth-mac";
50 reg = <0>;
51 phy-mode = "2500base-x";
52
53 nvmem-cells = <&macaddr_factory_4>;
54 nvmem-cell-names = "mac-address";
55 mac-address-increment = <(-1)>;
56
57 fixed-link {
58 speed = <2500>;
59 full-duplex;
60 pause;
61 };
62 };
63
64 mdio: mdio-bus {
65 #address-cells = <1>;
66 #size-cells = <0>;
67 };
68 };
69
70 &mdio {
71 switch: switch@0 {
72 compatible = "mediatek,mt7531";
73 reg = <31>;
74 reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>;
75 interrupt-controller;
76 #interrupt-cells = <1>;
77 interrupt-parent = <&pio>;
78 interrupts = <66 IRQ_TYPE_LEVEL_HIGH>;
79 };
80 };
81
82 &pio {
83 spi_flash_pins: spi-flash-pins-33-to-38 {
84 mux {
85 function = "spi";
86 groups = "spi0", "spi0_wp_hold";
87 };
88 conf-pu {
89 pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
90 drive-strength = <8>;
91 mediatek,pull-up-adv = <0>; /* bias-disable */
92 };
93 conf-pd {
94 pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
95 drive-strength = <8>;
96 mediatek,pull-down-adv = <0>; /* bias-disable */
97 };
98 };
99
100 spi_led_pins: spic-pins-29-to-32 {
101 mux {
102 function = "spi";
103 groups = "spi1_2";
104 };
105 };
106
107 wf_2g_5g_pins: wf_2g_5g-pins {
108 mux {
109 function = "wifi";
110 groups = "wf_2g", "wf_5g";
111 };
112 conf {
113 pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
114 "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
115 "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
116 "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
117 "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
118 "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
119 "WF1_TOP_CLK", "WF1_TOP_DATA";
120 drive-strength = <4>;
121 };
122 };
123 };
124
125 &spi0 {
126 pinctrl-names = "default";
127 pinctrl-0 = <&spi_flash_pins>;
128 cs-gpios = <0>, <0>;
129 status = "okay";
130
131 flash@0 {
132 compatible = "spi-nand";
133 #address-cells = <1>;
134 #size-cells = <1>;
135 reg = <0>;
136
137 mediatek,nmbm;
138 mediatek,bmt-max-ratio = <1>;
139 mediatek,bmt-max-reserved-blocks = <64>;
140
141 spi-max-frequency = <20000000>;
142 spi-tx-buswidth = <4>;
143 spi-rx-buswidth = <4>;
144
145 partitions: partitions {
146 compatible = "fixed-partitions";
147 #address-cells = <1>;
148 #size-cells = <1>;
149
150 partition@0 {
151 label = "BL2";
152 reg = <0x0 0x100000>;
153 read-only;
154 };
155
156 partition@100000 {
157 label = "Nvram";
158 reg = <0x100000 0x40000>;
159 };
160
161 partition@140000 {
162 label = "Bdata";
163 reg = <0x140000 0x40000>;
164 };
165
166 factory: partition@180000 {
167 label = "Factory";
168 reg = <0x180000 0x200000>;
169 read-only;
170
171 compatible = "nvmem-cells";
172 #address-cells = <1>;
173 #size-cells = <1>;
174
175 macaddr_factory_4: macaddr@4 {
176 reg = <0x4 0x6>;
177 };
178 };
179
180 partition@380000 {
181 label = "FIP";
182 reg = <0x380000 0x200000>;
183 read-only;
184 };
185
186 partition@580000 {
187 label = "crash";
188 reg = <0x580000 0x40000>;
189 read-only;
190 };
191
192 partition@5c0000 {
193 label = "crash_log";
194 reg = <0x5c0000 0x40000>;
195 read-only;
196 };
197 };
198 };
199 };
200
201 &spi1 {
202 pinctrl-names = "default";
203 pinctrl-0 = <&spi_led_pins>;
204 status = "okay";
205
206 ws2812b@0 {
207 #address-cells = <1>;
208 #size-cells = <0>;
209 compatible = "worldsemi,ws2812b";
210 reg = <0>;
211 spi-max-frequency = <3000000>;
212
213 led_status_rgb: led@0 {
214 reg = <0>;
215 label = "rgb:status";
216 color-index = <LED_COLOR_ID_RED LED_COLOR_ID_GREEN LED_COLOR_ID_BLUE>;
217 };
218
219 led_network_rgb: led@1 {
220 reg = <1>;
221 label = "rgb:network";
222 color-index = <LED_COLOR_ID_RED LED_COLOR_ID_GREEN LED_COLOR_ID_BLUE>;
223 };
224 };
225 };
226
227 &switch {
228 ports {
229 #address-cells = <1>;
230 #size-cells = <0>;
231
232 port@1 {
233 reg = <1>;
234 label = "lan4";
235 };
236
237 port@2 {
238 reg = <2>;
239 label = "lan3";
240 };
241
242 port@3 {
243 reg = <3>;
244 label = "lan2";
245 };
246
247 port@4 {
248 reg = <4>;
249 label = "wan";
250 };
251
252 port@6 {
253 reg = <6>;
254 label = "cpu";
255 ethernet = <&gmac0>;
256 phy-mode = "2500base-x";
257
258 fixed-link {
259 speed = <2500>;
260 full-duplex;
261 pause;
262 };
263 };
264 };
265 };
266
267 &wmac {
268 status = "okay";
269 pinctrl-names = "default";
270 pinctrl-0 = <&wf_2g_5g_pins>;
271
272 mediatek,mtd-eeprom = <&factory 0x0>;
273 };
274
275 &uart0 {
276 status = "okay";
277 };