ath79: add support for TP-Link TL-WR841N/ND v12
[openwrt/openwrt.git] / target / linux / ath79 / dts / qca9533_tplink_tl-wr842n-v3.dts
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 "qca953x.dtsi"
8
9 / {
10 compatible = "tplink,tl-wr842n-v3", "qca,qca9533";
11 model = "TP-Link TL-WR842N v3";
12
13 aliases {
14 led-boot = &qss_led;
15 led-failsafe = &qss_led;
16 led-running = &qss_led;
17 led-upgrade = &qss_led;
18 };
19
20 gpio_leds: leds {
21 compatible = "gpio-leds";
22
23 system: power {
24 label = "tp-link:green:power";
25 gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
26 default-state = "on";
27 };
28
29 wifi {
30 label = "tp-link:green:wlan";
31 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
32 linux,default-trigger = "phy0tpt";
33 };
34
35 qss_led: qss {
36 label = "tp-link:green:qss";
37 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
38 };
39
40 wan_green {
41 label = "tp-link:green:wan";
42 gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
43 };
44
45 wan_red {
46 label = "tp-link:red:wan";
47 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
48 };
49
50 lan1 {
51 label = "tp-link:green:lan1";
52 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
53 };
54
55 lan2 {
56 label = "tp-link:green:lan2";
57 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
58 };
59
60 lan3 {
61 label = "tp-link:green:lan3";
62 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
63 };
64
65 lan4 {
66 label = "tp-link:green:lan4";
67 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
68 };
69
70 usb {
71 label = "tp-link:green:usb";
72 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
73 linux,default-trigger = "usbport";
74 trigger-sources = <&hub_port>;
75 };
76 };
77
78 keys {
79 compatible = "gpio-keys";
80
81 reset {
82 label = "Reset button";
83 linux,code = <KEY_RESTART>;
84 gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
85 debounce-interval = <60>;
86 };
87
88 rfkill {
89 label = "RFKILL button";
90 linux,code = <KEY_RFKILL>;
91 gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
92 debounce-interval = <60>;
93 };
94 };
95 };
96
97 &uart {
98 status = "okay";
99 };
100
101 &usb0 {
102 #address-cells = <1>;
103 #size-cells = <0>;
104 status = "okay";
105
106 hub_port: port@1 {
107 reg = <1>;
108 #trigger-source-cells = <0>;
109 };
110 };
111
112 &usb_phy {
113 status = "okay";
114 };
115
116 &spi {
117 status = "okay";
118 num-cs = <1>;
119
120 flash@0 {
121 compatible = "jedec,spi-nor";
122 reg = <0>;
123 spi-max-frequency = <25000000>;
124
125 partitions {
126 compatible = "fixed-partitions";
127 #address-cells = <1>;
128 #size-cells = <1>;
129
130 uboot: partition@0 {
131 label = "u-boot";
132 reg = <0x000000 0x020000>;
133 read-only;
134 };
135
136 partition@20000 {
137 compatible = "tplink,firmware";
138 label = "firmware";
139 reg = <0x020000 0xfd0000>;
140 };
141
142 art: partition@ff0000 {
143 label = "art";
144 reg = <0xff0000 0x010000>;
145 read-only;
146 };
147 };
148 };
149 };
150
151 &eth1 {
152 mtd-mac-address = <&uboot 0x1fc00>;
153 };
154
155 &eth0 {
156 status = "okay";
157 phy-handle = <&swphy4>;
158
159 mtd-mac-address = <&uboot 0x1fc00>;
160 mtd-mac-address-increment = <1>;
161 };
162
163 &wmac {
164 status = "okay";
165 mtd-cal-data = <&art 0x1000>;
166 mtd-mac-address = <&uboot 0x1fc00>;
167 };
168