ath79: add support for TP-Link MR-3040 v2
[oweals/openwrt.git] / target / linux / ath79 / dts / ar7242_tplink_tl-wr2543-v1.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 "ar7242.dtsi"
8
9 / {
10         compatible = "tplink,tl-wr2543-v1", "qca,ar7242";
11         model = "TP-LINK TL-WR2543N/ND";
12
13         aliases {
14                 led-boot = &system;
15                 led-failsafe = &system;
16                 led-running = &system;
17                 led-upgrade = &system;
18         };
19
20         chosen {
21                 bootargs = "console=ttyS0,115200n8";
22         };
23
24         extosc: ref {
25                 compatible = "fixed-clock";
26                 #clock-cells = <0>;
27                 clock-frequency = <40000000>;
28         };
29
30         gpio-keys {
31                 compatible = "gpio-keys-polled";
32                 poll-interval = <20>;
33
34                 reset {
35                         label = "reset";
36                         linux,code = <KEY_RESTART>;
37                         gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
38                         debounce-interval = <60>;
39                 };
40
41                 wps {
42                         label = "wps";
43                         linux,code = <KEY_WPS_BUTTON>;
44                         gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
45                         debounce-interval = <60>;
46                 };
47         };
48
49         leds {
50                 compatible = "gpio-leds";
51
52                 system: wps {
53                         label = "tplink:green:wps";
54                         gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
55                         default-state = "off";
56                 };
57
58                 usb {
59                         label = "tplink:green:usb";
60                         gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
61                         default-state = "off";
62                         trigger-sources = <&hub_port>;
63                         linux,default-trigger = "usbport";
64                 };
65         };
66
67         ath9k-leds {
68                 compatible = "gpio-leds";
69
70                 wlan2g {
71                         label = "tplink:green:wlan2g";
72                         gpios = <&ath9k 0 GPIO_ACTIVE_LOW>;
73                         default-state = "off";
74                         linux,default-trigger = "phy0tpt";
75                 };
76
77                 wlan5g {
78                         label = "tplink:green:wlan5g";
79                         gpios = <&ath9k 1 GPIO_ACTIVE_LOW>;
80                         default-state = "off";
81                         linux,default-trigger = "phy0tpt";
82                 };
83
84         };
85
86         rtl8367 {
87                 compatible = "realtek,rtl8367";
88                 gpio-sda = <&gpio 1 GPIO_ACTIVE_HIGH>;
89                 gpio-sck = <&gpio 6 GPIO_ACTIVE_HIGH>;
90                 realtek,extif0 = <1 0 1 1 1 1 1 1 2>;
91
92                 mdio-bus {
93                         #address-cells = <1>;
94                         #size-cells = <0>;
95                         status = "okay";
96
97                         phy0: ethernet-phy@0 {
98                                 reg = <0>;
99                         };
100                 };
101         };
102 };
103
104 &pll {
105         clocks = <&extosc>;
106 };
107
108 &spi {
109         status = "okay";
110         num-cs = <1>;
111
112         flash@0 {
113                 compatible = "jedec,spi-nor";
114                 reg = <0>;
115                 spi-max-frequency = <25000000>;
116
117                 partitions {
118                         compatible = "fixed-partitions";
119                         #address-cells = <1>;
120                         #size-cells = <1>;
121
122                         uboot:  partition@0 {
123                                 label = "u-boot";
124                                 reg = <0x000000 0x020000>;
125                                 read-only;
126                         };
127
128                         partition@20000 {
129                                 label = "firmware";
130                                 reg = <0x020000 0x7d0000>;
131                         };
132
133                         partition@7f0000 {
134                                 label = "art";
135                                 reg = <0x7f0000 0x010000>;
136                                 read-only;
137                         };
138                 };
139         };
140 };
141
142 &uart {
143         status = "okay";
144 };
145
146 &usb {
147         #address-cells = <1>;
148         #size-cells = <0>;
149         status = "okay";
150
151         hub_port: port@1 {
152                 reg = <1>;
153                 #trigger-source-cells = <0>;
154         };
155 };
156
157 &usb_phy {
158         status = "okay";
159 };
160
161 &pcie {
162         status = "okay";
163
164         ath9k: wifi@0,0 {
165                 reg = <0x0000 0 0 0 0>;
166                 #gpio-cells = <2>;
167                 gpio-controller;
168                 qca,no-eeprom;
169                 mtd-mac-address = <&uboot 0x1fc00>;
170         };
171 };
172
173 &eth0 {
174         status = "okay";
175
176         phy-mode = "rgmii";
177         mtd-mac-address = <&uboot 0x1fc00>;
178
179         phy-handle = <&phy0>;
180         fixed-link {
181                 speed = <1000>;
182                 full-duplex;
183         };
184 };