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