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