1a550137dd730f9b4e39246a2bba9ae2ede940dc
[oweals/openwrt.git] / target / linux / ath79 / dts / qca9558_tplink_archer-c.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 "qca955x.dtsi"
7
8 / {
9         chosen {
10                 bootargs = "console=ttyS0,115200n8";
11         };
12
13         aliases {
14                 led-boot = &led_system;
15                 led-failsafe = &led_system;
16                 led-running = &led_system;
17                 led-upgrade = &led_system;
18                 label-mac-device = &eth1;
19         };
20
21         leds: leds {
22                 compatible = "gpio-leds";
23
24                 led_system: system {
25                         label = "tp-link:green:system";
26                         gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
27                         default-state = "on";
28                 };
29
30                 usb1 {
31                         label = "tp-link:green:usb1";
32                         gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
33                         trigger-sources = <&hub_port1>;
34                         linux,default-trigger = "usbport";
35                 };
36
37                 usb2 {
38                         label = "tp-link:green:usb2";
39                         gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
40                         trigger-sources = <&hub_port0>;
41                         linux,default-trigger = "usbport";
42                 };
43
44                 wlan2g {
45                         label = "tp-link:green:wlan2g";
46                         gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
47                         linux,default-trigger = "phy1tpt";
48                 };
49
50                 qss {
51                         label = "tp-link:green:qss";
52                         gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
53                 };
54         };
55
56         keys: keys {
57                 compatible = "gpio-keys";
58
59                 reset {
60                         label = "Reset button";
61                         linux,code = <KEY_RESTART>;
62                         gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
63                         debounce-interval = <60>;
64                 };
65         };
66
67         gpio-export {
68                 compatible = "gpio-export";
69
70                 gpio_usb1_power {
71                         gpio-export,name = "tp-link:power:usb1";
72                         gpio-export,output = <1>;
73                         gpios = <&gpio 21 GPIO_ACTIVE_HIGH>;
74                 };
75
76                 gpio_usb2_power {
77                         gpio-export,name = "tp-link:power:usb2";
78                         gpio-export,output = <1>;
79                         gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
80                 };
81         };
82 };
83
84 &pcie1 {
85         status = "okay";
86 };
87
88 &uart {
89         status = "okay";
90 };
91
92 &gpio {
93         status = "okay";
94 };
95
96 &usb_phy0 {
97         status = "okay";
98 };
99
100 &usb0 {
101         #address-cells = <1>;
102         #size-cells = <0>;
103         status = "okay";
104
105         hub_port0: port@1 {
106                 reg = <1>;
107                 #trigger-source-cells = <0>;
108         };
109 };
110
111 &usb_phy1 {
112         status = "okay";
113 };
114
115 &usb1 {
116         #address-cells = <1>;
117         #size-cells = <0>;
118         status = "okay";
119
120         hub_port1: port@1 {
121                 reg = <1>;
122                 #trigger-source-cells = <0>;
123         };
124 };
125
126 &spi {
127         status = "okay";
128
129         num-cs = <1>;
130
131         flash@0 {
132                 compatible = "jedec,spi-nor";
133                 reg = <0>;
134                 spi-max-frequency = <25000000>;
135
136                 mtdparts: partitions {
137                         compatible = "fixed-partitions";
138                         #address-cells = <1>;
139                         #size-cells = <1>;
140                 };
141         };
142 };
143
144 &mdio0 {
145         status = "okay";
146
147         phy0: ethernet-phy@0 {
148                 reg = <0>;
149
150                 qca,ar8327-initvals = <
151                         0x04 0x00080080 /* PORT0 PAD MODE CTRL */
152                         0x0c 0x07600000 /* PORT6 PAD MODE CTRL */
153                         0x50 0xc737c737 /* LED_CTRL0 */
154                         0x54 0x00000000 /* LED_CTRL1 */
155                         0x58 0x00000000 /* LED_CTRL2 */
156                         0x5c 0x0030c300 /* LED_CTRL3 */
157                         0x7c 0x0000007e /* PORT0_STATUS */
158                         0x94 0x0000007e /* PORT6 STATUS */
159                         >;
160         };
161 };
162
163 &eth0 {
164         status = "okay";
165
166         mtd-mac-address = <&uboot 0x1fc00>;
167         mtd-mac-address-increment = <1>;
168         phy-handle = <&phy0>;
169         pll-data = <0x56000000 0x00000101 0x00001616>;
170
171         gmac-config {
172                 device = <&gmac>;
173                 rgmii-enabled = <1>;
174         };
175 };
176
177 &eth1 {
178         status = "okay";
179
180         mtd-mac-address = <&uboot 0x1fc00>;
181         pll-data = <0x03000101 0x00000101 0x00001616>;
182
183         fixed-link {
184                 speed = <1000>;
185                 full-duplex;
186         };
187 };
188
189 &wmac {
190         status = "okay";
191
192         mtd-cal-data = <&art 0x1000>;
193         mtd-mac-address = <&uboot 0x1fc00>;
194 };