ath79: Add generic device tree for Ubiquiti WA boards
[oweals/openwrt.git] / target / linux / ath79 / dts / qca9558_tplink_tl-wr1043nd.dtsi
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 "qca9557.dtsi"
8
9 / {
10         chosen {
11                 bootargs = "console=ttyS0,115200n8";
12         };
13
14         aliases {
15                 led-boot = &system;
16                 led-failsafe = &system;
17                 led-running = &system;
18                 led-upgrade = &system;
19         };
20
21         leds {
22                 compatible = "gpio-leds";
23
24                 system: system {
25                         label = "tp-link:green:system";
26                         gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
27                         linux,default-trigger = "heartbeat";
28                 };
29
30                 usb {
31                         label = "tp-link:green:usb";
32                         gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
33                         default-state = "off";
34                         trigger-sources = <&hub_port0>;
35                         linux,default-trigger = "usbport";
36                 };
37
38                 wifi_green {
39                         label = "tp-link:green:wlan";
40                         gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
41                         default-state = "off";
42                         linux,default-trigger = "phy0tpt";
43                 };
44
45                 wifi_wps {
46                         label = "tp-link:green:wps";
47                         gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
48                         default-state = "off";
49                 };
50         };
51
52         keys {
53                 compatible = "gpio-keys";
54
55                 reset {
56                         label = "Reset button";
57                         linux,code = <KEY_RESTART>;
58                         gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
59                         debounce-interval = <60>;
60                 };
61
62                 wifi {
63                         label = "RFKILL button";
64                         linux,code = <KEY_RFKILL>;
65                         gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
66                         debounce-interval = <60>;
67                 };
68         };
69
70         gpio-export {
71                 compatible = "gpio-export";
72                 #size-cells = <0>;
73
74                 gpio_usb_power {
75                         gpio-export,name = "tp-link:power:usb";
76                         gpio-export,output = <1>;
77                         gpios = <&gpio 21 GPIO_ACTIVE_HIGH>;
78                 };
79         };
80 };
81
82 &uart {
83         status = "okay";
84 };
85
86 &gpio {
87         status = "okay";
88 };
89
90 &usb_phy0 {
91         status = "okay";
92 };
93
94 &usb0 {
95         #address-cells = <1>;
96         #size-cells = <0>;
97         status = "okay";
98
99         hub_port0: port@1 {
100                 reg = <1>;
101                 #trigger-source-cells = <0>;
102         };
103 };
104
105 &spi {
106         status = "okay";
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                         uboot:  partition@0 {
120                                 label = "u-boot";
121                                 reg = <0x000000 0x020000>;
122                                 read-only;
123                         };
124
125                         partition@20000 {
126                                 label = "firmware";
127                                 reg = <0x020000 0x7d0000>;
128                         };
129
130                         art: partition@7f0000 {
131                                 label = "art";
132                                 reg = <0x7f0000 0x010000>;
133                                 read-only;
134                         };
135                 };
136         };
137 };
138
139 &mdio0 {
140         status = "okay";
141
142         phy0: ethernet-phy@0 {
143                 reg = <0>;
144                 qca,ar8327-initvals = <
145                         0x04 0x00080080 /* PORT0 PAD MODE CTRL */
146                         0x0c 0x07600000 /* PORT6 PAD MODE CTRL */
147                         0x10 0x81000080 /* POWER_ON_STRIP */
148                         0x50 0xcc35cc35 /* LED_CTRL0 */
149                         0x54 0xca35ca35 /* LED_CTRL1 */
150                         0x58 0xc935c935 /* LED_CTRL2 */
151                         0x5c 0x03ffff00 /* LED_CTRL3 */
152                         0x7c 0x0000007e /* PORT0_STATUS */
153                         0x94 0x0000007e /* PORT6 STATUS */
154                 >;
155         };
156 };
157
158 &eth0 {
159         status = "okay";
160
161         pll-data = <0x56000000 0x00000101 0x00001616>;
162
163         mtd-mac-address = <&uboot 0x1fc00>;
164         mtd-mac-address-increment = <1>;
165         phy-handle = <&phy0>;
166 };
167
168 &eth1 {
169         status = "okay";
170
171         pll-data = <0x03000101 0x00000101 0x00001616>;
172
173         mtd-mac-address = <&uboot 0x1fc00>;
174
175         fixed-link {
176                 speed = <1000>;
177                 full-duplex;
178         };
179 };
180
181 &wmac {
182         status = "okay";
183         mtd-cal-data = <&art 0x1000>;
184         mtd-mac-address = <&uboot 0x1fc00>;
185 };