ath79: add support for TP-Link Archer A7
[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                                 compatible = "tplink,firmware";
140                                 label = "firmware";
141                                 reg = <0x020000 0xf30000>;
142                         };
143
144                         info: partition@f50000 {
145                                 label = "product-info";
146                                 reg = <0xf50000 0x020000>;
147                                 read-only;
148                         };
149
150                         partition@f70000 {
151                                 label = "config";
152                                 reg = <0xf70000 0x050000>;
153                                 read-only;
154                         };
155
156                         partition@fc0000 {
157                                 label = "partition-table";
158                                 reg = <0xfc0000 0x010000>;
159                                 read-only;
160                         };
161
162                         partition@fd0000 {
163                                 label = "logs";
164                                 reg = <0xfd0000 0x020000>;
165                                 read-only;
166                         };
167
168                         art: partition@ff0000 {
169                                 label = "ART";
170                                 reg = <0xff0000 0x010000>;
171                                 read-only;
172                         };
173                 };
174         };
175 };
176
177 &mdio0 {
178         status = "okay";
179
180         phy-mask = <0>;
181         phy0: ethernet-phy@0 {
182                 reg = <0>;
183                 phy-mode = "sgmii";
184
185                 qca,ar8327-initvals = <
186                         0x04 0x00080080 /* PORT0 PAD MODE CTRL */
187                         0x7c 0x0000007e /* PORT0_STATUS */
188                 >;
189         };
190 };
191
192 &eth0 {
193         status = "okay";
194
195         mtd-mac-address = <&info 0x8>;
196         phy-mode = "sgmii";
197         phy-handle = <&phy0>;
198 };
199
200 &wmac {
201         status = "okay";
202         mtd-cal-data = <&art 0x1000>;
203         mtd-mac-address = <&info 0x8>;
204 };