f1db1ffd5886f7c2cf474f94dd6b7fcd599ad625
[oweals/openwrt.git] / target / linux / ath79 / dts / ar7161_netgear_wndr.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 #include "ar7100.dtsi"
7
8 / {
9         aliases {
10                 led-boot = &led_power_orange;
11                 led-failsafe = &led_power_orange;
12                 led-running = &led_power_green;
13                 led-upgrade = &led_power_orange;
14                 label-mac-device = &eth0;
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_ohci_port>, <&usb_ehci_port>;
35                         linux,default-trigger = "usbport";
36                 };
37         };
38
39         leds {
40                 compatible = "gpio-leds";
41
42                 wps {
43                         label = "netgear:orange:wps";
44                         gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
45                 };
46
47                 led_power_green: power_green {
48                         label = "netgear:green:power";
49                         gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
50                 };
51
52                 led_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
72                 wlan2g {
73                         label = "netgear:green:wlan2g";
74                         gpios = <&ath9k0 5 GPIO_ACTIVE_LOW>;
75                         linux,default-trigger = "phy0tpt";
76                 };
77                 wlan5g {
78                         label = "netgear:blue:wlan5g";
79                         gpios = <&ath9k1 5 GPIO_ACTIVE_LOW>;
80                         linux,default-trigger = "phy1tpt";
81                 };
82         };
83
84         keys {
85                 compatible = "gpio-keys";
86
87                 wps {
88                         label = "wps";
89                         linux,code = <KEY_WPS_BUTTON>;
90                         gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
91                 };
92
93                 reset {
94                         label = "reset";
95                         linux,code = <KEY_RESTART>;
96                         gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
97                 };
98
99                 rfkill {
100                         label = "rfkill";
101                         linux,code = <KEY_RFKILL>;
102                         gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
103                 };
104         };
105
106         rtl8366s {
107                 compatible = "realtek,rtl8366s";
108
109                 gpio-sda = <&gpio 5 GPIO_ACTIVE_HIGH>;
110                 gpio-sck = <&gpio 7 GPIO_ACTIVE_HIGH>;
111
112                 mdio-bus {
113                         #address-cells = <1>;
114                         #size-cells = <0>;
115                         status = "okay";
116
117                         phy-mask = <0x10>;
118
119                         phy4: ethernet-phy@4 {
120                                 reg = <4>;
121                                 phy-mode = "rgmii";
122                         };
123                 };
124         };
125 };
126
127 &usb_phy {
128         status = "okay";
129 };
130
131 &usb1 {
132         #address-cells = <1>;
133         #size-cells = <0>;
134         status = "okay";
135
136         usb_ohci_port: port@1 {
137                 reg = <1>;
138                 #trigger-source-cells = <0>;
139         };
140 };
141
142 &usb2 {
143         #address-cells = <1>;
144         #size-cells = <0>;
145         status = "okay";
146
147         usb_ehci_port: port@1 {
148                 reg = <1>;
149                 #trigger-source-cells = <0>;
150         };
151 };
152
153 &pcie0 {
154         status = "okay";
155
156         ath9k0: wifi@0,11 {
157                 compatible = "pci168c,0029";
158                 reg = <0x8800 0 0 0 0>;
159                 mtd-mac-address = <&art 0x0>;
160                 qca,no-eeprom;
161                 #gpio-cells = <2>;
162                 gpio-controller;
163
164                 /* all WNDR3700 variants have four antennae dedicated
165                  * to the 2.4GHz radio. Two antennae are available for
166                  * each chain. The following configuration is the
167                  * default setting which taken from the vendor's wifi
168                  * code for that radio.
169                  *
170                  * All possible options [GPIO6,GPIO7,GPIO8,GPIO9]:
171                  *      [0,1,0,1], [0,1,1,0], [1,0,0,1], [1,0,1,0]
172                  */
173                 antenna-demux {
174                         gpio-hog;
175                         line-name = "fixed antenna group 1";
176                         gpios = <6 GPIO_ACTIVE_LOW>,
177                                 <7 GPIO_ACTIVE_HIGH>,
178                                 <8 GPIO_ACTIVE_LOW>,
179                                 <9 GPIO_ACTIVE_HIGH>;
180                         output-high;
181                 };
182         };
183
184         ath9k1: wifi@0,12 {
185                 compatible = "pci168c,0029";
186                 reg = <0x9000 0 0 0 0>;
187                 mtd-mac-address = <&art 0xc>;
188                 qca,no-eeprom;
189                 #gpio-cells = <2>;
190                 gpio-controller;
191         };
192 };
193
194 &uart {
195         status = "okay";
196 };
197
198 &spi {
199         status = "okay";
200
201         num-cs = <1>;
202
203         flash@0 {
204                 compatible = "jedec,spi-nor";
205                 reg = <0>;
206                 spi-max-frequency = <25000000>;
207
208                 partitions: partitions {
209                         compatible = "fixed-partitions";
210                         #address-cells = <1>;
211                         #size-cells = <1>;
212                 };
213         };
214 };
215
216 &eth0 {
217         status = "okay";
218
219         pll-data = <0x11110000 0x00001099 0x00991099>;
220
221         mtd-mac-address = <&art 0x00>;
222
223         fixed-link {
224                 speed = <1000>;
225                 full-duplex;
226         };
227 };
228
229 &eth1 {
230         status = "okay";
231
232         pll-data = <0x11110000 0x00001099 0x00991099>;
233
234         mtd-mac-address = <&art 0x06>;
235
236         phy-handle = <&phy4>;
237 };