ramips: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_cudy_wr1300-v2v3.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/input/input.h>
6 #include <dt-bindings/leds/common.h>
7 #include <dt-bindings/gpio/gpio.h>
8
9 / {
10 aliases {
11 led-boot = &led_sys;
12 led-failsafe = &led_sys;
13 led-running = &led_sys;
14 led-upgrade = &led_sys;
15 label-mac-device = &gmac0;
16 };
17
18 chosen {
19 bootargs = "console=ttyS0,115200";
20 };
21
22 keys {
23 compatible = "gpio-keys";
24
25 reset {
26 label = "reset";
27 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
28 linux,code = <KEY_RESTART>;
29 };
30
31 wps {
32 label = "wps";
33 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
34 linux,code = <KEY_WPS_BUTTON>;
35 };
36 };
37
38 leds {
39 compatible = "gpio-leds";
40
41 led_sys: sys {
42 label = "green:sys";
43 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
44 };
45
46 wps {
47 function = LED_FUNCTION_WPS;
48 color = <LED_COLOR_ID_GREEN>;
49 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
50 };
51 };
52 };
53
54 &spi0 {
55 status = "okay";
56
57 flash@0 {
58 compatible = "jedec,spi-nor";
59 reg = <0>;
60 spi-max-frequency = <40000000>;
61
62 partitions {
63 compatible = "fixed-partitions";
64 #address-cells = <1>;
65 #size-cells = <1>;
66
67 partition@0 {
68 label = "u-boot";
69 reg = <0x0 0x30000>;
70 read-only;
71 };
72
73 partition@30000 {
74 label = "u-boot-env";
75 reg = <0x30000 0x10000>;
76 read-only;
77 };
78
79 partition@40000 {
80 label = "factory";
81 reg = <0x40000 0x10000>;
82 read-only;
83
84 nvmem-layout {
85 compatible = "fixed-layout";
86 #address-cells = <1>;
87 #size-cells = <1>;
88
89 eeprom_factory_0: eeprom@0 {
90 reg = <0x0 0x400>;
91 };
92
93 eeprom_factory_8000: eeprom@8000 {
94 reg = <0x8000 0x4da8>;
95 };
96 };
97 };
98
99 partition@50000 {
100 compatible = "denx,uimage";
101 label = "firmware";
102 reg = <0x50000 0xf80000>;
103 };
104
105 partition@fd0000 {
106 label = "debug";
107 reg = <0xfd0000 0x10000>;
108 read-only;
109 };
110
111 partition@fe0000 {
112 label = "backup";
113 reg = <0xfe0000 0x10000>;
114 read-only;
115 };
116
117 partition@ff0000 {
118 label = "bdinfo";
119 reg = <0xff0000 0x10000>;
120 read-only;
121
122 nvmem-layout {
123 compatible = "fixed-layout";
124 #address-cells = <1>;
125 #size-cells = <1>;
126
127 macaddr_bdinfo_de00: macaddr@de00 {
128 compatible = "mac-base";
129 reg = <0xde00 0x6>;
130 #nvmem-cell-cells = <1>;
131 };
132 };
133 };
134 };
135 };
136 };
137
138 &pcie {
139 status = "okay";
140 };
141
142 &gmac0 {
143 nvmem-cells = <&macaddr_bdinfo_de00 0>;
144 nvmem-cell-names = "mac-address";
145 };
146
147 &gmac1 {
148 status = "okay";
149 label = "wan";
150 phy-handle = <&ethphy4>;
151
152 nvmem-cells = <&macaddr_bdinfo_de00 1>;
153 nvmem-cell-names = "mac-address";
154 };
155
156 &mdio {
157 ethphy4: ethernet-phy@4 {
158 reg = <4>;
159 };
160 };
161
162 &switch0 {
163 ports {
164 port@0 {
165 status = "okay";
166 label = "lan4";
167 };
168
169 port@1 {
170 status = "okay";
171 label = "lan3";
172 };
173
174 port@2 {
175 status = "okay";
176 label = "lan2";
177 };
178
179 port@3 {
180 status = "okay";
181 label = "lan1";
182 };
183 };
184 };
185
186 &state_default {
187 gpio {
188 groups = "wdt", "i2c", "jtag";
189 function = "gpio";
190 };
191 };