ath79: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / ath79 / dts / qca9563_tplink_tl-wa1201-v2.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 compatible = "tplink,tl-wa1201-v2", "qca,qca9563";
11 model = "TP-Link TL-WA1201 v2";
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 mdio-gpio0 = &mdio2;
20 };
21
22 leds {
23 compatible = "gpio-leds";
24
25 led_power: power {
26 function = LED_FUNCTION_POWER;
27 color = <LED_COLOR_ID_GREEN>;
28 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
29 default-state = "on";
30 };
31
32 wlan2g {
33 label = "green:wlan2g";
34 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
35 linux,default-trigger = "phy1tpt";
36 };
37
38 wlan5g {
39 label = "green:wlan5g";
40 gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
41 linux,default-trigger = "phy0tpt";
42 };
43
44 lan {
45 function = LED_FUNCTION_LAN;
46 color = <LED_COLOR_ID_GREEN>;
47 gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
48 };
49 };
50
51 keys {
52 compatible = "gpio-keys";
53
54 reset {
55 label = "Reset button";
56 linux,code = <KEY_RESTART>;
57 gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
58 debounce-interval = <60>;
59 };
60
61 wps {
62 label = "WPS button";
63 linux,code = <KEY_WPS_BUTTON>;
64 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
65 debounce-interval = <60>;
66 };
67 };
68
69 mdio2: mdio {
70 compatible = "virtual,mdio-gpio";
71
72 #address-cells = <1>;
73 #size-cells = <0>;
74
75 gpios = <&gpio 3 GPIO_ACTIVE_HIGH>, /* MDC */
76 <&gpio 4 GPIO_ACTIVE_HIGH>; /* MDIO */
77
78 phy4: ethernet-phy@4 {
79 reg = <4>;
80
81 eee-broken-100tx;
82 eee-broken-1000t;
83 };
84 };
85 };
86
87 &pcie {
88 status = "okay";
89
90 wifi@0,0 {
91 compatible = "qcom,ath10k";
92 reg = <0x0000 0 0 0 0>;
93 nvmem-cells = <&precal_art_5000>, <&macaddr_info_8 (-1)>;
94 nvmem-cell-names = "pre-calibration", "mac-address";
95 };
96 };
97
98 &eth0 {
99 status = "okay";
100
101 phy-mode = "sgmii";
102 phy-handle = <&phy4>;
103
104 nvmem-cells = <&macaddr_info_8 0>;
105 nvmem-cell-names = "mac-address";
106 };
107
108 &wmac {
109 status = "okay";
110
111 mtd-cal-data = <&art 0x1000>;
112
113 nvmem-cells = <&macaddr_info_8 0>;
114 nvmem-cell-names = "mac-address";
115 };
116
117 &spi {
118 status = "okay";
119
120 flash@0 {
121 compatible = "jedec,spi-nor";
122 reg = <0>;
123 spi-max-frequency = <25000000>;
124
125 partitions {
126 compatible = "fixed-partitions";
127 #address-cells = <1>;
128 #size-cells = <1>;
129
130 partition@0 {
131 label = "u-boot";
132 reg = <0x000000 0x020000>;
133 read-only;
134 };
135
136 info: partition@20000 {
137 label = "info";
138 reg = <0x020000 0x010000>;
139 read-only;
140
141 nvmem-layout {
142 compatible = "fixed-layout";
143 #address-cells = <1>;
144 #size-cells = <1>;
145
146 macaddr_info_8: macaddr@8 {
147 compatible = "mac-base";
148 reg = <0x8 0x6>;
149 #nvmem-cell-cells = <1>;
150 };
151 };
152 };
153
154 partition@30000 {
155 compatible = "denx,uimage";
156 label = "firmware";
157 reg = <0x030000 0xce0000>;
158 };
159
160 partition@d10000 {
161 label = "tplink";
162 reg = <0xd10000 0x2e0000>;
163 read-only;
164 };
165
166 art: partition@ff0000 {
167 label = "art";
168 reg = <0xff0000 0x010000>;
169 read-only;
170
171 nvmem-layout {
172 compatible = "fixed-layout";
173 #address-cells = <1>;
174 #size-cells = <1>;
175
176 precal_art_5000: pre-calibration@5000 {
177 reg = <0x5000 0x2f20>;
178 };
179 };
180 };
181 };
182 };
183 };