ramips: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7620a_engenius_epg600.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7620a.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7 #include <dt-bindings/leds/common.h>
8
9 / {
10 compatible = "engenius,epg600", "ralink,mt7620a-soc";
11 model = "EnGenius EPG600";
12
13 aliases {
14 led-boot = &led_power;
15 led-failsafe = &led_power;
16 led-running = &led_power;
17 led-upgrade = &led_power;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200";
22 };
23
24 keys {
25 compatible = "gpio-keys";
26
27 reset {
28 linux,code = <KEY_RESTART>;
29 gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
30 debounce-interval = <60>;
31 };
32
33 wps {
34 linux,code = <KEY_WPS_BUTTON>;
35 gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
36 debounce-interval = <60>;
37 };
38
39 reg {
40 linux,code = <BTN_0>;
41 gpios = <&gpio2 7 GPIO_ACTIVE_LOW>;
42 debounce-interval = <60>;
43 };
44 };
45
46 leds {
47 compatible = "gpio-leds";
48
49 led_power: power {
50 function = LED_FUNCTION_POWER;
51 color = <LED_COLOR_ID_AMBER>;
52 gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
53 default-state = "on";
54 };
55
56 wlan2g {
57 label = "blue:wlan2g";
58 gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
59 linux,default-trigger = "phy1tpt";
60 };
61
62 wlan5g {
63 label = "blue:wlan5g";
64 gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
65 };
66
67 wps2g {
68 label = "blue:wps2g";
69 gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
70 };
71
72 wps5g {
73 label = "amber:wps5g";
74 gpios = <&gpio2 6 GPIO_ACTIVE_LOW>;
75 };
76
77 line {
78 label = "blue:line";
79 gpios = <&gpio2 14 GPIO_ACTIVE_LOW>;
80 };
81 };
82 };
83
84 &gpio1 {
85 status = "okay";
86 };
87
88 &gpio2 {
89 status = "okay";
90 };
91
92 &gpio3 {
93 status = "okay";
94 };
95
96 &spi0 {
97 status = "okay";
98
99 flash@0 {
100 compatible = "jedec,spi-nor";
101 reg = <0>;
102 spi-max-frequency = <30000000>;
103
104 partitions {
105 compatible = "fixed-partitions";
106 #address-cells = <1>;
107 #size-cells = <1>;
108
109 partition@0 {
110 label = "u-boot";
111 reg = <0x0 0x30000>;
112 read-only;
113 };
114
115 partition@30000 {
116 label = "u-boot-env";
117 reg = <0x30000 0x10000>;
118 };
119
120 factory: partition@40000 {
121 label = "factory";
122 reg = <0x40000 0x10000>;
123 read-only;
124
125 nvmem-layout {
126 compatible = "fixed-layout";
127 #address-cells = <1>;
128 #size-cells = <1>;
129
130 eeprom_factory_0: eeprom@0 {
131 reg = <0x0 0x200>;
132 };
133 };
134 };
135
136 rf: partition@50000 {
137 label = "rf";
138 reg = <0x50000 0x10000>;
139 read-only;
140
141 nvmem-layout {
142 compatible = "fixed-layout";
143 #address-cells = <1>;
144 #size-cells = <1>;
145
146 eeprom_rf_0: eeprom@0 {
147 reg = <0x0 0x200>;
148 };
149
150 macaddr_rf_4: macaddr@4 {
151 reg = <0x4 0x6>;
152 };
153 };
154 };
155
156 partition@60000 {
157 label = "firmware";
158 reg = <0x60000 0xf40000>;
159 compatible = "denx,uimage";
160 };
161
162 partition@fa0000 {
163 label = "backup";
164 reg = <0xfa0000 0x10000>;
165 read-only;
166 };
167
168 partition@fb0000 {
169 label = "storage";
170 reg = <0xfb0000 0x50000>;
171 read-only;
172 };
173 };
174 };
175 };
176
177 &ethernet {
178 pinctrl-names = "default";
179 pinctrl-0 = <&mdio_pins &rgmii1_pins &rgmii2_pins>;
180
181 nvmem-cells = <&macaddr_rf_4>;
182 nvmem-cell-names = "mac-address";
183
184 port@5 {
185 status = "okay";
186
187 phy-mode = "rgmii-txid";
188
189 mediatek,fixed-link = <1000 1 1 1>;
190 };
191
192 mdio-bus {
193 status = "okay";
194
195 ethernet-phy@0 {
196 reg = <0>;
197 phy-mode = "rgmii";
198
199 qca,ar8327-initvals = <
200 0x04 0x07600000 /* PORT0 PAD MODE CTRL */
201 0x08 0x01000000 /* PORT5 PAD MODE CTRL */
202 0x0c 0x07600000 /* PORT6 PAD MODE CTRL */
203 0x10 0x40000000 /* POWER-ON STRAPPING */
204 0x7c 0x0000007e /* PORT0_STATUS */
205 0x94 0x0000007e /* PORT6_STATUS */
206 >;
207 };
208 };
209 };
210
211 &gsw {
212 mediatek,ephy-disable;
213 };
214
215 &pcie {
216 status = "okay";
217 };
218
219 &pcie0 {
220 wifi@0,0 {
221 compatible = "pci1814,3091";
222 reg = <0x0000 0 0 0 0>;
223 nvmem-cells = <&eeprom_factory_0>;
224 nvmem-cell-names = "eeprom";
225 };
226 };
227
228 &wmac {
229 nvmem-cells = <&eeprom_rf_0>;
230 nvmem-cell-names = "eeprom";
231 };
232
233 &ehci {
234 status = "okay";
235 };
236
237 &ohci {
238 status = "okay";
239 };
240
241 &state_default {
242 default {
243 groups = "ephy", "wled", "spi refclk", "i2c", "uartf", "nd_sd";
244 function = "gpio";
245 };
246 };