ath79: add support for tl-wr1043nd v2/v3
[openwrt/openwrt.git] / target / linux / ath79 / dts / qca9558_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 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 19 GPIO_ACTIVE_LOW>;
29 linux,default-trigger = "heartbeat";
30 };
31
32 usb {
33 label = "tp-link:green:usb";
34 gpios = <&gpio 15 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 12 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 18 GPIO_ACTIVE_LOW>;
50 default-state = "off";
51 };
52 };
53
54 keys {
55 compatible = "gpio-keys";
56 #address-cells = <1>;
57 #size-cells = <0>;
58
59 reset {
60 label = "Reset button";
61 linux,code = <KEY_RESTART>;
62 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
63 debounce-interval = <60>;
64 };
65
66 wifi {
67 label = "RFKILL button";
68 linux,code = <KEY_RFKILL>;
69 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
70 debounce-interval = <60>;
71 };
72 };
73
74 gpio-export {
75 compatible = "gpio-export";
76 #size-cells = <0>;
77
78 gpio_usb_power {
79 gpio-export,name = "tp-link:power:usb";
80 gpio-export,output = <1>;
81 gpios = <&gpio 21 GPIO_ACTIVE_HIGH>;
82 };
83 };
84 };
85
86 &uart {
87 status = "okay";
88 };
89
90 &gpio {
91 status = "okay";
92 };
93
94 &usb_phy0 {
95 status = "okay";
96 };
97
98 &usb0 {
99 status = "okay";
100
101 hub_port0: port@1 {
102 reg = <1>;
103 #trigger-source-cells = <0>;
104 };
105 };
106
107 &spi {
108 status = "okay";
109 num-cs = <1>;
110
111 flash@0 {
112 #address-cells = <1>;
113 #size-cells = <1>;
114 compatible = "jedec,spi-nor";
115 reg = <0>;
116 spi-max-frequency = <25000000>;
117
118 partitions {
119 compatible = "fixed-partitions";
120 #address-cells = <1>;
121 #size-cells = <1>;
122
123 uboot: partition@0 {
124 label = "u-boot";
125 reg = <0x000000 0x020000>;
126 read-only;
127 };
128
129 partition@20000 {
130 label = "firmware";
131 reg = <0x020000 0x7d0000>;
132 };
133
134 art: partition@7f0000 {
135 label = "art";
136 reg = <0x7f0000 0x010000>;
137 read-only;
138 };
139 };
140 };
141 };
142
143 &mdio0 {
144 status = "okay";
145
146 phy0: ethernet-phy@0 {
147 reg = <0>;
148 qca,ar8327-initvals = <
149 0x04 0x00080080 /* PORT0 PAD MODE CTRL */
150 0x0c 0x07600000 /* PORT6 PAD MODE CTRL */
151 0x10 0x81000080 /* POWER_ON_STRIP */
152 0x50 0xcc35cc35 /* LED_CTRL0 */
153 0x54 0xca35ca35 /* LED_CTRL1 */
154 0x58 0xc935c935 /* LED_CTRL2 */
155 0x5c 0x03ffff00 /* LED_CTRL3 */
156 0x7c 0x0000007e /* PORT0_STATUS */
157 0x94 0x0000007e /* PORT6 STATUS */
158 >;
159 };
160 };
161
162 &mdio1 {
163 status = "okay";
164
165 phy1: ethernet-phy@1 {
166 reg = <1>;
167 };
168 };
169
170 &eth0 {
171 status = "okay";
172
173 mtd-mac-address = <&uboot 0x1fc00>;
174 mtd-mac-address-increment = <1>;
175 phy-handle = <&phy0>;
176 };
177
178 &eth1 {
179 status = "okay";
180
181 mtd-mac-address = <&uboot 0x1fc00>;
182 phy-handle = <&phy1>;
183
184 fixed-link {
185 speed = <1000>;
186 full-duplex;
187 };
188 };
189
190 &wmac {
191 status = "okay";
192 mtd-cal-data = <&art 0x1000>;
193 mtd-mac-address = <&uboot 0x1fc00>;
194 };