ath79: add support for TP-Link MR-3040 v2
[oweals/openwrt.git] / target / linux / ath79 / dts / qca9563_tplink_re450-v2.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /dts-v1/;
3
4 #include <dt-bindings/gpio/gpio.h>
5 #include <dt-bindings/input/input.h>
6
7 #include "qca956x.dtsi"
8
9 / {
10         compatible = "tplink,re450-v2", "qca,qca9563";
11         model = "TP-Link RE450 v2";
12
13         chosen {
14                 bootargs = "console=ttyS0,115200n8";
15         };
16
17         aliases {
18                 led-boot = &system;
19                 led-failsafe = &system;
20                 led-running = &system;
21                 led-upgrade = &system;
22                 mdio-gpio0 = &mdio2;
23         };
24
25         leds {
26                 compatible = "gpio-leds";
27
28                 system: power {
29                         label = "tp-link:blue:power";
30                         gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
31                 };
32
33                 wlan2g {
34                         label = "tp-link:blue:wlan2g";
35                         gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
36                         default-state = "off";
37                         linux,default-trigger = "phy1tpt";
38                 };
39
40                 wlan5g {
41                         label = "tp-link:blue:wlan5g";
42                         gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
43                         default-state = "off";
44                         linux,default-trigger = "phy0tpt";
45                 };
46
47                 lan_link {
48                         label = "tp-link:green:lan_link";
49                         gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
50                         default-state = "off";
51                 };
52
53                 lan_data {
54                         label = "tp-link:green:lan_data";
55                         gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
56                         default-state = "off";
57                 };
58
59                 wps_blue {
60                         label = "tp-link:blue:wps";
61                         gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
62                         default-state = "off";
63                 };
64
65                 wps_red {
66                         label = "tp-link:red:wps";
67                         gpios = <&gpio 20 GPIO_ACTIVE_HIGH>;
68                         default-state = "off";
69                 };
70         };
71
72         keys {
73                 compatible = "gpio-keys";
74
75                 reset {
76                         label = "Reset button";
77                         linux,code = <KEY_RESTART>;
78                         gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
79                         debounce-interval = <60>;
80                 };
81
82                 power {
83                         label = "Power button";
84                         linux,code = <KEY_POWER>;
85                         gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
86                         debounce-interval = <60>;
87                 };
88
89                 leds {
90                         label = "LED control button";
91                         linux,code = <BTN_0>;
92                         gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
93                         debounce-interval = <60>;
94                 };
95
96                 wps {
97                         label = "WPS button";
98                         linux,code = <KEY_WPS_BUTTON>;
99                         gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
100                         debounce-interval = <60>;
101                 };
102         };
103
104         mdio2: mdio {
105                 compatible = "virtual,mdio-gpio";
106
107                 gpios = <&gpio 3 GPIO_ACTIVE_HIGH>, /* MDC */
108                         <&gpio 4 GPIO_ACTIVE_HIGH>; /* MDIO */
109                 #address-cells = <1>;
110                 #size-cells = <0>;
111
112                 phy0: ethernet-phy@4 {
113                         reg = <4>;
114                         device_type = "ethernet-phy";
115                         reset-gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
116                 };
117         };
118 };
119
120 &pcie {
121         status = "okay";
122 };
123
124 &uart {
125         status = "okay";
126 };
127
128 &gpio {
129         status = "okay";
130 };
131
132 &spi {
133         status = "okay";
134         num-cs = <1>;
135
136         flash@0 {
137                 compatible = "jedec,spi-nor";
138                 reg = <0>;
139                 spi-max-frequency = <25000000>;
140
141                 partitions {
142                         compatible = "fixed-partitions";
143                         #address-cells = <1>;
144                         #size-cells = <1>;
145
146                         partition@0 {
147                                 label = "u-boot";
148                                 reg = <0x000000 0x020000>;
149                                 read-only;
150                         };
151
152                         partition@20000 {
153                                 label = "firmware";
154                                 reg = <0x020000 0x5e0000>;
155                         };
156
157                         partition@600000 {
158                                 label = "partition-table";
159                                 reg = <0x600000 0x010000>;
160                                 read-only;
161                         };
162
163                         info: partition@610000 {
164                                 label = "product-info";
165                                 reg = <0x610000 0x020000>;
166                                 read-only;
167                         };
168
169                         partition@630000 {
170                                 label = "config";
171                                 reg = <0x630000 0x020000>;
172                                 read-only;
173                         };
174
175                         art: partition@7f0000 {
176                                 label = "art";
177                                 reg = <0x7f0000 0x010000>;
178                                 read-only;
179                         };
180                 };
181         };
182 };
183
184 &eth0 {
185         status = "okay";
186         mtd-mac-address = <&info 0x8>;
187         phy-handle = <&phy0>;
188 };
189
190 &wmac {
191         status = "okay";
192         mtd-cal-data = <&art 0x1000>;
193         mtd-mac-address = <&info 0x8>;
194 };