ramips: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_dlink_dir-853-a1.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 = "dlink,dir-853-a1", "mediatek,mt7621-soc";
11 model = "D-Link DIR-853 A1";
12
13 aliases {
14 led-boot = &led_power_orange;
15 led-failsafe = &led_power_blue;
16 led-running = &led_power_blue;
17 led-upgrade = &led_net_orange;
18 };
19
20 keys {
21 compatible = "gpio-keys";
22
23 wifi {
24 label = "wifi";
25 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
26 linux,code = <KEY_RFKILL>;
27 };
28
29 reset {
30 label = "reset";
31 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
32 linux,code = <KEY_RESTART>;
33 };
34
35 wps {
36 label = "wps";
37 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
38 linux,code = <KEY_WPS_BUTTON>;
39 };
40 };
41
42 leds {
43 compatible = "gpio-leds";
44
45 wlan5g {
46 label = "blue:wlan5g";
47 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
48 linux,default-trigger = "phy1radio";
49 };
50
51 wlan2g {
52 label = "blue:wlan2g";
53 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
54 linux,default-trigger = "phy0radio";
55 };
56
57 usb_blue {
58 function = LED_FUNCTION_USB;
59 color = <LED_COLOR_ID_BLUE>;
60 gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
61 trigger-sources = <&xhci_ehci_port1>;
62 linux,default-trigger = "usbport";
63 };
64
65 led_power_orange: power_orange {
66 function = LED_FUNCTION_POWER;
67 color = <LED_COLOR_ID_ORANGE>;
68 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
69 };
70
71 led_power_blue: power_blue {
72 function = LED_FUNCTION_POWER;
73 color = <LED_COLOR_ID_BLUE>;
74 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
75 };
76
77 led_net_orange: net_orange {
78 label = "orange:net";
79 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
80 };
81
82 net_blue {
83 label = "blue:net";
84 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
85 };
86 };
87 };
88
89 &spi0 {
90 status = "okay";
91
92 flash@0 {
93 compatible = "jedec,spi-nor";
94 reg = <0>;
95 spi-max-frequency = <50000000>;
96
97 partitions {
98 compatible = "fixed-partitions";
99 #address-cells = <1>;
100 #size-cells = <1>;
101
102 partition@0 {
103 label = "u-boot";
104 reg = <0x0 0x30000>;
105 read-only;
106 };
107
108 partition@30000 {
109 label = "u-boot-env";
110 reg = <0x30000 0x10000>;
111 read-only;
112 };
113
114 factory: partition@40000 {
115 label = "factory";
116 reg = <0x40000 0x10000>;
117 read-only;
118
119 nvmem-layout {
120 compatible = "fixed-layout";
121 #address-cells = <1>;
122 #size-cells = <1>;
123
124 eeprom_factory_0: eeprom@0 {
125 reg = <0x0 0x4da8>;
126 };
127
128 macaddr_factory_e000: macaddr@e000 {
129 reg = <0xe000 0x6>;
130 };
131
132 macaddr_factory_e006: macaddr@e006 {
133 reg = <0xe006 0x6>;
134 };
135 };
136 };
137
138 partition@50000 {
139 label = "config2_stock";
140 reg = <0x50000 0x10000>;
141 read-only;
142 };
143
144 partition@60000 {
145 compatible = "openwrt,uimage", "denx,uimage";
146 openwrt,padding = <96>;
147 label = "firmware";
148 reg = <0x60000 0xf50000>;
149 };
150
151 partition@fb0000 {
152 label = "private_stock";
153 reg = <0xfb0000 0x50000>;
154 read-only;
155 };
156 };
157 };
158 };
159
160
161 &pcie {
162 status = "okay";
163 };
164
165 &pcie0 {
166 wifi@0,0 {
167 compatible = "mediatek,mt76";
168 reg = <0x0000 0 0 0 0>;
169 nvmem-cells = <&eeprom_factory_0>;
170 nvmem-cell-names = "eeprom";
171
172 /* The correct Mac addresses are set in 10_fix_wifi_mac. */
173 };
174 };
175
176 &gmac0 {
177 nvmem-cells = <&macaddr_factory_e000>;
178 nvmem-cell-names = "mac-address";
179 };
180
181 &gmac1 {
182 status = "okay";
183 label = "wan";
184 phy-handle = <&ethphy4>;
185
186 nvmem-cells = <&macaddr_factory_e006>;
187 nvmem-cell-names = "mac-address";
188 };
189
190 &mdio {
191 ethphy4: ethernet-phy@4 {
192 reg = <4>;
193 };
194 };
195
196 &switch0 {
197 ports {
198 port@0 {
199 status = "okay";
200 label = "lan4";
201 };
202
203 port@1 {
204 status = "okay";
205 label = "lan3";
206 };
207
208 port@2 {
209 status = "okay";
210 label = "lan2";
211 };
212
213 port@3 {
214 status = "okay";
215 label = "lan1";
216 };
217 };
218 };
219
220 &state_default {
221 gpio {
222 groups = "i2c", "uart2", "uart3", "jtag", "wdt";
223 function = "gpio";
224 };
225 };