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