ath79: add support for Netgear WNDR4300 v2
[openwrt/openwrt.git] / target / linux / ath79 / dts / qca9563_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 "qca956x.dtsi"
7
8 / {
9 chosen {
10 bootargs = "console=ttyS0,115200n8";
11 };
12
13 aliases {
14 led-boot = &led_power_amber;
15 led-failsafe = &led_power_amber;
16 led-running = &led_power_green;
17 led-upgrade = &led_power_amber;
18 label-mac-device = &eth0;
19 };
20
21 keys {
22 compatible = "gpio-keys";
23
24 wps {
25 label = "wps";
26 linux,code = <KEY_WPS_BUTTON>;
27 gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
28 };
29
30 reset {
31 label = "reset";
32 linux,code = <KEY_RESTART>;
33 gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
34 };
35 };
36
37 ath9k-keys {
38 compatible = "gpio-keys-polled";
39 poll-interval = <20>;
40
41 rfkill {
42 label = "rfkill";
43 linux,code = <KEY_RFKILL>;
44 gpios = <&ath9k 9 GPIO_ACTIVE_LOW>;
45 debounce-interval = <60>;
46 };
47 };
48
49 leds: leds {
50 compatible = "gpio-leds";
51
52 pinctrl-names = "default";
53 pinctrl-0 = <&jtag_disable_pins>;
54
55 led_power_green: power_green {
56 label = "netgear:green:power";
57 gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
58 };
59
60 led_power_amber: power_amber {
61 label = "netgear:amber:power";
62 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
63 default-state = "keep";
64 };
65
66 wan_green {
67 label = "netgear:green:wan";
68 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
69 };
70
71 wan_amber {
72 label = "netgear:amber:wan";
73 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
74 };
75
76 wlan2g_green {
77 label = "netgear:green:wlan2g";
78 gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
79 linux,default-trigger = "phy0tpt";
80 };
81
82 wps_green {
83 label = "netgear:green:wps";
84 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
85 };
86 };
87
88 ath9k-leds {
89 compatible = "gpio-leds";
90
91 wlan5g_blue {
92 label = "netgear:blue:wlan5g";
93 gpios = <&ath9k 7 GPIO_ACTIVE_LOW>;
94 linux,default-trigger = "phy1tpt";
95 };
96 };
97 };
98
99 &spi {
100 status = "okay";
101
102 num-cs = <2>;
103 cs-gpios = <0>, <0>;
104
105 flash@0 {
106 compatible = "jedec,spi-nor";
107 reg = <0>;
108 spi-max-frequency = <25000000>;
109
110 partitions {
111 compatible = "fixed-partitions";
112 #address-cells = <1>;
113 #size-cells = <1>;
114
115 partition@0 {
116 label = "u-boot";
117 reg = <0x0 0x40000>;
118 read-only;
119 };
120
121 partition@40000 {
122 label = "u-boot-env";
123 reg = <0x40000 0x10000>;
124 };
125
126 partition@50000 {
127 label = "caldata_backup";
128 reg = <0x50000 0x10000>;
129 read-only;
130 };
131
132 partition@60000 {
133 label = "config";
134 reg = <0x60000 0x10000>;
135 };
136
137 partition@70000 {
138 label = "traffic_meter";
139 reg = <0x70000 0x10000>;
140 };
141
142 partition@80000 {
143 label = "pot";
144 reg = <0x80000 0x10000>;
145 };
146
147 partition@90000 {
148 label = "reserved";
149 reg = <0x90000 0x160000>;
150 };
151
152 art: partition@1f0000 {
153 label = "caldata";
154 reg = <0x1f0000 0x10000>;
155 read-only;
156 };
157 };
158 };
159
160 flash@1 {
161 compatible = "spi-nand";
162 reg = <1>;
163 spi-max-frequency = <25000000>;
164
165 partitions {
166 compatible = "fixed-partitions";
167 #address-cells = <1>;
168 #size-cells = <1>;
169
170 partition@0 {
171 label = "kernel";
172 reg = <0x0 0x400000>;
173 };
174
175 partition@400000 {
176 label = "ubi";
177 reg = <0x400000 0x7c00000>;
178 };
179 };
180 };
181 };
182
183 &mdio0 {
184 status = "okay";
185
186 phy-mask = <0>;
187
188 phy0: ethernet-phy@0 {
189 reg = <0>;
190 phy-mode = "sgmii";
191 qca,mib-poll-interval = <500>;
192
193 qca,ar8327-initvals = <
194 0x04 0x00000080 /* PORT0 PAD MODE CTRL */
195 0x10 0x81000080 /* POWER_ON_STRIP */
196 0x50 0xcc35cc35 /* LED_CTRL0 */
197 0x54 0xcb37cb37 /* LED_CTRL1 */
198 0x58 0x00000000 /* LED_CTRL2 */
199 0x5c 0x00f3cf00 /* LED_CTRL3 */
200 0x7c 0x0000007e /* PORT0_STATUS */
201 0x94 0x00000200 /* PORT6_STATUS */
202 >;
203 };
204 };
205
206 &eth0 {
207 status = "okay";
208
209 pll-data = <0x03000101 0x00000101 0x00001919>;
210
211 mtd-mac-address = <&art 0x0>;
212
213 phy-mode = "sgmii";
214 phy-handle = <&phy0>;
215 };
216
217 &wmac {
218 status = "okay";
219
220 mtd-mac-address = <&art 0x0>;
221 qca,no-eeprom;
222 };
223
224 &pcie {
225 status = "okay";
226
227 ath9k: wifi@0,0 {
228 /* chip is AR9580, override bogus PCI ID 168c:abcd */
229 compatible = "pci168c,0033";
230 reg = <0x0000 0 0 0 0>;
231 mtd-mac-address = <&art 0xc>;
232 qca,no-eeprom;
233 qca,gpio-mask=<0xf6ff>; /* unmask pin 9 for RFKILL button */
234 #gpio-cells = <2>;
235 gpio-controller;
236 };
237 };
238
239 &usb_phy0 {
240 status = "okay";
241 };
242
243 &usb0 {
244 #address-cells = <1>;
245 #size-cells = <0>;
246 status = "okay";
247
248 hub_port0: port@1 {
249 reg = <1>;
250 #trigger-source-cells = <0>;
251 };
252 };
253
254 &uart {
255 status = "okay";
256 };