ath79: wndr3700 series: fix wifi range & throughput
[openwrt/staging/adrian.git] / target / linux / ath79 / dts / ar7161_netgear_wndr3700.dtsi
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 "ar7100.dtsi"
8
9 / {
10 aliases {
11 led-boot = &power_orange;
12 led-failsafe = &power_orange;
13 led-running = &power_green;
14 led-upgrade = &power_orange;
15 };
16
17 chosen {
18 bootargs = "console=ttyS0,115200";
19 };
20
21 extosc: ref {
22 compatible = "fixed-clock";
23 #clock-cells = <0>;
24 clock-output-names = "ref";
25 clock-frequency = <40000000>;
26 };
27
28 reset-leds {
29 compatible = "reset-leds";
30
31 usb_led {
32 label = "netgear:green:usb";
33 resets = <&rst 12>;
34 trigger-sources = <&usb_ochi_port>, <&usb_echi_port>;
35 linux,default-trigger = "usbport";
36 };
37 };
38
39 gpio-leds {
40 compatible = "gpio-leds";
41
42 wps {
43 label = "netgear:orange:wps";
44 gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
45 };
46
47 power_green: power_green {
48 label = "netgear:green:power";
49 gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
50 };
51
52 power_orange: power_orange {
53 label = "netgear:orange:power";
54 gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
55 default-state = "on";
56 };
57
58 wps_green {
59 label = "netgear:green:wps";
60 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
61 };
62
63 wan_green {
64 label = "netgear:green:wan";
65 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
66 };
67 };
68
69 ath9k-leds {
70 compatible = "gpio-leds";
71 wlan2g {
72 label = "netgear:green:wlan2g";
73 gpios = <&ath9k0 5 GPIO_ACTIVE_LOW>;
74 linux,default-trigger = "phy0tpt";
75 };
76 wlan5g {
77 label = "netgear:blue:wlan5g";
78 gpios = <&ath9k1 5 GPIO_ACTIVE_LOW>;
79 linux,default-trigger = "phy1tpt";
80 };
81 };
82
83 keys {
84 compatible = "gpio-keys";
85
86 wps {
87 label = "wps";
88 linux,code = <KEY_WPS_BUTTON>;
89 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
90 };
91
92 reset {
93 label = "reset";
94 linux,code = <KEY_RESTART>;
95 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
96 };
97
98 rfkill {
99 label = "rfkill";
100 linux,code = <KEY_RFKILL>;
101 gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
102 };
103 };
104
105 rtl8366s {
106 compatible = "realtek,rtl8366s";
107 gpio-sda = <&gpio 5 GPIO_ACTIVE_HIGH>;
108 gpio-sck = <&gpio 7 GPIO_ACTIVE_HIGH>;
109
110 mdio-bus {
111 #address-cells = <1>;
112 #size-cells = <0>;
113 status = "okay";
114
115 phy-mask = <0x10>;
116
117 phy4: ethernet-phy@4 {
118 reg = <4>;
119 phy-mode = "rgmii";
120 };
121 };
122 };
123 };
124
125 &usb_phy {
126 status = "okay";
127 };
128
129 &usb1 {
130 #address-cells = <1>;
131 #size-cells = <0>;
132 status = "okay";
133
134 usb_ochi_port: port@1 {
135 reg = <1>;
136 #trigger-source-cells = <0>;
137 };
138 };
139
140 &usb2 {
141 #address-cells = <1>;
142 #size-cells = <0>;
143 status = "okay";
144
145 usb_echi_port: port@1 {
146 reg = <1>;
147 #trigger-source-cells = <0>;
148 };
149 };
150
151 &pcie0 {
152 status = "okay";
153
154 ath9k0: wifi@0,11 {
155 compatible = "pci168c,0029";
156 reg = <0x8800 0 0 0 0x10000>;
157 mtd-mac-address = <&art 0x0>;
158 qca,no-eeprom;
159 #gpio-cells = <2>;
160 gpio-controller;
161
162 /* all WNDR3700 variants have four antennae dedicated
163 * to the 2.4GHz radio. Two antennae are available for
164 * each chain. The following configuration is the
165 * default setting which taken from the vendor's wifi
166 * code for that radio.
167 *
168 * All possible options [GPIO6,GPIO7,GPIO8,GPIO9]:
169 * [0,1,0,1], [0,1,1,0], [1,0,0,1], [1,0,1,0]
170 */
171 antenna-demux {
172 gpio-hog;
173 line-name = "fixed antenna group 1";
174 gpios = <6 GPIO_ACTIVE_LOW>,
175 <7 GPIO_ACTIVE_HIGH>,
176 <8 GPIO_ACTIVE_LOW>,
177 <9 GPIO_ACTIVE_HIGH>;
178 output-high;
179 };
180 };
181
182 ath9k1: wifi@0,12 {
183 compatible = "pci168c,0029";
184 reg = <0x9000 0 0 0 0x10000>;
185 mtd-mac-address = <&art 0xc>;
186 qca,no-eeprom;
187 #gpio-cells = <2>;
188 gpio-controller;
189 };
190 };
191
192 &uart {
193 status = "okay";
194 };
195
196 &spi {
197 status = "okay";
198 num-cs = <1>;
199
200 flash@0 {
201 compatible = "jedec,spi-nor";
202 reg = <0>;
203 spi-max-frequency = <25000000>;
204
205 partitions: partitions {
206 compatible = "fixed-partitions";
207 #address-cells = <1>;
208 #size-cells = <1>;
209 };
210 };
211 };
212
213 &eth0 {
214 status = "okay";
215
216 pll-data = <0x11110000 0x00001099 0x00991099>;
217
218 mtd-mac-address = <&art 0x00>;
219
220 fixed-link {
221 speed = <1000>;
222 full-duplex;
223 };
224 };
225
226 &eth1 {
227 status = "okay";
228
229 pll-data = <0x11110000 0x00001099 0x00991099>;
230
231 mtd-mac-address = <&art 0x06>;
232
233 phy-handle = <&phy4>;
234 };