aab8eac7ce80c678fd6a5f22539eeacabc7bf7e1
[oweals/openwrt.git] / target / linux / ath79 / dts / qca9558_tplink_archer-d7.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         };
19
20         leds {
21                 compatible = "gpio-leds";
22
23                 led_system: system {
24                         label = "tp-link:white:system";
25                         gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
26                         default-state = "on";
27                 };
28
29                 wlan {
30                         label = "tp-link:white:wlan";
31                         gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
32                 };
33
34                 lan {
35                         label = "tp-link:white:lan";
36                         gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
37                 };
38
39                 usb {
40                         label = "tp-link:white:usb";
41                         gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
42                         trigger-sources = <&hub_port1>, <&hub_port0>;
43                         linux,default-trigger = "usbport";
44                 };
45
46                 qss {
47                         label = "tp-link:white:qss";
48                         gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
49                 };
50         };
51
52         keys {
53                 compatible = "gpio-keys";
54
55                 wifi {
56                         label = "WiFi button";
57                         linux,code = <KEY_RFKILL>;
58                         gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
59                 };
60
61                 wps {
62                         label = "WPS button";
63                         linux,code = <KEY_WPS_BUTTON>;
64                         gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
65                 };
66
67                 reset {
68                         label = "Reset button";
69                         linux,code = <KEY_RESTART>;
70                         gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
71                 };
72         };
73
74         reg_usb0_vbus: regulator {
75                 compatible = "regulator-fixed";
76                 regulator-name = "usb_vbus";
77                 regulator-min-microvolt = <5000000>;
78                 regulator-max-microvolt = <5000000>;
79                 gpio = <&gpio 21 GPIO_ACTIVE_HIGH>;
80                 enable-active-high;
81         };
82
83         reg_usb1_vbus: regulator {
84                 compatible = "regulator-fixed";
85                 regulator-name = "usb_vbus";
86                 regulator-min-microvolt = <5000000>;
87                 regulator-max-microvolt = <5000000>;
88                 gpio = <&gpio 22 GPIO_ACTIVE_HIGH>;
89                 enable-active-high;
90         };
91 };
92
93 &mdio0 {
94         status = "okay";
95
96         phy0: ethernet-phy@0 {
97                 reg = <0>;
98
99                 qca,ar8327-initvals = <
100                         0x04 0x00080080 /* PORT0 PAD MODE CTRL */
101                         0x0c 0x07600000 /* PORT6 PAD MODE CTRL */
102                         0x50 0xc737c737 /* LED_CTRL0 */
103                         0x54 0x00000000 /* LED_CTRL1 */
104                         0x58 0x00000000 /* LED_CTRL2 */
105                         0x5c 0x0030c300 /* LED_CTRL3 */
106                         0x7c 0x0000007e /* PORT0_STATUS */
107                         0x94 0x0000007e /* PORT6 STATUS */
108                         >;
109         };
110 };
111
112 &eth0 {
113         status = "okay";
114
115         phy-handle = <&phy0>;
116         pll-data = <0x56000000 0x00000101 0x00001616>;
117
118         gmac-config {
119                 device = <&gmac>;
120                 rgmii-enabled = <1>;
121         };
122 };
123
124 &eth1 {
125         status = "okay";
126
127         pll-data = <0x03000101 0x00000101 0x00001616>;
128
129         fixed-link {
130                 speed = <1000>;
131                 full-duplex;
132         };
133 };
134
135 &wmac {
136         status = "okay";
137 };
138
139 &pcie1 {
140         status = "okay";
141 };
142
143 &uart {
144         status = "okay";
145 };
146
147 &usb_phy0 {
148         status = "okay";
149 };
150
151 &usb0 {
152         #address-cells = <1>;
153         #size-cells = <0>;
154         dr_mode = "host";
155         vbus-supply = <&reg_usb0_vbus>;
156         status = "okay";
157
158         hub_port0: port@1 {
159                 reg = <1>;
160                 #trigger-source-cells = <0>;
161         };
162 };
163
164 &usb_phy1 {
165         status = "okay";
166 };
167
168 &usb1 {
169         #address-cells = <1>;
170         #size-cells = <0>;
171         dr_mode = "host";
172         vbus-supply = <&reg_usb1_vbus>;
173         status = "okay";
174
175         hub_port1: port@1 {
176                 reg = <1>;
177                 #trigger-source-cells = <0>;
178         };
179 };