ath79: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / ath79 / dts / qca9531_tplink_tl-mr3420-v3.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "qca953x.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 = "tplink,tl-mr3420-v3", "qca,qca9531";
11 model = "TP-Link TL-MR3420 v3";
12
13 aliases {
14 led-boot = &led_system;
15 led-failsafe = &led_system;
16 led-running = &led_system;
17 led-upgrade = &led_system;
18 label-mac-device = &wmac;
19
20 };
21
22 led_spi {
23 compatible = "spi-gpio";
24 #address-cells = <1>;
25 #size-cells = <0>;
26
27 sck-gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
28 mosi-gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
29 cs-gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
30 num-chipselects = <1>;
31
32 led_gpio: led_gpio@0 {
33 compatible = "fairchild,74hc595";
34 reg = <0>;
35 gpio-controller;
36 #gpio-cells = <2>;
37 registers-number = <1>;
38 spi-max-frequency = <10000000>;
39 };
40 };
41
42 gpio-export {
43 compatible = "gpio-export";
44
45 gpio_shift_register_oe {
46 gpio-export,name = "tp-link:oe:sr";
47 gpio-export,output = <0>;
48 gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
49 };
50
51 gpio_shift_register_reset {
52 gpio-export,name = "tp-link:reset:sr";
53 gpio-export,output = <1>;
54 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
55 };
56 };
57
58 leds {
59 compatible = "gpio-leds";
60
61 led_system: system {
62 label = "green:system";
63 gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
64 default-state = "on";
65 };
66
67 lan4 {
68 label = "green:lan4";
69 gpios = <&led_gpio 0 GPIO_ACTIVE_LOW>;
70 };
71
72 lan3 {
73 label = "green:lan3";
74 gpios = <&led_gpio 1 GPIO_ACTIVE_LOW>;
75 };
76
77 lan2 {
78 label = "green:lan2";
79 gpios = <&led_gpio 2 GPIO_ACTIVE_LOW>;
80 };
81
82 lan1 {
83 label = "green:lan1";
84 gpios = <&led_gpio 3 GPIO_ACTIVE_LOW>;
85 };
86
87 wan {
88 function = LED_FUNCTION_WAN;
89 color = <LED_COLOR_ID_GREEN>;
90 gpios = <&led_gpio 4 GPIO_ACTIVE_LOW>;
91 };
92
93 wan_fail {
94 function = LED_FUNCTION_WAN;
95 color = <LED_COLOR_ID_ORANGE>;
96 gpios = <&led_gpio 5 GPIO_ACTIVE_LOW>;
97 };
98
99 wlan {
100 function = LED_FUNCTION_WLAN;
101 color = <LED_COLOR_ID_GREEN>;
102 gpios = <&led_gpio 6 GPIO_ACTIVE_LOW>;
103 linux,default-trigger = "phy0tpt";
104 };
105
106 usb {
107 function = LED_FUNCTION_USB;
108 color = <LED_COLOR_ID_GREEN>;
109 gpios = <&led_gpio 7 GPIO_ACTIVE_LOW>;
110 trigger-sources = <&hub_port0>;
111 linux,default-trigger = "usbport";
112 };
113
114 qss {
115 label = "green:qss";
116 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
117 };
118 };
119
120 keys {
121 compatible = "gpio-keys";
122
123 reset {
124 label = "Reset button";
125 linux,code = <KEY_RESTART>;
126 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
127 debounce-interval = <60>;
128 };
129
130 rfkill {
131 label = "RF kill button";
132 linux,code = <KEY_RFKILL>;
133 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
134 debounce-interval = <60>;
135 };
136 };
137
138 };
139
140 &spi {
141 status = "okay";
142
143 flash@0 {
144 compatible = "jedec,spi-nor";
145 reg = <0>;
146 spi-max-frequency = <25000000>;
147
148 partitions {
149 compatible = "fixed-partitions";
150 #address-cells = <1>;
151 #size-cells = <1>;
152
153 uboot: partition@0 {
154 label = "u-boot";
155 reg = <0x000000 0x020000>;
156 read-only;
157
158 nvmem-layout {
159 compatible = "fixed-layout";
160 #address-cells = <1>;
161 #size-cells = <1>;
162
163 macaddr_uboot_1fc00: macaddr@1fc00 {
164 compatible = "mac-base";
165 reg = <0x1fc00 0x6>;
166 #nvmem-cell-cells = <1>;
167 };
168 };
169 };
170
171 partition@20000 {
172 compatible = "tplink,firmware";
173 label = "firmware";
174 reg = <0x020000 0x3d0000>;
175 };
176
177 art: partition@3f0000 {
178 label = "art";
179 reg = <0x3f0000 0x010000>;
180 read-only;
181 };
182 };
183 };
184 };
185
186 &eth0 {
187 status = "okay";
188
189 phy-handle = <&swphy4>;
190
191 nvmem-cells = <&macaddr_uboot_1fc00 1>;
192 nvmem-cell-names = "mac-address";
193 };
194
195 &eth1 {
196 nvmem-cells = <&macaddr_uboot_1fc00 0>;
197 nvmem-cell-names = "mac-address";
198 };
199
200 &wmac {
201 status = "okay";
202
203 mtd-cal-data = <&art 0x1000>;
204 nvmem-cells = <&macaddr_uboot_1fc00 0>;
205 nvmem-cell-names = "mac-address";
206 };
207
208 &usb0 {
209 status = "okay";
210 };
211
212 &usb_phy {
213 status = "okay";
214 };