mediatek: filogic: add H3C Magic NX30 Pro support
[openwrt/staging/stintel.git] / target / linux / mediatek / dts / mt7981b-h3c-magic-nx30-pro.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 /dts-v1/;
4 #include <dt-bindings/gpio/gpio.h>
5 #include <dt-bindings/input/input.h>
6
7 #include "mt7981.dtsi"
8
9 / {
10 model = "H3C Magic NX30 Pro";
11 compatible = "h3c,magic-nx30-pro", "mediatek,mt7981";
12
13 aliases {
14 serial0 = &uart0;
15 led-boot = &led_status_green;
16 led-failsafe = &led_status_red;
17 led-running = &led_status_green;
18 led-upgrade = &led_status_red;
19 };
20
21 chosen {
22 stdout-path = "serial0:115200n8";
23 };
24
25 memory {
26 reg = <0 0x40000000 0 0x10000000>;
27 };
28
29 gpio-keys {
30 compatible = "gpio-keys";
31
32 reset {
33 label = "reset";
34 linux,code = <KEY_RESTART>;
35 gpios = <&pio 1 GPIO_ACTIVE_LOW>;
36 };
37
38 wps {
39 label = "wps";
40 linux,code = <KEY_WPS_BUTTON>;
41 gpios = <&pio 0 GPIO_ACTIVE_LOW>;
42 };
43 };
44
45 leds {
46 compatible = "gpio-leds";
47
48 led_status_green: green {
49 label = "green:status";
50 gpios = <&pio 4 GPIO_ACTIVE_LOW>;
51 };
52
53 led_status_red: red {
54 label = "red:status";
55 gpios = <&pio 5 GPIO_ACTIVE_LOW>;
56 };
57 };
58 };
59
60 &eth {
61 status = "okay";
62
63 gmac0: mac@0 {
64 compatible = "mediatek,eth-mac";
65 reg = <0>;
66 phy-mode = "2500base-x";
67
68 fixed-link {
69 speed = <2500>;
70 full-duplex;
71 pause;
72 };
73 };
74
75 gmac1: mac@1 {
76 compatible = "mediatek,eth-mac";
77 reg = <1>;
78 phy-mode = "gmii";
79 phy-handle = <&int_gbe_phy>;
80 };
81 };
82
83 &mdio_bus {
84 switch: switch@0 {
85 compatible = "mediatek,mt7531";
86 reg = <31>;
87 reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
88 interrupt-controller;
89 #interrupt-cells = <1>;
90 interrupt-parent = <&pio>;
91 interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
92 };
93 };
94
95 &spi0 {
96 pinctrl-names = "default";
97 pinctrl-0 = <&spi0_flash_pins>;
98 status = "okay";
99
100 spi_nand@0 {
101 compatible = "spi-nand";
102 #address-cells = <1>;
103 #size-cells = <1>;
104 reg = <0>;
105
106 spi-max-frequency = <52000000>;
107 spi-tx-buswidth = <4>;
108 spi-rx-buswidth = <4>;
109
110 partitions {
111 compatible = "fixed-partitions";
112 #address-cells = <1>;
113 #size-cells = <1>;
114
115 partition@0 {
116 label = "BL2";
117 reg = <0x0000000 0x0100000>;
118 read-only;
119 };
120
121 partition@100000 {
122 label = "u-boot-env";
123 reg = <0x0100000 0x0080000>;
124 };
125
126 factory: partition@180000 {
127 label = "Factory";
128 reg = <0x0180000 0x0200000>;
129 read-only;
130 };
131
132 partition@380000 {
133 label = "FIP";
134 reg = <0x0380000 0x0200000>;
135 read-only;
136 };
137
138 partition@580000 {
139 label = "ubi";
140 reg = <0x0580000 0x4000000>;
141 };
142
143 /* yaffs partition */
144 partition@4580000 {
145 label = "pdt_data";
146 reg = <0x4580000 0x0600000>;
147 read-only;
148 };
149
150 /* yaffs partition */
151 partition@4b80000 {
152 label = "pdt_data_1";
153 reg = <0x4b80000 0x0600000>;
154 read-only;
155 };
156
157 partition@5180000 {
158 label = "exp";
159 reg = <0x5180000 0x0100000>;
160 read-only;
161 };
162
163 partition@5280000 {
164 label = "plugin";
165 reg = <0x5280000 0x2580000>;
166 read-only;
167 };
168 };
169 };
170 };
171
172 &switch {
173 ports {
174 #address-cells = <1>;
175 #size-cells = <0>;
176
177 port@0 {
178 reg = <0>;
179 label = "lan1";
180 };
181
182 port@1 {
183 reg = <1>;
184 label = "lan2";
185 };
186
187 port@2 {
188 reg = <2>;
189 label = "lan3";
190 };
191
192 port@6 {
193 reg = <6>;
194 ethernet = <&gmac0>;
195 phy-mode = "2500base-x";
196
197 fixed-link {
198 speed = <2500>;
199 full-duplex;
200 pause;
201 };
202 };
203 };
204 };
205
206 &pio {
207 spi0_flash_pins: spi0-pins {
208 mux {
209 function = "spi";
210 groups = "spi0", "spi0_wp_hold";
211 };
212
213 conf-pu {
214 pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
215 drive-strength = <8>;
216 mediatek,pull-up-adv = <0>; /* bias-disable */
217 };
218
219 conf-pd {
220 pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
221 drive-strength = <8>;
222 mediatek,pull-up-adv = <0>; /* bias-disable */
223 };
224 };
225 };
226
227 &uart0 {
228 status = "okay";
229 };
230
231 &watchdog {
232 status = "okay";
233 };
234
235 &wifi {
236 status = "okay";
237
238 mediatek,mtd-eeprom = <&factory 0x0>;
239 };