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