b07f9a7820659c4bfd1afc6c8506b5c305ad0f20
[openwrt/staging/jow.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 led-boot = &led_lan;
14 led-failsafe = &led_lan;
15 label-mac-device = &eth0;
16 };
17
18 leds {
19 compatible = "gpio-leds";
20
21 pinctrl-names = "default";
22 pinctrl-0 = <&switch_led_disable_pins>;
23
24 wlan {
25 label = "green:wlan";
26 gpios = <&gpio 26 GPIO_ACTIVE_LOW>;
27 linux,default-trigger = "phy0tpt";
28 };
29
30 led_lan: lan {
31 label = "green:lan";
32 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
33 };
34
35 led3g {
36 label = "green:3g";
37 gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
38 trigger-sources = <&hub_port>;
39 linux,default-trigger = "usbport";
40 };
41 };
42
43 keys {
44 compatible = "gpio-keys";
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 &usb {
85 dr_mode = "host";
86 vbus-supply = <&reg_usb_vbus>;
87 status = "okay";
88 };
89
90 &usb_phy {
91 status = "okay";
92 };
93
94 &spi {
95 status = "okay";
96
97 flash@0 {
98 compatible = "jedec,spi-nor";
99 spi-max-frequency = <50000000>;
100 reg = <0>;
101
102 partitions {
103 compatible = "fixed-partitions";
104 #address-cells = <1>;
105 #size-cells = <1>;
106
107 uboot: partition@0 {
108 label = "u-boot";
109 reg = <0x000000 0x020000>;
110 read-only;
111
112 nvmem-layout {
113 compatible = "fixed-layout";
114 #address-cells = <1>;
115 #size-cells = <1>;
116
117 macaddr_uboot_1fc00: macaddr@1fc00 {
118 reg = <0x1fc00 0x6>;
119 };
120 };
121 };
122
123 partition@20000 {
124 compatible = "tplink,firmware";
125 label = "firmware";
126 reg = <0x020000 0x3d0000>;
127 };
128
129 art: partition@3f0000 {
130 label = "art";
131 reg = <0x3f0000 0x010000>;
132 read-only;
133 };
134 };
135 };
136 };
137
138 &eth0 {
139 status = "okay";
140
141 nvmem-cells = <&macaddr_uboot_1fc00>;
142 nvmem-cell-names = "mac-address";
143 gmac-config {
144 device = <&gmac>;
145
146 switch-phy-addr-swap = <0>;
147 switch-phy-swap = <0>;
148 };
149 };
150
151 &eth1 {
152 status = "okay";
153
154 compatible = "syscon", "simple-mfd";
155 };
156
157 &wmac {
158 status = "okay";
159
160 mtd-cal-data = <&art 0x1000>;
161 nvmem-cells = <&macaddr_uboot_1fc00>;
162 nvmem-cell-names = "mac-address";
163 };