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