ath79: move common definitions from Archer C58/C59 to common DTSI
[openwrt/openwrt.git] / target / linux / ath79 / dts / qca9561_tplink_archer-c5x.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 #include "qca956x.dtsi"
7
8 / {
9 compatible = "tplink,archer-c5x", "qca,qca9560";
10
11 aliases {
12 led-boot = &power;
13 led-failsafe = &power;
14 led-running = &power;
15 led-upgrade = &power;
16 };
17
18 chosen {
19 bootargs = "console=ttyS0,115200n8";
20 };
21
22 led_spi {
23 compatible = "spi-gpio";
24 #address-cells = <1>;
25 #size-cells = <0>;
26
27 sck-gpios = <&gpio 18 GPIO_ACTIVE_HIGH>;
28 mosi-gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
29 cs-gpios = <&gpio 20 GPIO_ACTIVE_HIGH>;
30 num-chipselects = <1>;
31
32 led_gpio: led_gpio@0 {
33 compatible = "fairchild,74hc595";
34 reg = <0>;
35 gpio-controller;
36 #gpio-cells = <2>;
37 registers-number = <1>;
38 spi-max-frequency = <10000000>;
39 };
40 };
41
42 leds: leds {
43 compatible = "gpio-leds";
44
45 power: power {
46 label = "tp-link:green:power";
47 gpios = <&led_gpio 0 GPIO_ACTIVE_LOW>;
48 default-state = "on";
49 };
50
51 wlan2g {
52 label = "tp-link:green:wlan2g";
53 gpios = <&led_gpio 1 GPIO_ACTIVE_LOW>;
54 linux,default-trigger = "phy1tpt";
55 };
56
57 wlan5g {
58 label = "tp-link:green:wlan5g";
59 gpios = <&led_gpio 2 GPIO_ACTIVE_LOW>;
60 linux,default-trigger = "phy0tpt";
61 };
62
63 wan_green {
64 label = "tp-link:green:wan";
65 gpios = <&led_gpio 4 GPIO_ACTIVE_LOW>;
66 };
67
68 wan_amber {
69 label = "tp-link:amber:wan";
70 gpios = <&led_gpio 5 GPIO_ACTIVE_LOW>;
71 };
72
73 lan {
74 label = "tp-link:green:lan";
75 gpios = <&led_gpio 3 GPIO_ACTIVE_LOW>;
76 };
77
78 wps {
79 label = "tp-link:green:wps";
80 gpios = <&led_gpio 6 GPIO_ACTIVE_LOW>;
81 };
82 };
83
84 keys {
85 compatible = "gpio-keys-polled";
86 poll-interval = <100>;
87
88 wps_button {
89 label = "WPS button";
90 linux,code = <KEY_WPS_BUTTON>;
91 gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
92 };
93
94 wifi_button {
95 label = "WiFi button";
96 linux,code = <KEY_RFKILL>;
97 gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
98 };
99
100 reset_button {
101 label = "Reset button";
102 linux,code = <KEY_RESTART>;
103 gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
104 };
105 };
106
107 gpio-export {
108 compatible = "gpio-export";
109
110 gpio_shift_register_oe {
111 gpio-export,name = "tp-link:oe:sr";
112 gpio-export,output = <0>;
113 gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
114 };
115
116 gpio_shift_register_reset {
117 gpio-export,name = "tp-link:reset:sr";
118 gpio-export,output = <1>;
119 gpios = <&gpio 19 GPIO_ACTIVE_HIGH>;
120 };
121
122 };
123 };
124
125 &uart {
126 status = "okay";
127 };
128
129 &gpio {
130 status = "okay";
131 };
132
133 &pcie {
134 status = "okay";
135 };
136
137 &eth0 {
138 status = "okay";
139
140 phy-mode = "mii";
141 phy-handle = <&swphy0>;
142
143 mtd-mac-address = <&mac 0x8>;
144 mtd-mac-address-increment = <1>;
145
146 gmac-config {
147 device = <&gmac>;
148
149 switch-phy-addr-swap = <1>;
150 switch-phy-swap = <1>;
151 };
152 };
153
154 &eth1 {
155 status = "okay";
156
157 mtd-mac-address = <&mac 0x8>;
158 };
159
160 &wmac {
161 status = "okay";
162
163 mtd-cal-data = <&art 0x1000>;
164 mtd-mac-address = <&mac 0x8>;
165 };