ath79: migrate TP-Link TL-MR3420v2 to ath79
[oweals/openwrt.git] / target / linux / ath79 / dts / ar9341_tplink_tl-mr3420-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-MR3420 v2";
11         compatible = "tplink,tl-mr3420-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";
23
24                 pinctrl-names = "default";
25                 pinctrl-0 = <&jtag_disable_pins>;
26
27                 reset {
28                         label = "Reset";
29                         linux,code = <KEY_RESTART>;
30                         gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
31                         debounce-interval = <60>;
32                 };
33
34                 rfkill {
35                         label = "WiFi";
36                         linux,code = <KEY_RFKILL>;
37                         gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
38                         debounce-interval = <60>;
39                 };
40         };
41
42         leds {
43                 compatible = "gpio-leds";
44
45                 system: power {
46                         label = "tp-link:green:power";
47                         gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
48                         default-state = "on";
49                 };
50
51                 wlan {
52                         label = "tp-link:green:wlan";
53                         gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
54                         linux,default-trigger = "phy0tpt";
55                 };
56
57                 qss {
58                         label = "tp-link:green:qss";
59                         gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
60                 };
61
62                 wan {
63                         label = "tp-link:green:wan";
64                         gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
65                 };
66
67                 lan1 {
68                         label = "tp-link:green:lan1";
69                         gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
70                 };
71
72                 lan2 {
73                         label = "tp-link:green:lan2";
74                         gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
75                 };
76
77                 lan3 {
78                         label = "tp-link:green:lan3";
79                         gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
80                 };
81
82                 lan4 {
83                         label = "tp-link:green:lan4";
84                         gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
85                 };
86
87                 usb {
88                         label = "tp-link:green:usb";
89                         gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
90                         trigger-sources = <&hub_port>;
91                         linux,default-trigger = "usbport";
92                 };
93         };
94 };
95
96 &ref {
97         clock-frequency = <25000000>;
98 };
99
100 &uart {
101         status = "okay";
102 };
103
104 &gpio {
105         status = "okay";
106
107         usb_power {
108                 gpio-hog;
109                 gpios = <4 GPIO_ACTIVE_HIGH>;
110                 output-high;
111                 line-name = "tp-link:power:usb";
112         };
113 };
114
115 &spi {
116         num-cs = <1>;
117
118         status = "okay";
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 0x3d0000>;
140                         };
141
142                         art: partition@3f0000 {
143                                 label = "art";
144                                 reg = <0x3f0000 0x010000>;
145                                 read-only;
146                         };
147                 };
148         };
149 };
150
151 &eth0 {
152         status = "okay";
153
154         phy-handle = <&swphy0>;
155         mtd-mac-address = <&uboot 0x1fc00>;
156         mtd-mac-address-increment = <(-1)>;
157 };
158
159 &eth1 {
160         status = "okay";
161
162         mtd-mac-address = <&uboot 0x1fc00>;
163
164         gmac-config {
165                 device = <&gmac>;
166                 switch-phy-swap = <1>;
167         };
168 };
169
170 &wmac {
171         status = "okay";
172
173         mtd-cal-data = <&art 0x1000>;
174         mtd-mac-address = <&uboot 0x1fc00>;
175 };
176
177 &usb {
178         #address-cells = <1>;
179         #size-cells = <0>;
180         status = "okay";
181
182         hub_port: port@1 {
183                 reg = <1>;
184                 #trigger-source-cells = <0>;
185         };
186 };
187
188 &usb_phy {
189         status = "okay";
190 };