ath79: Add generic device tree for Ubiquiti WA boards
[oweals/openwrt.git] / target / linux / ath79 / dts / qca9563_tplink_tl-wr1043n.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 "qca956x.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         gpio_leds: leds {
22                 compatible = "gpio-leds";
23
24                 system: system {
25                         label = "tp-link:green:system";
26                         gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
27                         linux,default-trigger = "heartbeat";
28                 };
29
30                 wifi_green {
31                         label = "tp-link:green:wlan";
32                         gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
33                         default-state = "off";
34                         linux,default-trigger = "phy0tpt";
35                 };
36
37                 wifi_wps {
38                         label = "tp-link:green:wps";
39                         gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
40                         default-state = "off";
41                 };
42
43                 wan {
44                         label = "tp-link:green:wan";
45                         gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
46                         default-state = "off";
47                 };
48
49                 wan_fail {
50                         label = "tp-link:orange:wan";
51                         gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
52                         default-state = "off";
53                 };
54
55                 lan1 {
56                         label = "tp-link:green:lan1";
57                         gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
58                         default-state = "off";
59                 };
60
61                 lan2 {
62                         label = "tp-link:green:lan2";
63                         gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
64                         default-state = "off";
65                 };
66
67                 lan3 {
68                         label = "tp-link:green:lan3";
69                         gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
70                         default-state = "off";
71                 };
72
73                 lan4 {
74                         label = "tp-link:green:lan4";
75                         gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
76                         default-state = "off";
77                 };
78         };
79
80         keys {
81                 compatible = "gpio-keys";
82
83                 reset {
84                         label = "Reset button";
85                         linux,code = <KEY_RESTART>;
86                         gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
87                         debounce-interval = <60>;
88                 };
89
90                 wifi {
91                         label = "RFKILL button";
92                         linux,code = <KEY_RFKILL>;
93                         gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
94                         debounce-interval = <60>;
95                 };
96         };
97
98         gpio-export {
99                 compatible = "gpio-export";
100                 #size-cells = <0>;
101
102                 gpio_usb_power {
103                         gpio-export,name = "tp-link:power:usb";
104                         gpio-export,output = <1>;
105                         gpios = <&gpio 8 GPIO_ACTIVE_HIGH>;
106                 };
107         };
108 };
109
110 &uart {
111         status = "okay";
112 };
113
114 &gpio {
115         status = "okay";
116 };
117
118 &spi {
119         status = "okay";
120         num-cs = <1>;
121
122         flash@0 {
123                 compatible = "jedec,spi-nor";
124                 reg = <0>;
125                 spi-max-frequency = <25000000>;
126
127                 partitions {
128                         compatible = "fixed-partitions";
129                         #address-cells = <1>;
130                         #size-cells = <1>;
131
132                         partition@0 {
133                                 label = "u-boot";
134                                 reg = <0x000000 0x020000>;
135                                 read-only;
136                         };
137
138                         partition@20000 {
139                                 label = "firmware";
140                                 reg = <0x020000 0xf30000>;
141                         };
142
143                         info: partition@f50000 {
144                                 label = "product-info";
145                                 reg = <0xf50000 0x020000>;
146                                 read-only;
147                         };
148
149                         partition@f70000 {
150                                 label = "config";
151                                 reg = <0xf70000 0x050000>;
152                                 read-only;
153                         };
154
155                         partition@fc0000 {
156                                 label = "partition-table";
157                                 reg = <0xfc0000 0x010000>;
158                                 read-only;
159                         };
160
161                         partition@fd0000 {
162                                 label = "logs";
163                                 reg = <0xfd0000 0x020000>;
164                                 read-only;
165                         };
166
167                         art: partition@ff0000 {
168                                 label = "ART";
169                                 reg = <0xff0000 0x010000>;
170                                 read-only;
171                         };
172                 };
173         };
174 };
175
176 &mdio0 {
177         status = "okay";
178
179         phy-mask = <0>;
180         phy0: ethernet-phy@0 {
181                 reg = <0>;
182                 phy-mode = "sgmii";
183
184                 qca,ar8327-initvals = <
185                         0x04 0x00080080 /* PORT0 PAD MODE CTRL */
186                         0x7c 0x0000007e /* PORT0_STATUS */
187                 >;
188         };
189 };
190
191 &eth0 {
192         status = "okay";
193
194         mtd-mac-address = <&info 0x8>;
195         phy-mode = "sgmii";
196         phy-handle = <&phy0>;
197 };
198
199 &wmac {
200         status = "okay";
201         mtd-cal-data = <&art 0x1000>;
202         mtd-mac-address = <&info 0x8>;
203 };