ath79: add gpio4 pinmux on TL-WR841N/ND v8, WR842N v2, MR3420 v2
[openwrt/openwrt.git] / target / linux / ath79 / dts / ar9341_tplink_tl-wr842n-v2.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 "ar9341.dtsi"
8
9 / {
10 model = "TP-Link TL-WR842N/ND v2";
11 compatible = "tplink,tl-wr842n-v2", "qca,ar9341";
12
13 aliases {
14 serial0 = &uart;
15 led-boot = &system;
16 led-failsafe = &system;
17 led-running = &system;
18 led-upgrade = &system;
19 };
20
21 keys {
22 compatible = "gpio-keys-polled";
23 poll-interval = <20>;
24
25 reset {
26 label = "Reset";
27 linux,code = <KEY_RESTART>;
28 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
29 debounce-interval = <60>;
30 };
31
32 rfkill {
33 label = "WiFi";
34 linux,code = <KEY_RFKILL>;
35 gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
36 debounce-interval = <60>;
37 };
38 };
39
40 leds {
41 compatible = "gpio-leds";
42
43 system: power {
44 label = "tp-link:green:power";
45 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
46 default-state = "on";
47 };
48
49 wlan {
50 label = "tp-link:green:wlan";
51 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
52 linux,default-trigger = "phy0tpt";
53 };
54
55 qss {
56 label = "tp-link:green:qss";
57 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
58 };
59
60 wan {
61 label = "tp-link:green:wan";
62 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
63 };
64
65 lan1 {
66 label = "tp-link:green:lan1";
67 gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
68 };
69
70 lan2 {
71 label = "tp-link:green:lan2";
72 gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
73 };
74
75 lan3 {
76 label = "tp-link:green:lan3";
77 gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
78 };
79
80 lan4 {
81 label = "tp-link:green:lan4";
82 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
83 };
84
85 usb {
86 label = "tp-link:green:usb";
87 gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
88 trigger-sources = <&hub_port>;
89 linux,default-trigger = "usbport";
90 };
91 };
92
93 gpio-export {
94 compatible = "gpio-export";
95
96 gpio_usb_power {
97 gpio-export,name = "tp-link:power:usb";
98 gpio-export,output = <1>;
99 gpios = <&gpio 4 GPIO_ACTIVE_HIGH>;
100 };
101 };
102 };
103
104 &ref {
105 clock-frequency = <25000000>;
106 };
107
108 &uart {
109 status = "okay";
110 };
111
112 &gpio {
113 pinctrl-names = "default";
114 pinctrl-0 = <&jtag_disable_pins &pmx_usb_power>;
115 };
116
117 &pinmux {
118 pmx_usb_power: usb_power {
119 pinctrl-single,bits = <0x4 0x0 0xff>;
120 };
121 };
122
123 &spi {
124 num-cs = <1>;
125
126 status = "okay";
127
128 flash@0 {
129 compatible = "jedec,spi-nor";
130 reg = <0>;
131 spi-max-frequency = <25000000>;
132
133 partitions {
134 compatible = "fixed-partitions";
135 #address-cells = <1>;
136 #size-cells = <1>;
137
138 uboot: partition@0 {
139 label = "u-boot";
140 reg = <0x000000 0x020000>;
141 read-only;
142 };
143
144 partition@20000 {
145 compatible = "tplink,firmware";
146 label = "firmware";
147 reg = <0x020000 0x7d0000>;
148 };
149
150 art: partition@7f0000 {
151 label = "art";
152 reg = <0x7f0000 0x010000>;
153 read-only;
154 };
155 };
156 };
157 };
158
159 &usb {
160 #address-cells = <1>;
161 #size-cells = <0>;
162 status = "okay";
163
164 hub_port: port@1 {
165 reg = <1>;
166 #trigger-source-cells = <0>;
167 };
168 };
169
170 &usb_phy {
171 status = "okay";
172 };
173
174 &eth0 {
175 status = "okay";
176
177 phy-handle = <&swphy0>;
178 mtd-mac-address = <&uboot 0x1fc00>;
179 mtd-mac-address-increment = <(-1)>;
180 };
181
182 &eth1 {
183 status = "okay";
184
185 phy-handle = <&swphy4>;
186 mtd-mac-address = <&uboot 0x1fc00>;
187 phy-mode = "gmii";
188 pll-data = <0x06000000 0x00000101 0x00001616>;
189
190 gmac-config {
191 device = <&gmac>;
192 switch-phy-swap = <1>;
193 };
194 };
195
196 &wmac {
197 status = "okay";
198
199 mtd-cal-data = <&art 0x1000>;
200 mtd-mac-address = <&uboot 0x1fc00>;
201 };