7852bed1f3994a7e5dcca397cc308b531bb075c8
[oweals/openwrt.git] / target / linux / ath79 / dts / qca9563_tplink_archer-c2-v3.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 "qca956x.dtsi"
8
9 / {
10         compatible = "tplink,archer-c2-v3", "qca,qca9563";
11         model = "TP-Link Archer C2 v3";
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         leds {
25                 compatible = "gpio-leds";
26
27                 led_system: system {
28                         label = "tp-link:green:system";
29                         gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
30                         default-state = "on";
31                 };
32
33                 wifi2g {
34                         label = "tp-link:green:wifi2g";
35                         gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
36                         linux,default-trigger = "phy1tpt";
37                 };
38
39                 wifi5g {
40                         label = "tp-link:green:wifi5g";
41                         gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
42                         linux,default-trigger = "phy0tpt";
43                 };
44
45                 wifi_wps {
46                         label = "tp-link:green:wps";
47                         gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
48                 };
49
50                 wan {
51                         label = "tp-link:green:wan";
52                         gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
53                 };
54
55                 wan_fail {
56                         label = "tp-link:orange:wan";
57                         gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
58                 };
59
60                 lan1 {
61                         label = "tp-link:green:lan1";
62                         gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
63                 };
64
65                 lan2 {
66                         label = "tp-link:green:lan2";
67                         gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
68                 };
69
70                 lan3 {
71                         label = "tp-link:green:lan3";
72                         gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
73                 };
74
75                 lan4 {
76                         label = "tp-link:green:lan4";
77                         gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
78                 };
79         };
80
81         keys {
82                 compatible = "gpio-keys";
83
84                 reset {
85                         label = "Reset button";
86                         linux,code = <KEY_RESTART>;
87                         gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
88                         debounce-interval = <60>;
89                 };
90
91                 wps {
92                         label = "WPS button";
93                         linux,code = <KEY_WPS_BUTTON>;
94                         gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
95                         debounce-interval = <60>;
96                 };
97         };
98 };
99
100 &uart {
101         status = "okay";
102 };
103
104 &spi {
105         status = "okay";
106
107         num-cs = <1>;
108
109         flash@0 {
110                 compatible = "jedec,spi-nor";
111                 reg = <0>;
112                 spi-max-frequency = <25000000>;
113
114                 partitions {
115                         compatible = "fixed-partitions";
116                         #address-cells = <1>;
117                         #size-cells = <1>;
118
119                         partition@0 {
120                                 label = "factory-uboot";
121                                 reg = <0x000000 0x020000>;
122                                 read-only;
123                         };
124
125                         partition@20000 {
126                                 label = "uboot";
127                                 reg = <0x020000 0x10000>;
128                                 read-only;
129                         };
130
131                         partition@30000 {
132                                 label = "firmware";
133                                 reg = <0x030000 0x7A0000>;
134                                 compatible = "denx,uimage";
135                         };
136
137                         info: partition@7e0000 {
138                                 label = "info";
139                                 reg = <0x7e0000 0x010000>;
140                                 read-only;
141                         };
142
143                         art: partition@7f0000 {
144                                 label = "art";
145                                 reg = <0x7f0000 0x010000>;
146                                 read-only;
147                         };
148                 };
149         };
150 };
151
152 &gpio {
153         status = "okay";
154 };
155
156 &mdio0 {
157         status = "okay";
158
159         phy-mask = <0>;
160         phy0: ethernet-phy@0 {
161                 reg = <0>;
162                 phy-mode = "sgmii";
163                 qca,mib-poll-interval = <500>;
164
165                 qca,ar8327-initvals = <
166                         0x04 0x00080080 /* PORT0 PAD MODE CTRL */
167                         0x7c 0x0000007e /* PORT0_STATUS */
168                 >;
169         };
170 };
171
172 &pcie {
173         status = "okay";
174 };
175
176 &eth0 {
177         status = "okay";
178
179         mtd-mac-address = <&info 0x8>;
180         phy-mode = "sgmii";
181         phy-handle = <&phy0>;
182 };
183
184 &wmac {
185         status = "okay";
186
187         mtd-cal-data = <&art 0x1000>;
188         mtd-mac-address = <&info 0x8>;
189 };