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