e7b30df81f0a5347815a887856e333f97527fa38
[oweals/openwrt.git] / target / linux / ath79 / dts / qca9561_tplink_archer-c25-v1.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-c25-v1", "qca,qca9561";
11         model = "TP-Link Archer C25 v1";
12
13         chosen {
14                 bootargs = "console=ttyS0,115200n8";
15         };
16
17         aliases {
18                 led-boot = &led_power;
19                 led-failsafe = &led_power;
20                 led-running = &led_power;
21                 led-upgrade = &led_power;
22                 label-mac-device = &eth0;
23         };
24
25         led_spi {
26                 compatible = "spi-gpio";
27                 #address-cells = <1>;
28                 #size-cells = <0>;
29
30                 sck-gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
31                 mosi-gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
32                 cs-gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
33                 num-chipselects = <1>;
34
35                 led_gpio: led_gpio@0 {
36                         compatible = "fairchild,74hc595";
37                         reg = <0>;
38                         gpio-controller;
39                         #gpio-cells = <2>;
40                         registers-number = <1>;
41                         spi-max-frequency = <10000000>;
42                 };
43         };
44
45         keys {
46                 compatible = "gpio-keys";
47
48                 wifi {
49                         label = "WiFi button";
50                         linux,code = <KEY_RFKILL>;
51                         gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
52                 };
53
54                 reset {
55                         label = "Reset button";
56                         linux,code = <KEY_RESTART>;
57                         gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
58                 };
59         };
60
61         leds {
62                 compatible = "gpio-leds";
63
64                 led_power: power {
65                         label = "tp-link:green:power";
66                         gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
67                         default-state = "on";
68                 };
69
70                 wps {
71                         label = "tp-link:green:wps";
72                         gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
73                 };
74
75                 wlan2g {
76                         label = "tp-link:green:wlan2g";
77                         gpios = <&led_gpio 6 GPIO_ACTIVE_LOW>;
78                         linux,default-trigger = "phy1tpt";
79                 };
80
81                 wlan5g {
82                         label = "tp-link:green:wlan5g";
83                         gpios = <&led_gpio 7 GPIO_ACTIVE_LOW>;
84                         linux,default-trigger = "phy0tpt";
85                 };
86
87                 wan_green {
88                         label = "tp-link:green:wan";
89                         gpios = <&led_gpio 5 GPIO_ACTIVE_LOW>;
90                 };
91
92                 wan_amber {
93                         label = "tp-link:amber:wan";
94                         gpios = <&led_gpio 4 GPIO_ACTIVE_LOW>;
95                 };
96
97                 lan1 {
98                         label = "tp-link:green:lan1";
99                         gpios = <&led_gpio 0 GPIO_ACTIVE_LOW>;
100                 };
101
102                 lan2 {
103                         label = "tp-link:green:lan2";
104                         gpios = <&led_gpio 1 GPIO_ACTIVE_LOW>;
105                 };
106
107                 lan3 {
108                         label = "tp-link:green:lan3";
109                         gpios = <&led_gpio 2 GPIO_ACTIVE_LOW>;
110                 };
111
112                 lan4 {
113                         label = "tp-link:green:lan4";
114                         gpios = <&led_gpio 3 GPIO_ACTIVE_LOW>;
115                 };
116         };
117 };
118
119 &spi {
120         status = "okay";
121
122         num-cs = <1>;
123
124         flash@0 {
125                 compatible = "jedec,spi-nor";
126                 reg = <0>;
127                 spi-max-frequency = <25000000>;
128
129                 partitions {
130                         compatible = "fixed-partitions";
131                         #address-cells = <1>;
132                         #size-cells = <1>;
133
134                         partition@0 {
135                                 label = "factory-boot";
136                                 reg = <0x000000 0x020000>;
137                                 read-only;
138                         };
139
140                         partition@20000 {
141                                 label = "u-boot";
142                                 reg = <0x020000 0x010000>;
143                                 read-only;
144                         };
145
146                         partition@30000 {
147                                 compatible = "denx,uimage";
148                                 label = "firmware";
149                                 reg = <0x030000 0x7a0000>;
150                         };
151
152                         config: partition@7d0000 {
153                                 label = "config";
154                                 reg = <0x7d0000 0x010000>;
155                                 read-only;
156                         };
157
158                         info: partition@7e0000 {
159                                 label = "info";
160                                 reg = <0x7e0000 0x010000>;
161                                 read-only;
162                         };
163
164                         art: partition@7f0000 {
165                                 label = "art";
166                                 reg = <0x7f0000 0x010000>;
167                                 read-only;
168                         };
169                 };
170         };
171 };
172
173 &uart {
174         status = "okay";
175 };
176
177 &pcie {
178         status = "okay";
179 };
180
181 &eth0 {
182         status = "okay";
183
184         phy-handle = <&swphy4>;
185
186         mtd-mac-address = <&info 0x8>;
187 };
188
189 &eth1 {
190         status = "okay";
191
192         mtd-mac-address = <&info 0x8>;
193         mtd-mac-address-increment = <1>;
194 };
195
196 &wmac {
197         status = "okay";
198
199         mtd-cal-data = <&art 0x1000>;
200         mtd-mac-address = <&info 0x8>;
201 };