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