kernel: add DT binding support to the TRX and minor parsers
[openwrt/openwrt.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
21 wlan {
22 label = "tp-link:green:wlan";
23 gpios = <&gpio 26 GPIO_ACTIVE_LOW>;
24 default-state = "off";
25 linux,default-trigger = "phy0tpt";
26 };
27
28 led_lan: lan {
29 label = "tp-link:green:lan";
30 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
31 default-state = "off";
32 };
33
34 led3g {
35 label = "tp-link:green:3g";
36 gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
37 default-state = "off";
38 trigger-sources = <&hub_port>;
39 linux,default-trigger = "usbport";
40 };
41 };
42
43 keys {
44 compatible = "gpio-keys-polled";
45 poll-interval = <20>;
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 &gpio {
90 status = "okay";
91 };
92
93 &usb {
94 #address-cells = <1>;
95 #size-cells = <0>;
96 dr_mode = "host";
97 vbus-supply = <&reg_usb_vbus>;
98 status = "okay";
99
100 hub_port: port@1 {
101 reg = <1>;
102 #trigger-source-cells = <0>;
103 };
104 };
105
106 &usb_phy {
107 status = "okay";
108 };
109
110 &spi {
111 num-chipselects = <1>;
112 status = "okay";
113
114 flash@0 {
115 compatible = "jedec,spi-nor";
116 spi-max-frequency = <104000000>;
117 reg = <0>;
118
119 partitions {
120 compatible = "fixed-partitions";
121 #address-cells = <1>;
122 #size-cells = <1>;
123
124 uboot: partition@0 {
125 label = "u-boot";
126 reg = <0x000000 0x020000>;
127 read-only;
128 };
129
130 partition@20000 {
131 compatible = "tplink,firmware";
132 label = "firmware";
133 reg = <0x020000 0x3d0000>;
134 };
135
136 art: partition@3f0000 {
137 label = "art";
138 reg = <0x3f0000 0x010000>;
139 read-only;
140 };
141 };
142 };
143 };
144
145 &eth0 {
146 status = "okay";
147
148 mtd-mac-address = <&uboot 0x1fc00>;
149 gmac-config {
150 device = <&gmac>;
151
152 switch-phy-addr-swap = <0>;
153 switch-phy-swap = <0>;
154 };
155 };
156
157 &eth1 {
158 status = "okay";
159 compatible = "syscon", "simple-mfd";
160 };
161
162 &wmac {
163 status = "okay";
164 mtd-cal-data = <&art 0x1000>;
165 mtd-mac-address = <&uboot 0x1fc00>;
166 };