ath79: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / ath79 / dts / qcn5502_tplink_archer-a9-v6.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "qca956x.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 model = "TP-Link Archer A9 v6";
11 compatible = "tplink,archer-a9-v6", "qca,qcn5500", "qca,qca9560";
12
13 aliases {
14 label-mac-device = &eth0;
15 led-boot = &led_power;
16 led-failsafe = &led_power;
17 led-running = &led_power;
18 led-upgrade = &led_power;
19 };
20
21 keys {
22 compatible = "gpio-keys";
23
24 reset {
25 label = "reset";
26 linux,code = <KEY_RESTART>;
27 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
28 debounce-interval = <60>;
29 };
30
31 wps {
32 label = "wps";
33 linux,code = <KEY_WPS_BUTTON>;
34 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
35 debounce-interval = <60>;
36 };
37 };
38
39 leds {
40 compatible = "gpio-leds";
41
42 led_power: power {
43 function = LED_FUNCTION_POWER;
44 color = <LED_COLOR_ID_GREEN>;
45 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
46 default-state = "on";
47 };
48
49 usb {
50 function = LED_FUNCTION_USB;
51 color = <LED_COLOR_ID_GREEN>;
52 gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
53 trigger-sources = <&hub_port0>;
54 linux,default-trigger = "usbport";
55 };
56
57 wan {
58 function = LED_FUNCTION_WAN;
59 color = <LED_COLOR_ID_GREEN>;
60 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
61 };
62
63 wan_orange {
64 function = LED_FUNCTION_WAN;
65 color = <LED_COLOR_ID_ORANGE>;
66 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
67 };
68
69 wlan2g {
70 label = "green:wlan2g";
71 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
72 linux,default-trigger = "phy1tpt";
73 };
74
75 wlan5g {
76 label = "green:wlan5g";
77 gpios = <&gpio 20 GPIO_ACTIVE_HIGH>;
78 linux,default-trigger = "phy0tpt";
79 };
80
81 wps {
82 function = LED_FUNCTION_WPS;
83 color = <LED_COLOR_ID_GREEN>;
84 gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
85 };
86 };
87 };
88
89 &eth0 {
90 status = "okay";
91
92 pll-data = <0x03000101 0x00000101 0x00001919>;
93
94 phy-mode = "sgmii";
95 phy-handle = <&phy0>;
96
97 nvmem-cells = <&macaddr_info_8 0>;
98 nvmem-cell-names = "mac-address";
99 };
100
101 &mdio0 {
102 status = "okay";
103
104 phy0: ethernet-phy@0 {
105 reg = <0>;
106 phy-mode = "sgmii";
107 qca,mib-poll-interval = <500>;
108
109 qca,ar8327-initvals = <
110 0x04 0x80080080 /* PORT0 PAD MODE CTRL */
111 0x08 0x00000000 /* PORT5 PAD MODE CTRL */
112 0x0c 0x00000000 /* PORT6 PAD MODE CTRL */
113 0x10 0x00000080 /* POWER_ON_STRAP */
114 0x7c 0x0000007e /* PORT0_STATUS */
115 0x94 0x00000200 /* PORT6_STATUS */
116 >;
117 };
118 };
119
120 &pcie {
121 status = "okay";
122
123 wifi@0,0 {
124 compatible = "pci168c,0046";
125 reg = <0 0 0 0 0>;
126
127 nvmem-cells = <&macaddr_info_8 (-1)>, <&precal_art_5000>;
128 nvmem-cell-names = "mac-address", "pre-calibration";
129 };
130 };
131
132 &spi {
133 status = "okay";
134
135 flash@0 {
136 compatible = "jedec,spi-nor";
137 reg = <0>;
138 spi-max-frequency = <25000000>;
139 m25p,fast-read;
140
141 mtdparts: partitions {
142 compatible = "fixed-partitions";
143 #address-cells = <1>;
144 #size-cells = <1>;
145
146 partition@0 {
147 label = "factory-uboot";
148 reg = <0x000000 0x020000>;
149 read-only;
150 };
151
152 partition@20000 {
153 label = "u-boot";
154 reg = <0x020000 0x020000>;
155 read-only;
156 };
157
158 partition@40000 {
159 label = "partition-table";
160 reg = <0x040000 0x010000>;
161 read-only;
162 };
163
164 partition@50000 {
165 label = "art";
166 reg = <0x050000 0x010000>;
167 read-only;
168
169 nvmem-layout {
170 compatible = "fixed-layout";
171 #address-cells = <1>;
172 #size-cells = <1>;
173
174 cal_art_1000: cal@1000 {
175 reg = <0x1000 0x440>;
176 };
177
178 precal_art_5000: precal@5000 {
179 reg = <0x5000 0x2f20>;
180 };
181 };
182 };
183
184 partition@60000 {
185 label = "info";
186 reg = <0x060000 0x020000>;
187 read-only;
188
189 nvmem-layout {
190 compatible = "fixed-layout";
191 #address-cells = <1>;
192 #size-cells = <1>;
193
194 macaddr_info_8: macaddr@8 {
195 compatible = "mac-base";
196 reg = <0x8 0x6>;
197 #nvmem-cell-cells = <1>;
198 };
199 };
200 };
201
202 partition@80000 {
203 label = "user-config";
204 reg = <0x080000 0x040000>;
205 read-only;
206 };
207
208 partition@c0000 {
209 compatible = "denx,uimage";
210 label = "firmware";
211 reg = <0x0c0000 0xf00000>;
212 };
213
214 partition@fc0000 {
215 label = "log";
216 reg = <0xfc0000 0x020000>;
217 read-only;
218 };
219
220 partition@fe0000 {
221 label = "certificate";
222 reg = <0xfe0000 0x010000>;
223 read-only;
224 };
225
226 partition@ff0000 {
227 label = "default-config";
228 reg = <0xff0000 0x010000>;
229 read-only;
230 };
231 };
232 };
233 };
234
235 &usb_phy0 {
236 status = "okay";
237 };
238
239 &usb0 {
240 status = "okay";
241 };
242
243 &wmac {
244 /* TODO: missing support in ath9k */
245 status = "disabled";
246
247 nvmem-cells = <&cal_art_1000>, <&macaddr_info_8 0>;
248 nvmem-cell-names = "calibration", "mac-address";
249 };