ath79: update DTS for TP-Link WDR3600/WDR4300 v1
[openwrt/openwrt.git] / target / linux / ath79 / dts / ar9344_tplink_tl-wdr4300.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 #include "ar9344.dtsi"
7
8 / {
9 aliases {
10 led-boot = &system;
11 led-failsafe = &system;
12 led-running = &system;
13 led-upgrade = &system;
14 };
15
16 leds {
17 compatible = "gpio-leds";
18
19 usb1 {
20 label = "tp-link:green:usb1";
21 gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
22 trigger-sources = <&hub_port1>;
23 linux,default-trigger = "usbport";
24 };
25
26 usb2 {
27 label = "tp-link:green:usb2";
28 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
29 trigger-sources = <&hub_port2>;
30 linux,default-trigger = "usbport";
31 };
32
33 wlan2g {
34 label = "tp-link:green:wlan2g";
35 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
36 linux,default-trigger = "phy0tpt";
37 };
38
39 system: system {
40 label = "tp-link:green:system";
41 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
42 default-state = "on";
43 };
44
45 qss {
46 label = "tp-link:green:qss";
47 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
48 };
49 };
50
51 ath9k-leds {
52 compatible = "gpio-leds";
53
54 wlan5g {
55 label = "tp-link:green:wlan5g";
56 gpios = <&ath9k 0 GPIO_ACTIVE_LOW>;
57 linux,default-trigger = "phy1tpt";
58 };
59 };
60
61 keys {
62 compatible = "gpio-keys";
63
64 reset {
65 linux,code = <KEY_RESTART>;
66 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
67 debounce-interval = <60>;
68 };
69
70 wifi {
71 linux,code = <KEY_RFKILL>;
72 linux,input-type = <EV_SW>;
73 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
74 debounce-interval = <60>;
75 };
76 };
77 };
78
79 &ref {
80 clock-frequency = <40000000>;
81 };
82
83 &uart {
84 status = "okay";
85 };
86
87 &gpio {
88 status = "okay";
89
90 lna0 {
91 gpio-hog;
92 gpios = <18 GPIO_ACTIVE_HIGH>;
93 output-high;
94 line-name = "tp-link:ext:lna0";
95 };
96
97 lna1 {
98 gpio-hog;
99 gpios = <19 GPIO_ACTIVE_HIGH>;
100 output-high;
101 line-name = "tp-link:ext:lna1";
102 };
103
104 usb1_power {
105 gpio-hog;
106 gpios = <22 GPIO_ACTIVE_HIGH>;
107 output-high;
108 line-name = "tp-link:power:usb1";
109 };
110
111 usb2_power {
112 gpio-hog;
113 gpios = <21 GPIO_ACTIVE_HIGH>;
114 output-high;
115 line-name = "tp-link:power:usb2";
116 };
117 };
118
119 &spi {
120 num-cs = <1>;
121
122 status = "okay";
123
124 flash@0 {
125 compatible = "jedec,spi-nor";
126 reg = <0>;
127 spi-max-frequency = <25000000>;
128
129 partitions {
130 compatible = "fixed-partitions";
131 #address-cells = <1>;
132 #size-cells = <1>;
133
134 uboot: partition@0 {
135 label = "u-boot";
136 reg = <0x000000 0x020000>;
137 read-only;
138 };
139
140 partition@20000 {
141 compatible = "tplink,firmware";
142 label = "firmware";
143 reg = <0x020000 0x7d0000>;
144 };
145
146 art: partition@7f0000 {
147 label = "art";
148 reg = <0x7f0000 0x010000>;
149 read-only;
150 };
151 };
152 };
153 };
154
155 &usb {
156 #address-cells = <1>;
157 #size-cells = <0>;
158 status = "okay";
159
160 port@1 {
161 #address-cells = <1>;
162 #size-cells = <0>;
163 reg = <1>;
164 #trigger-source-cells = <0>;
165
166 hub_port1: port@1 {
167 reg = <1>;
168 #trigger-source-cells = <0>;
169 };
170
171 hub_port2: port@2 {
172 reg = <2>;
173 #trigger-source-cells = <0>;
174 };
175 };
176 };
177
178 &usb_phy {
179 status = "okay";
180 };
181
182 &pcie {
183 status = "okay";
184
185 ath9k: wifi@0,0 {
186 compatible = "pci168c,0033";
187 reg = <0x0000 0 0 0 0>;
188 mtd-mac-address = <&uboot 0x1fc00>;
189 qca,no-eeprom;
190 #gpio-cells = <2>;
191 gpio-controller;
192 };
193 };
194
195 &wmac {
196 status = "okay";
197
198 mtd-cal-data = <&art 0x1000>;
199 mtd-mac-address = <&uboot 0x1fc00>;
200 mtd-mac-address-increment = <(-1)>;
201 };
202
203 &mdio0 {
204 status = "okay";
205
206 phy-mask = <0>;
207
208 phy0: ethernet-phy@0 {
209 reg = <0>;
210 phy-mode = "rgmii";
211
212 qca,ar8327-initvals = <
213 0x04 0x07600000 /* PORT0 PAD MODE CTRL */
214 0x10 0x80000080 /* POWER_ON_STRIP */
215 0x50 0xc737c737 /* LED_CTRL0 */
216 0x54 0x00000000 /* LED_CTRL1 */
217 0x58 0x00000000 /* LED_CTRL2 */
218 0x5c 0x0030c300 /* LED_CTRL3 */
219 0x7c 0x0000007e /* PORT0_STATUS */
220 >;
221 };
222 };
223
224 &eth0 {
225 status = "okay";
226
227 /* default for ar934x, except for 1000M */
228 pll-data = <0x06000000 0x00000101 0x00001616>;
229
230 mtd-mac-address = <&uboot 0x1fc00>;
231 mtd-mac-address-increment = <(-2)>;
232
233 phy-mode = "rgmii";
234 phy-handle = <&phy0>;
235 };