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