ath79: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / ath79 / dts / qca9558_tplink_rex5x.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "qca955x.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_power;
12 led-failsafe = &led_power;
13 led-running = &led_power;
14 led-upgrade = &led_power;
15 mdio-gpio0 = &mdio2;
16 label-mac-device = &eth0;
17 };
18
19 leds {
20 compatible = "gpio-leds";
21
22 led_power: power {
23 function = LED_FUNCTION_POWER;
24 color = <LED_COLOR_ID_BLUE>;
25 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
26 };
27
28 wlan2g {
29 label = "blue:wlan2g";
30 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
31 linux,default-trigger = "phy1tpt";
32 };
33
34 wlan5g {
35 label = "blue:wlan5g";
36 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
37 linux,default-trigger = "phy0tpt";
38 };
39
40 lan_link {
41 label = "green:lan_link";
42 gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
43 };
44
45 lan_data {
46 label = "green:lan_data";
47 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
48 };
49
50 wps_blue {
51 function = LED_FUNCTION_WPS;
52 color = <LED_COLOR_ID_BLUE>;
53 gpios = <&gpio 21 GPIO_ACTIVE_HIGH>;
54 };
55
56 wps_red {
57 function = LED_FUNCTION_WPS;
58 color = <LED_COLOR_ID_RED>;
59 gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
60 };
61 };
62
63 keys {
64 compatible = "gpio-keys";
65
66 reset {
67 label = "Reset button";
68 linux,code = <KEY_RESTART>;
69 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
70 debounce-interval = <60>;
71 };
72
73 leds {
74 label = "LED control button";
75 linux,code = <BTN_0>;
76 gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
77 debounce-interval = <60>;
78 };
79
80 wps {
81 label = "WPS button";
82 linux,code = <KEY_WPS_BUTTON>;
83 gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
84 debounce-interval = <60>;
85 };
86 };
87
88 mdio2: mdio {
89 compatible = "virtual,mdio-gpio";
90
91 gpios = <&gpio 3 GPIO_ACTIVE_HIGH>, /* MDC */
92 <&gpio 1 GPIO_ACTIVE_HIGH>; /* MDIO */
93 #address-cells = <1>;
94 #size-cells = <0>;
95
96 phy4: ethernet-phy@4 {
97 reg = <4>;
98 reset-gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
99 };
100 };
101 };
102
103 &pcie0 {
104 status = "okay";
105
106 wifi@0,0 {
107 compatible = "qcom,ath10k";
108 reg = <0x0000 0 0 0 0>;
109 nvmem-cells = <&cal_art_5000>, <&macaddr_info_8 (-2)>;
110 nvmem-cell-names = "calibration", "mac-address";
111 };
112 };
113
114 &spi {
115 status = "okay";
116
117 flash@0 {
118 compatible = "jedec,spi-nor";
119 reg = <0>;
120 spi-max-frequency = <25000000>;
121
122 partitions {
123 compatible = "fixed-partitions";
124 #address-cells = <1>;
125 #size-cells = <1>;
126
127 partition@0 {
128 label = "u-boot";
129 reg = <0x000000 0x020000>;
130 read-only;
131 };
132
133 partition@20000 {
134 compatible = "tplink,firmware";
135 label = "firmware";
136 reg = <0x020000 0x5e0000>;
137 };
138
139 partition@600000 {
140 label = "partition-table";
141 reg = <0x600000 0x010000>;
142 read-only;
143 };
144
145 info: partition@610000 {
146 label = "info";
147 reg = <0x610000 0x020000>;
148 read-only;
149
150 nvmem-layout {
151 compatible = "fixed-layout";
152 #address-cells = <1>;
153 #size-cells = <1>;
154
155 macaddr_info_8: macaddr@8 {
156 compatible = "mac-base";
157 reg = <0x8 0x6>;
158 #nvmem-cell-cells = <1>;
159 };
160 };
161 };
162
163 partition@630000 {
164 label = "config";
165 reg = <0x630000 0x1c0000>;
166 read-only;
167 };
168
169 art: partition@7f0000 {
170 label = "art";
171 reg = <0x7f0000 0x010000>;
172 read-only;
173
174 nvmem-layout {
175 compatible = "fixed-layout";
176 #address-cells = <1>;
177 #size-cells = <1>;
178
179 cal_art_5000: calibration@5000 {
180 reg = <0x5000 0x844>;
181 };
182 };
183 };
184 };
185 };
186 };
187
188 &eth0 {
189 status = "okay";
190
191 phy-handle = <&phy4>;
192 pll-data = <0xa6000000 0x00000101 0x00001616>;
193
194 nvmem-cells = <&macaddr_info_8 0>;
195 nvmem-cell-names = "mac-address";
196 };
197
198 &wmac {
199 status = "okay";
200
201 mtd-cal-data = <&art 0x1000>;
202 nvmem-cells = <&macaddr_info_8 (-1)>;
203 nvmem-cell-names = "mac-address";
204 };