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