ath79: convert to new LED color/function format where possible
[openwrt/staging/robimarko.git] / target / linux / ath79 / dts / ar7161_buffalo_wzr-hp-ag300h.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "ar7100.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 aliases {
11 led-boot = &led_diag;
12 led-failsafe = &led_diag;
13 led-upgrade = &led_diag;
14 };
15
16 leds {
17 compatible = "gpio-leds";
18
19 led_diag: diag {
20 label = "red:diag";
21 gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
22 };
23 };
24
25 ath9k-leds {
26 compatible = "gpio-leds";
27
28 band2g_a {
29 label = "amber:band2g";
30 gpios = <&ath9k0 1 GPIO_ACTIVE_LOW>;
31 };
32
33 usb {
34 function = LED_FUNCTION_USB;
35 color = <LED_COLOR_ID_GREEN>;
36 gpios = <&ath9k0 3 GPIO_ACTIVE_LOW>;
37 trigger-sources = <&usb_ohci_port>, <&usb_ehci_port>;
38 linux,default-trigger = "usbport";
39 };
40
41 band2g_g {
42 label = "green:band2g";
43 gpios = <&ath9k0 5 GPIO_ACTIVE_LOW>;
44 linux,default-trigger = "phy0tpt";
45 };
46
47 band5g_g {
48 label = "green:band5g";
49 gpios = <&ath9k1 1 GPIO_ACTIVE_LOW>;
50 linux,default-trigger = "phy1tpt";
51 };
52
53 router {
54 label = "green:router";
55 gpios = <&ath9k1 3 GPIO_ACTIVE_LOW>;
56 };
57
58 movie_engine {
59 label = "blue:movie_engine";
60 gpios = <&ath9k1 4 GPIO_ACTIVE_LOW>;
61 };
62
63 band5g_a {
64 label = "amber:band5g";
65 gpios = <&ath9k1 5 GPIO_ACTIVE_LOW>;
66 };
67 };
68
69 keys {
70 compatible = "gpio-keys";
71
72 reset {
73 label = "reset";
74 linux,code = <KEY_RESTART>;
75 gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
76 debounce-interval = <60>;
77 };
78
79 usb {
80 label = "usb";
81 linux,code = <BTN_2>;
82 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
83 debounce-interval = <60>;
84 };
85
86 aoss {
87 label = "aoss";
88 linux,code = <KEY_WPS_BUTTON>;
89 gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
90 debounce-interval = <60>;
91 };
92
93 router_auto {
94 label = "router_auto";
95 linux,code = <BTN_6>;
96 linux,input-type = <EV_SW>;
97 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
98 debounce-interval = <60>;
99 };
100
101 router_off {
102 label = "router_off";
103 linux,code = <BTN_5>;
104 linux,input-type = <EV_SW>;
105 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
106 debounce-interval = <60>;
107 };
108
109 movie_engine {
110 label = "movie_engine";
111 linux,code = <BTN_7>;
112 linux,input-type = <EV_SW>;
113 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
114 debounce-interval = <60>;
115 };
116 };
117
118 gpio-export {
119 compatible = "gpio-export";
120
121 gpio_usb_power {
122 gpio-export,name = "buffalo:power:usb";
123 gpio-export,output = <1>;
124 gpios = <&gpio 2 GPIO_ACTIVE_HIGH>;
125 };
126 };
127
128 flash {
129 compatible = "mtd-concat";
130
131 devices = <&flash0 &flash1>;
132
133 partitions {
134 compatible = "fixed-partitions";
135 #address-cells = <1>;
136 #size-cells = <1>;
137 partition@0 {
138 label = "u-boot";
139 reg = <0x0000000 0x0040000>;
140 read-only;
141 };
142
143 partition@40000 {
144 label = "u-boot-env";
145 reg = <0x0040000 0x0010000>;
146 read-only;
147 };
148
149 art: partition@50000 {
150 label = "art";
151 reg = <0x0050000 0x0010000>;
152 read-only;
153
154 nvmem-layout {
155 compatible = "fixed-layout";
156 #address-cells = <1>;
157 #size-cells = <1>;
158
159 macaddr_art_120c: macaddr@120c {
160 reg = <0x120c 0x6>;
161 };
162
163 macaddr_art_520c: macaddr@520c {
164 compatible = "mac-base";
165 reg = <0x520c 0x6>;
166 #nvmem-cell-cells = <1>;
167 };
168 };
169 };
170
171 partition@60000 {
172 compatible = "denx,uimage";
173 label = "firmware";
174 reg = <0x0060000 0x1f90000>;
175 };
176
177 partition@1ff0000 {
178 label = "user_property";
179 reg = <0x1ff0000 0x0010000>;
180 read-only;
181 };
182 };
183 };
184 };
185
186 &usb_phy {
187 status = "okay";
188 };
189
190 &usb1 {
191 status = "okay";
192 };
193
194 &usb2 {
195 status = "okay";
196 };
197
198 &pcie0 {
199 status = "okay";
200
201 ath9k0: wifi@11,0 {
202 compatible = "pci168c,0029";
203 reg = <0x8800 0 0 0 0>;
204 qca,no-eeprom;
205 #gpio-cells = <2>;
206 gpio-controller;
207 };
208
209 ath9k1: wifi@12,0 {
210 compatible = "pci168c,0029";
211 reg = <0x9000 0 0 0 0>;
212 qca,no-eeprom;
213 #gpio-cells = <2>;
214 gpio-controller;
215 };
216 };
217
218 &spi {
219 status = "okay";
220
221
222 flash0: flash@0 {
223 compatible = "jedec,spi-nor";
224 reg = <0>;
225 spi-max-frequency = <50000000>;
226 m25p,fast-read;
227 };
228
229 flash1: flash@1 {
230 compatible = "jedec,spi-nor";
231 reg = <1>;
232 spi-max-frequency = <50000000>;
233 m25p,fast-read;
234 };
235 };
236
237 &mdio0 {
238 status = "okay";
239
240 phy4: ethernet-phy@4 {
241 reg = <4>;
242 phy-mode = "rgmii";
243 };
244 };
245
246 &eth0 {
247 status = "okay";
248
249 nvmem-cells = <&macaddr_art_120c>;
250 nvmem-cell-names = "mac-address";
251
252 fixed-link {
253 speed = <1000>;
254 full-duplex;
255 };
256 };
257
258 &eth1 {
259 status = "okay";
260
261 nvmem-cells = <&macaddr_art_520c 1>;
262 nvmem-cell-names = "mac-address";
263
264 phy-handle = <&phy4>;
265 };