ath79: add tl-mr3020-v1 support
[openwrt/staging/jow.git] / target / linux / ath79 / dts / ar9331_tl-mr3020-v1.dts
1 // SPDX-License-Identifier: GPL-2.0
2 /dts-v1/;
3
4 #include <dt-bindings/gpio/gpio.h>
5 #include <dt-bindings/input/input.h>
6
7 #include "ar9331.dtsi"
8
9 / {
10 model = "TP-Link TL-MR3020 V1";
11 compatible = "tplink,tl-mr3020-v1", "qca,ar9331";
12
13 aliases {
14 serial0 = &uart;
15 led-status = &system;
16 };
17
18 memory@0 {
19 device_type = "memory";
20 reg = <0x0 0x2000000>;
21 };
22
23 leds {
24 compatible = "gpio-leds";
25
26 wlan {
27 label = "tp-link:green:wlan";
28 gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
29 default-state = "off";
30 linux,default-trigger = "phy0tpt";
31 };
32
33 lan {
34 label = "tp-link:green:lan";
35 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
36 default-state = "off";
37 };
38
39 system: wps {
40 label = "tp-link:green:wps";
41 gpios = <&gpio 26 GPIO_ACTIVE_LOW>;
42 default-state = "off";
43 };
44
45 led3g {
46 label = "tp-link:green:3g";
47 gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
48 default-state = "off";
49 trigger-sources = <&hub_port>;
50 linux,default-trigger = "usbport";
51 };
52 };
53
54 keys {
55 compatible = "gpio-keys";
56 #address-cells = <1>;
57 #size-cells = <0>;
58
59 button0 {
60 label = "reset";
61 linux,code = <KEY_RESTART>;
62 gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
63 debounce-interval = <60>;
64 };
65
66 button1 {
67 label = "sw1";
68 linux,input-type = <EV_SW>;
69 linux,code = <BTN_0>;
70 gpios = <&gpio 18 GPIO_ACTIVE_HIGH>;
71 debounce-interval = <60>;
72 };
73
74 button2 {
75 label = "sw2";
76 linux,input-type = <EV_SW>;
77 linux,code = <BTN_1>;
78 gpios = <&gpio 20 GPIO_ACTIVE_HIGH>;
79 debounce-interval = <60>;
80 };
81 };
82
83 reg_usb_vbus: reg_usb_vbus {
84 compatible = "regulator-fixed";
85 regulator-name = "usb_vbus";
86 regulator-min-microvolt = <5000000>;
87 regulator-max-microvolt = <5000000>;
88 gpio = <&gpio 8 GPIO_ACTIVE_HIGH>;
89 enable-active-high;
90 };
91 };
92
93 &ref {
94 clock-frequency = <25000000>;
95 };
96
97 &uart {
98 status = "okay";
99 };
100
101 &gpio {
102 status = "okay";
103 };
104
105 &usb {
106 dr_mode = "host";
107 vbus-supply = <&reg_usb_vbus>;
108 status = "okay";
109
110 hub_port: port@1 {
111 reg = <1>;
112 #trigger-source-cells = <0>;
113 };
114 };
115
116 &usb_phy {
117 status = "okay";
118 };
119
120 &spi {
121 num-chipselects = <1>;
122 status = "okay";
123
124 /* Spansion S25FL032PIF SPI flash */
125 spiflash: s25sl032p@0 {
126 #address-cells = <1>;
127 #size-cells = <1>;
128 compatible = "jedec,spi-nor";
129 spi-max-frequency = <104000000>;
130 reg = <0>;
131
132 partitions {
133 compatible = "fixed-partitions";
134 #address-cells = <1>;
135 #size-cells = <1>;
136
137 uboot: partition@0 {
138 label = "u-boot";
139 reg = <0x000000 0x020000>;
140 read-only;
141 };
142
143 partition@20000 {
144 label = "firmware";
145 reg = <0x020000 0x3c0000>;
146 };
147
148 partition@3e0000 {
149 label = "config";
150 reg = <0x3e0000 0x010000>;
151 read-only;
152 };
153
154 art: partition@3f0000 {
155 label = "art";
156 reg = <0x3f0000 0x010000>;
157 read-only;
158 };
159 };
160 };
161 };
162
163 &mdio1 {
164 status = "okay";
165 phy4: ethernet-phy@4 {
166 reg = <4>;
167 };
168 };
169
170 &eth1 {
171 status = "okay";
172 phy-handle = <&phy4>;
173
174 mtd-mac-address = <&uboot 0x1fc00>;
175 fixed-link {
176 speed = <1000>;
177 full-duplex;
178 };
179
180 gmac-config {
181 device = <&gmac>;
182
183 switch-phy-addr-swap = <1>;
184 switch-phy-swap = <1>;
185 };
186 };
187
188 &wmac {
189 status = "okay";
190 mtd-cal-data = <&art 0x1000>;
191 mtd-mac-address = <&uboot 0x1fc00>;
192 };