c23e5dac5165d1de4da7300e01228ee19f4891fa
[openwrt/staging/hauke.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 dr_mode = "host";
90 vbus-supply = <&reg_usb_vbus>;
91 status = "okay";
92 };
93
94 &usb_phy {
95 status = "okay";
96 };
97
98 &spi {
99 status = "okay";
100
101 /* Spansion S25FL032PIF SPI flash */
102 flash@0 {
103 compatible = "jedec,spi-nor";
104 spi-max-frequency = <50000000>;
105 reg = <0>;
106
107 partitions {
108 compatible = "fixed-partitions";
109 #address-cells = <1>;
110 #size-cells = <1>;
111
112 uboot: partition@0 {
113 label = "u-boot";
114 reg = <0x000000 0x020000>;
115 read-only;
116 };
117
118 partition@20000 {
119 compatible = "tplink,firmware";
120 label = "firmware";
121 reg = <0x020000 0x3c0000>;
122 };
123
124 partition@3e0000 {
125 label = "config";
126 reg = <0x3e0000 0x010000>;
127 read-only;
128 };
129
130 art: partition@3f0000 {
131 label = "art";
132 reg = <0x3f0000 0x010000>;
133 read-only;
134 };
135 };
136 };
137 };
138
139 &eth0 {
140 status = "okay";
141
142 nvmem-cells = <&macaddr_uboot_1fc00>;
143 nvmem-cell-names = "mac-address";
144 gmac-config {
145 device = <&gmac>;
146
147 switch-phy-addr-swap = <0>;
148 switch-phy-swap = <0>;
149 };
150 };
151
152 &eth1 {
153 status = "okay";
154
155 compatible = "syscon", "simple-mfd";
156 };
157
158 &wmac {
159 status = "okay";
160
161 mtd-cal-data = <&art 0x1000>;
162 nvmem-cells = <&macaddr_uboot_1fc00>;
163 nvmem-cell-names = "mac-address";
164 };
165
166 &uboot {
167 compatible = "nvmem-cells";
168 #address-cells = <1>;
169 #size-cells = <1>;
170
171 macaddr_uboot_1fc00: macaddr@1fc00 {
172 reg = <0x1fc00 0x6>;
173 };
174 };