ath79: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / ath79 / dts / ar9344_netgear_r6100.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "ar9344.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 = "Netgear R6100";
11 compatible = "netgear,r6100", "qca,ar9344";
12
13 aliases {
14 label-mac-device = &eth0;
15 led-boot = &led_power_green;
16 led-failsafe = &led_power_amber;
17 led-running = &led_power_green;
18 led-upgrade = &led_power_green;
19 };
20
21 gpio-export {
22 compatible = "gpio-export";
23 #size-cells = <0>;
24
25 usb-power {
26 gpio-export,name = "usb-power";
27 gpio-export,output = <1>;
28 gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
29 };
30 };
31
32 keys {
33 compatible = "gpio-keys";
34
35 reset {
36 label = "reset";
37 linux,code = <KEY_RESTART>;
38 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
39 debounce-interval = <60>;
40 };
41
42 rfkill {
43 label = "rfkill";
44 linux,code = <KEY_RFKILL>;
45 gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
46 debounce-interval = <60>;
47 };
48
49 wps {
50 label = "wps";
51 linux,code = <KEY_WPS_BUTTON>;
52 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
53 debounce-interval = <60>;
54 };
55 };
56
57 leds {
58 compatible = "gpio-leds";
59
60 led_power_amber: power_amber {
61 function = LED_FUNCTION_POWER;
62 color = <LED_COLOR_ID_AMBER>;
63 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
64 };
65
66 led_power_green: power_green {
67 function = LED_FUNCTION_POWER;
68 color = <LED_COLOR_ID_GREEN>;
69 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
70 };
71
72 usb {
73 function = LED_FUNCTION_USB;
74 color = <LED_COLOR_ID_BLUE>;
75 gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
76 trigger-sources = <&hub_port>;
77 linux,default-trigger = "usbport";
78 };
79
80 wan_amber {
81 function = LED_FUNCTION_WAN;
82 color = <LED_COLOR_ID_AMBER>;
83 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
84 };
85
86 wan_green {
87 function = LED_FUNCTION_WAN;
88 color = <LED_COLOR_ID_GREEN>;
89 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
90 };
91
92 wlan {
93 function = LED_FUNCTION_WLAN;
94 color = <LED_COLOR_ID_BLUE>;
95 gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
96 linux,default-trigger = "phy1tpt";
97 };
98 };
99 };
100
101 &eth0 {
102 status = "okay";
103
104 phy-handle = <&swphy0>;
105
106 nvmem-cells = <&macaddr_caldata_6>;
107 nvmem-cell-names = "mac-address";
108
109 gmac-config {
110 device = <&gmac>;
111 switch-phy-swap = <1>;
112 };
113 };
114
115 &eth1 {
116 status = "okay";
117
118 nvmem-cells = <&macaddr_caldata_0>;
119 nvmem-cell-names = "mac-address";
120 };
121
122 &nand {
123 status = "okay";
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 = <0x0000000 0x0020000>;
133 read-only;
134 };
135
136 caldata: partition@20000 {
137 label = "caldata";
138 reg = <0x0020000 0x0040000>;
139 read-only;
140
141 nvmem-layout {
142 compatible = "fixed-layout";
143 #address-cells = <1>;
144 #size-cells = <1>;
145
146 cal_ath9k: calibration@1000 {
147 reg = <0x1000 0x440>;
148 };
149
150 cal_ath10k: calibration@5000 {
151 reg = <0x5000 0x844>;
152 };
153
154 macaddr_caldata_0: macaddr@0 {
155 reg = <0x0 0x6>;
156 };
157
158 macaddr_caldata_6: macaddr@6 {
159 reg = <0x6 0x6>;
160 };
161
162 macaddr_caldata_c: macaddr@c {
163 reg = <0xc 0x6>;
164 };
165 };
166 };
167
168 partition@60000 {
169 label = "caldata-backup";
170 reg = <0x0060000 0x0040000>;
171 read-only;
172 };
173
174 partition@a0000 {
175 label = "config";
176 reg = <0x00a0000 0x0080000>;
177 read-only;
178 };
179
180 partition@120000 {
181 label = "pot";
182 reg = <0x0120000 0x0080000>;
183 read-only;
184 };
185
186 partition@1a0000 {
187 label = "kernel";
188 reg = <0x01a0000 0x0400000>;
189 };
190
191 partition@5a0000 {
192 label = "ubi";
193 reg = <0x05a0000 0x7560000>;
194 };
195
196 partition@7b00000 {
197 label = "language";
198 reg = <0x7b00000 0x0200000>;
199 read-only;
200 };
201
202 partition@7d00000 {
203 label = "traffic_meter";
204 reg = <0x7d00000 0x0300000>;
205 read-only;
206 };
207 };
208 };
209
210 &pcie {
211 status = "okay";
212
213 wifi@0,0 {
214 compatible = "qcom,ath10k";
215 reg = <0x0000 0 0 0 0>;
216
217 nvmem-cells = <&cal_ath10k>, <&macaddr_caldata_c>;
218 nvmem-cell-names = "calibration", "mac-address";
219 };
220 };
221
222 &ref {
223 clock-frequency = <40000000>;
224 };
225
226 &usb {
227 status = "okay";
228 };
229
230 &usb_phy {
231 status = "okay";
232 };
233
234 &wmac {
235 status = "okay";
236
237 nvmem-cells = <&cal_ath9k>;
238 nvmem-cell-names = "calibration";
239 };