8e28c4d90f93ca4456dfe9a7af30f9ef89e41afa
[oweals/openwrt.git] / target / linux / ath79 / dts / ar7161_netgear_wndr3800.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 "ar7100.dtsi"
8
9 / {
10         compatible = "netgear,wndr3800", "qca,ar7161";
11         model = "Netgear WNDR3800";
12
13         aliases {
14                 led-status = &power_green;
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                         default-state = "off";
46                 };
47
48                 power_green: power_green {
49                         label = "netgear:green:power";
50                         gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
51                         default-state = "off";
52                 };
53
54                 power_orange {
55                         label = "netgear:orange:power";
56                         gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
57                         default-state = "off";
58                 };
59
60                 wps_green {
61                         label = "netgear:green:wps";
62                         gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
63                         default-state = "off";
64                 };
65
66                 wan_green {
67                         label = "netgear:green:wan";
68                         gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
69                         default-state = "off";
70                 };
71         };
72
73         gpio-keys-polled {
74                 compatible = "gpio-keys-polled";
75                 poll-interval = <100>;
76
77                 wps {
78                         label = "wps";
79                         linux,code = <KEY_WPS_BUTTON>;
80                         gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
81                 };
82
83                 reset {
84                         label = "reset";
85                         linux,code = <KEY_RESTART>;
86                         gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
87                 };
88
89                 rfkill {
90                         label = "rfkill";
91                         linux,code = <KEY_RFKILL>;
92                         gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
93                 };
94         };
95
96         rtl8366s {
97                 compatible = "realtek,rtl8366s";
98                 gpio-sda = <&gpio 5 GPIO_ACTIVE_HIGH>;
99                 gpio-sck = <&gpio 7 GPIO_ACTIVE_HIGH>;
100
101                 mdio-bus {
102                         #address-cells = <1>;
103                         #size-cells = <0>;
104                         status = "okay";
105
106                         phy-mask = <0x10>;
107
108                         phy4: ethernet-phy@4 {
109                                 reg = <4>;
110                                 phy-mode = "rgmii";
111                         };
112                 };
113         };
114 };
115
116 &usb_phy {
117         status = "okay";
118 };
119
120 &usb1 {
121         #address-cells = <1>;
122         #size-cells = <0>;
123         status = "okay";
124
125         usb_ochi_port: port@1 {
126                 reg = <1>;
127                 #trigger-source-cells = <0>;
128         };
129 };
130
131 &usb2 {
132         #address-cells = <1>;
133         #size-cells = <0>;
134         status = "okay";
135
136         usb_echi_port: port@1 {
137                 reg = <1>;
138                 #trigger-source-cells = <0>;
139         };
140 };
141
142 &pcie0 {
143         status = "okay";
144 };
145
146 &uart {
147         status = "okay";
148 };
149
150 &spi {
151         status = "okay";
152         num-cs = <1>;
153
154         flash@0 {
155                 compatible = "jedec,spi-nor";
156                 reg = <0>;
157                 spi-max-frequency = <25000000>;
158
159                 partitions {
160                         compatible = "fixed-partitions";
161                         #address-cells = <1>;
162                         #size-cells = <1>;
163
164                         partition@0 {
165                                 label = "u-boot";
166                                 reg = <0x000000 0x050000>;
167                                 read-only;
168                         };
169
170                         partition@1 {
171                                 label = "u-boot-env";
172                                 reg = <0x050000 0x020000>;
173                                 read-only;
174                         };
175
176                         partition@2 {
177                                 label = "firmware";
178                                 reg = <0x070000 0xf80000>;
179                         };
180
181                         art: partition@3 {
182                                 label = "art";
183                                 reg = <0xff0000 0x010000>;
184                                 read-only;
185                         };
186                 };
187         };
188 };
189
190 &eth0 {
191         status = "okay";
192
193         pll-data = <0x11110000 0x00001099 0x00991099>;
194
195         mtd-mac-address = <&art 0x00>;
196
197         fixed-link {
198                 speed = <1000>;
199                 full-duplex;
200         };
201 };
202
203 &eth1 {
204         status = "okay";
205
206         pll-data = <0x11110000 0x00001099 0x00991099>;
207
208         mtd-mac-address = <&art 0x06>;
209
210         resets = <&rst 13>;
211         reset-names = "mac";
212
213         phy-handle = <&phy4>;
214 };