ath79: add support for Netgear WNR1000 v2
[openwrt/openwrt.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-boot = &system;
16 led-failsafe = &system;
17 led-running = &system;
18 led-upgrade = &system;
19 label-mac-device = &eth0;
20 };
21
22 leds {
23 compatible = "gpio-leds";
24
25 wlan {
26 label = "tp-link:green:wlan";
27 gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
28 linux,default-trigger = "phy0tpt";
29 };
30
31 lan {
32 label = "tp-link:green:lan";
33 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
34 };
35
36 system: wps {
37 label = "tp-link:green:wps";
38 gpios = <&gpio 26 GPIO_ACTIVE_LOW>;
39 };
40
41 led3g {
42 label = "tp-link:green:3g";
43 gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
44 trigger-sources = <&hub_port>;
45 linux,default-trigger = "usbport";
46 };
47 };
48
49 keys {
50 compatible = "gpio-keys";
51
52 button0 {
53 label = "reset";
54 linux,code = <KEY_RESTART>;
55 gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
56 debounce-interval = <60>;
57 };
58
59 button1 {
60 label = "sw1";
61 linux,input-type = <EV_SW>;
62 linux,code = <BTN_0>;
63 gpios = <&gpio 18 GPIO_ACTIVE_HIGH>;
64 debounce-interval = <60>;
65 };
66
67 button2 {
68 label = "sw2";
69 linux,input-type = <EV_SW>;
70 linux,code = <BTN_1>;
71 gpios = <&gpio 20 GPIO_ACTIVE_HIGH>;
72 debounce-interval = <60>;
73 };
74 };
75
76 reg_usb_vbus: reg_usb_vbus {
77 compatible = "regulator-fixed";
78 regulator-name = "usb_vbus";
79 regulator-min-microvolt = <5000000>;
80 regulator-max-microvolt = <5000000>;
81 gpio = <&gpio 8 GPIO_ACTIVE_HIGH>;
82 enable-active-high;
83 };
84 };
85
86 &ref {
87 clock-frequency = <25000000>;
88 };
89
90 &uart {
91 status = "okay";
92 };
93
94 &gpio {
95 status = "okay";
96 };
97
98 &usb {
99 #address-cells = <1>;
100 #size-cells = <0>;
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 flash@0 {
121 compatible = "jedec,spi-nor";
122 spi-max-frequency = <104000000>;
123 reg = <0>;
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 0x3c0000>;
140 };
141
142 partition@3e0000 {
143 label = "config";
144 reg = <0x3e0000 0x010000>;
145 read-only;
146 };
147
148 art: partition@3f0000 {
149 label = "art";
150 reg = <0x3f0000 0x010000>;
151 read-only;
152 };
153 };
154 };
155 };
156
157 &eth0 {
158 status = "okay";
159
160 mtd-mac-address = <&uboot 0x1fc00>;
161 gmac-config {
162 device = <&gmac>;
163
164 switch-phy-addr-swap = <0>;
165 switch-phy-swap = <0>;
166 };
167 };
168
169 &eth1 {
170 status = "okay";
171 compatible = "syscon", "simple-mfd";
172 };
173
174 &wmac {
175 status = "okay";
176 mtd-cal-data = <&art 0x1000>;
177 mtd-mac-address = <&uboot 0x1fc00>;
178 };