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