ramips: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_youku_yk-l2.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7621.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 = "youku,yk-l2", "mediatek,mt7621-soc";
11 model = "Youku YK-L2";
12
13 aliases {
14 led-boot = &led_power;
15 led-failsafe = &led_power;
16 led-running = &led_power;
17 led-upgrade = &led_wps;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200";
22 };
23
24 leds {
25 compatible = "gpio-leds";
26
27 led_power: power {
28 function = LED_FUNCTION_POWER;
29 color = <LED_COLOR_ID_BLUE>;
30 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
31 default-state = "on";
32 };
33
34 led_wps: wps {
35 function = LED_FUNCTION_WPS;
36 color = <LED_COLOR_ID_BLUE>;
37 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
38 };
39
40 usb {
41 function = LED_FUNCTION_USB;
42 color = <LED_COLOR_ID_BLUE>;
43 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
44 trigger-sources = <&xhci_ehci_port1>, <&ehci_port2>;
45 linux,default-trigger = "usbport";
46 };
47 };
48
49 keys {
50 compatible = "gpio-keys";
51
52 reset {
53 label = "reset";
54 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
55 linux,code = <KEY_RESTART>;
56 };
57
58 wps {
59 label = "wps";
60 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
61 linux,code = <KEY_WPS_BUTTON>;
62 };
63 };
64 };
65
66 &sdhci {
67 status = "okay";
68 };
69
70 &spi0 {
71 status = "okay";
72
73 flash@0 {
74 compatible = "jedec,spi-nor";
75 reg = <0>;
76 spi-max-frequency = <10000000>;
77
78 partitions {
79 compatible = "fixed-partitions";
80 #address-cells = <1>;
81 #size-cells = <1>;
82
83 partition@0 {
84 label = "u-boot";
85 reg = <0x0 0x30000>;
86 read-only;
87 };
88
89 partition@30000 {
90 label = "u-boot-env";
91 reg = <0x30000 0x10000>;
92 read-only;
93 };
94
95 factory: partition@40000 {
96 label = "factory";
97 reg = <0x40000 0x10000>;
98 read-only;
99
100 nvmem-layout {
101 compatible = "fixed-layout";
102 #address-cells = <1>;
103 #size-cells = <1>;
104
105 eeprom_factory_0: eeprom@0 {
106 reg = <0x0 0x400>;
107 };
108
109 eeprom_factory_8000: eeprom@8000 {
110 reg = <0x8000 0x200>;
111 };
112
113 macaddr_factory_e000: macaddr@e000 {
114 reg = <0xe000 0x6>;
115 };
116
117 macaddr_factory_e006: macaddr@e006 {
118 reg = <0xe006 0x6>;
119 };
120 };
121 };
122
123 partition@50000 {
124 compatible = "openwrt,uimage", "denx,uimage";
125 label = "firmware";
126 openwrt,ih-magic = <0x12291000>;
127 reg = <0x50000 0xfb0000>;
128 };
129 };
130 };
131 };
132
133 &pcie {
134 status = "okay";
135 };
136
137 &pcie0 {
138 wifi@0,0 {
139 compatible = "pci14c3,7603";
140 reg = <0x0000 0 0 0 0>;
141 nvmem-cells = <&eeprom_factory_0>;
142 nvmem-cell-names = "eeprom";
143 ieee80211-freq-limit = <2400000 2500000>;
144 led {
145 led-active-low;
146 };
147 };
148 };
149
150 &pcie1 {
151 wifi@0,0 {
152 compatible = "pci14c3,7662";
153 reg = <0x0000 0 0 0 0>;
154 nvmem-cells = <&eeprom_factory_8000>;
155 nvmem-cell-names = "eeprom";
156 ieee80211-freq-limit = <5000000 6000000>;
157 led {
158 led-sources = <2>;
159 led-active-low;
160 };
161 };
162 };
163
164 &gmac0 {
165 nvmem-cells = <&macaddr_factory_e000>;
166 nvmem-cell-names = "mac-address";
167 };
168
169 &gmac1 {
170 status = "okay";
171 label = "wan";
172 phy-handle = <&ethphy4>;
173
174 nvmem-cells = <&macaddr_factory_e006>;
175 nvmem-cell-names = "mac-address";
176 };
177
178 &mdio {
179 ethphy4: ethernet-phy@4 {
180 reg = <4>;
181 };
182 };
183
184 &switch0 {
185 ports {
186 port@0 {
187 status = "okay";
188 label = "lan1";
189 };
190
191 port@1 {
192 status = "okay";
193 label = "lan2";
194 };
195
196 port@2 {
197 status = "okay";
198 label = "lan3";
199 };
200
201 port@3 {
202 status = "okay";
203 label = "lan4";
204 };
205 };
206 };
207
208 &state_default {
209 gpio {
210 groups = "jtag", "wdt";
211 function = "gpio";
212 };
213 };