ath79: add support for TP-Link Archer A7
[openwrt/openwrt.git] / target / linux / ath79 / dts / qca9563_tplink_archer-x7-v5.dtsi
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 "qca956x.dtsi"
8
9 / {
10 chosen {
11 bootargs = "console=ttyS0,115200n8";
12 };
13
14 aliases {
15 led-status = &system;
16 };
17
18 gpio_leds: leds {
19 compatible = "gpio-leds";
20
21 system: system {
22 label = "tp-link:green:system";
23 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
24 default-state = "on";
25 };
26
27 led_wlan2g: wlan2g {
28 label = "tp-link:green:wlan2g";
29 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
30 default-state = "off";
31 linux,default-trigger = "phy1tpt";
32 };
33
34 usb {
35 label = "tp-link:green:usb";
36 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
37 default-state = "off";
38 trigger-sources = <&hub_port0>;
39 linux,default-trigger = "usbport";
40 };
41 };
42
43 gpio_keys: keys {
44 compatible = "gpio-keys";
45
46 reset {
47 label = "Reset button";
48 linux,code = <KEY_RESTART>;
49 gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
50 debounce-interval = <60>;
51 };
52
53 wps {
54 label = "WPS button";
55 linux,code = <KEY_WPS_BUTTON>;
56 gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
57 debounce-interval = <60>;
58 };
59 };
60
61 gpio-export {
62 compatible = "gpio-export";
63
64 gpio_usb_power {
65 gpio-export,name = "tp-link:power:usb";
66 gpio-export,output = <1>;
67 gpios = <&gpio 19 GPIO_ACTIVE_HIGH>;
68 };
69 };
70 };
71
72 &pcie {
73 status = "okay";
74 };
75
76 &uart {
77 status = "okay";
78 };
79
80 &gpio {
81 status = "okay";
82 };
83
84 &usb_phy0 {
85 status = "okay";
86 };
87
88 &usb0 {
89 #address-cells = <1>;
90 #size-cells = <0>;
91 status = "okay";
92
93 hub_port0: port@1 {
94 reg = <1>;
95 #trigger-source-cells = <0>;
96 };
97 };
98
99 &gpio_leds {
100 wlan5g {
101 label = "tp-link:green:wlan5g";
102 gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
103 default-state = "off";
104 linux,default-trigger = "phy0tpt";
105 };
106
107 wan {
108 label = "tp-link:green:wan";
109 gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
110 default-state = "off";
111 };
112
113 wan_fail {
114 label = "tp-link:orange:wan";
115 gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
116 default-state = "off";
117 };
118
119 lan1 {
120 label = "tp-link:green:lan1";
121 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
122 default-state = "off";
123 };
124
125 lan2 {
126 label = "tp-link:green:lan2";
127 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
128 default-state = "off";
129 };
130
131 lan3 {
132 label = "tp-link:green:lan3";
133 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
134 default-state = "off";
135 };
136
137 lan4 {
138 label = "tp-link:green:lan4";
139 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
140 default-state = "off";
141 };
142
143 wps {
144 label = "tp-link:green:wps";
145 gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
146 default-state = "off";
147 };
148 };
149
150 &spi {
151 status = "okay";
152 num-cs = <1>;
153
154 flash@0 {
155 compatible = "jedec,spi-nor";
156 reg = <0>;
157 spi-max-frequency = <25000000>;
158
159 mtdparts: partitions {
160 compatible = "fixed-partitions";
161 #address-cells = <1>;
162 #size-cells = <1>;
163 };
164 };
165 };
166
167 &mdio0 {
168 status = "okay";
169
170 phy-mask = <0>;
171
172 phy0: ethernet-phy@0 {
173 reg = <0>;
174 phy-mode = "sgmii";
175
176 qca,ar8327-initvals = <
177 0x04 0x00080080 /* PORT0 PAD MODE CTRL */
178 0x10 0x81000080 /* POWER_ON_STRIP */
179 0x50 0xcc35cc35 /* LED_CTRL0 */
180 0x54 0xcb37cb37 /* LED_CTRL1 */
181 0x58 0x00000000 /* LED_CTRL2 */
182 0x5c 0x00f3cf00 /* LED_CTRL3 */
183 0x7c 0x0000007e /* PORT0_STATUS */
184 >;
185 };
186 };
187
188 &eth0 {
189 status = "okay";
190
191 pll-data = <0x03000101 0x00000101 0x00001919>;
192
193 phy-mode = "sgmii";
194 mtd-mac-address = <&info 0x8>;
195 phy-handle = <&phy0>;
196 };
197
198 &wmac {
199 status = "okay";
200 mtd-cal-data = <&art 0x1000>;
201 mtd-mac-address = <&info 0x8>;
202 };