mediatek: convert to new LED color/function format where possible
[openwrt/staging/mans0n.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 <dt-bindings/leds/common.h>
6
7 #include "mt7981.dtsi"
8
9 / {
10 model = "Cudy WR3000 v1";
11 compatible = "cudy,wr3000-v1", "mediatek,mt7981";
12
13 aliases {
14 ethernet0 = &gmac0;
15 label-mac-device = &gmac0;
16 led-boot = &led_status;
17 led-failsafe = &led_status;
18 led-running = &led_status;
19 led-upgrade = &led_status;
20 serial0 = &uart0;
21 };
22
23 chosen {
24 stdout-path = "serial0:115200n8";
25 };
26
27 gpio-keys {
28 compatible = "gpio-keys";
29
30 reset {
31 label = "reset";
32 linux,code = <KEY_RESTART>;
33 gpios = <&pio 1 GPIO_ACTIVE_LOW>;
34 };
35
36 wps {
37 label = "wps";
38 linux,code = <KEY_WPS_BUTTON>;
39 gpios = <&pio 0 GPIO_ACTIVE_HIGH>;
40 };
41 };
42
43 leds {
44 compatible = "gpio-leds";
45
46 led_status: led@0 {
47 function = LED_FUNCTION_STATUS;
48 color = <LED_COLOR_ID_BLUE>;
49 gpios = <&pio 10 GPIO_ACTIVE_LOW>;
50 };
51
52 led@1 {
53 label = "blue:internet";
54 gpios = <&pio 11 GPIO_ACTIVE_LOW>;
55 };
56
57 led@2 {
58 function = LED_FUNCTION_WAN;
59 color = <LED_COLOR_ID_BLUE>;
60 gpios = <&pio 5 GPIO_ACTIVE_LOW>;
61 };
62
63 led@3 {
64 function = LED_FUNCTION_LAN;
65 color = <LED_COLOR_ID_BLUE>;
66 gpios = <&pio 9 GPIO_ACTIVE_LOW>;
67 };
68
69 led@4 {
70 label = "blue:wifi2";
71 gpios = <&pio 6 GPIO_ACTIVE_LOW>;
72 linux,default-trigger = "phy0tpt";
73 };
74
75 led@5 {
76 label = "blue:wifi5";
77 gpios = <&pio 7 GPIO_ACTIVE_LOW>;
78 linux,default-trigger = "phy1tpt";
79 };
80 };
81 };
82
83 &uart0 {
84 status = "okay";
85 };
86
87 &watchdog {
88 status = "okay";
89 };
90
91 &eth {
92 pinctrl-names = "default";
93 pinctrl-0 = <&mdio_pins>;
94
95 status = "okay";
96
97 gmac0: mac@0 {
98 compatible = "mediatek,eth-mac";
99 reg = <0>;
100 phy-mode = "2500base-x";
101
102 nvmem-cell-names = "mac-address";
103 nvmem-cells = <&macaddr_bdinfo_de00 0>;
104
105 fixed-link {
106 speed = <2500>;
107 full-duplex;
108 pause;
109 };
110 };
111
112 gmac1: mac@1 {
113 compatible = "mediatek,eth-mac";
114 reg = <1>;
115 status = "disabled";
116 };
117 };
118
119 &mdio_bus {
120 switch: switch@1f {
121 compatible = "mediatek,mt7531";
122 reg = <31>;
123 reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
124 };
125 };
126
127 &spi0 {
128 pinctrl-names = "default";
129 pinctrl-0 = <&spi0_flash_pins>;
130 status = "disabled";
131 };
132
133 &spi2 {
134 pinctrl-names = "default";
135 pinctrl-0 = <&spi2_flash_pins>;
136 status = "okay";
137
138 flash@0 {
139 #address-cells = <1>;
140 #size-cells = <1>;
141
142 compatible = "jedec,spi-nor";
143 reg = <0>;
144
145 spi-max-frequency = <25000000>;
146 spi-tx-bus-width = <4>;
147 spi-rx-bus-width = <4>;
148
149 partitions {
150 compatible = "fixed-partitions";
151 #address-cells = <1>;
152 #size-cells = <1>;
153
154 partition@00000 {
155 label = "BL2";
156 reg = <0x00000 0x40000>;
157 read-only;
158 };
159
160 partition@40000 {
161 label = "u-boot-env";
162 reg = <0x40000 0x10000>;
163 read-only;
164 };
165
166 factory: partition@50000 {
167 label = "Factory";
168 reg = <0x50000 0x10000>;
169 read-only;
170 };
171
172 bdinfo: partition@60000 {
173 label = "bdinfo";
174 reg = <0x60000 0x10000>;
175 read-only;
176
177 nvmem-layout {
178 compatible = "fixed-layout";
179 #address-cells = <1>;
180 #size-cells = <1>;
181
182 macaddr_bdinfo_de00: macaddr@de00 {
183 compatible = "mac-base";
184 reg = <0xde00 0x6>;
185 #nvmem-cell-cells = <1>;
186 };
187 };
188 };
189
190 partition@70000 {
191 label = "FIP";
192 reg = <0x70000 0x80000>;
193 read-only;
194 };
195
196 partition@f0000 {
197 compatible = "denx,fit";
198 label = "firmware";
199 reg = <0xf0000 0xf10000>;
200 };
201 };
202 };
203 };
204
205 &pio {
206 spi0_flash_pins: spi0-pins {
207 mux {
208 function = "spi";
209 groups = "spi0", "spi0_wp_hold";
210 };
211 };
212
213 spi2_flash_pins: spi2-pins {
214 mux {
215 function = "spi";
216 groups = "spi2", "spi2_wp_hold";
217 };
218
219 conf-pu {
220 pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
221 drive-strength = <8>;
222 bias-pull-up = <103>;
223 };
224
225 conf-pd {
226 pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
227 drive-strength = <8>;
228 bias-pull-down = <103>;
229 };
230 };
231 };
232
233 &switch {
234 ports {
235 #address-cells = <1>;
236 #size-cells = <0>;
237
238 port@0 {
239 reg = <0>;
240 label = "wan";
241
242 nvmem-cell-names = "mac-address";
243 nvmem-cells = <&macaddr_bdinfo_de00 1>;
244 };
245
246 port@1 {
247 reg = <1>;
248 label = "lan1";
249 };
250
251 port@2 {
252 reg = <2>;
253 label = "lan2";
254 };
255
256 port@3 {
257 reg = <3>;
258 label = "lan3";
259 };
260
261 port@6 {
262 reg = <6>;
263 label = "cpu";
264 ethernet = <&gmac0>;
265 phy-mode = "2500base-x";
266
267 fixed-link {
268 speed = <2500>;
269 full-duplex;
270 pause;
271 };
272 };
273 };
274 };
275
276 &wifi {
277 status = "okay";
278 mediatek,mtd-eeprom = <&factory 0x0>;
279 };