ath79: fix first reboot issue on Netgear WNDR4300 v2 and WNDR4500 v3
[openwrt/staging/neocturne.git] / target / linux / ath79 / dts / qca9563_netgear_wndr.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "qca956x.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 aliases {
10 led-boot = &led_power_amber;
11 led-failsafe = &led_power_amber;
12 led-running = &led_power_green;
13 led-upgrade = &led_power_amber;
14 label-mac-device = &eth0;
15 };
16
17 keys {
18 compatible = "gpio-keys";
19
20 wps {
21 label = "wps";
22 linux,code = <KEY_WPS_BUTTON>;
23 gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
24 };
25
26 reset {
27 label = "reset";
28 linux,code = <KEY_RESTART>;
29 gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
30 };
31 };
32
33 ath9k-keys {
34 compatible = "gpio-keys-polled";
35 poll-interval = <20>;
36
37 rfkill {
38 label = "rfkill";
39 linux,code = <KEY_RFKILL>;
40 gpios = <&ath9k 9 GPIO_ACTIVE_LOW>;
41 debounce-interval = <60>;
42 };
43 };
44
45 leds: leds {
46 compatible = "gpio-leds";
47
48 pinctrl-names = "default";
49 pinctrl-0 = <&jtag_disable_pins>;
50
51 led_power_green: power_green {
52 label = "green:power";
53 gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
54 };
55
56 led_power_amber: power_amber {
57 label = "amber:power";
58 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
59 default-state = "keep";
60 };
61
62 wan_green {
63 label = "green:wan";
64 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
65 };
66
67 wan_amber {
68 label = "amber:wan";
69 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
70 };
71
72 wlan2g_green {
73 label = "green:wlan2g";
74 gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
75 linux,default-trigger = "phy0tpt";
76 };
77
78 wps_green {
79 label = "green:wps";
80 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
81 };
82 };
83
84 ath9k-leds {
85 compatible = "gpio-leds";
86
87 wlan5g_blue {
88 label = "blue:wlan5g";
89 gpios = <&ath9k 7 GPIO_ACTIVE_LOW>;
90 linux,default-trigger = "phy1tpt";
91 };
92 };
93
94 ubi-concat {
95 compatible = "mtd-concat";
96 devices = <&ubiconcat0 &ubiconcat1>;
97
98 partitions {
99 compatible = "fixed-partitions";
100 #address-cells = <1>;
101 #size-cells = <1>;
102
103 partition@0 {
104 label = "ubi";
105 reg = <0x0 0x0>;
106 };
107 };
108 };
109 };
110
111 &spi {
112 status = "okay";
113
114 flash@0 {
115 compatible = "jedec,spi-nor";
116 reg = <0>;
117 spi-max-frequency = <25000000>;
118
119 partitions {
120 compatible = "fixed-partitions";
121 #address-cells = <1>;
122 #size-cells = <1>;
123
124 partition@0 {
125 label = "u-boot";
126 reg = <0x0 0x40000>;
127 read-only;
128 };
129
130 partition@40000 {
131 label = "u-boot-env";
132 reg = <0x40000 0x10000>;
133 };
134
135 partition@50000 {
136 label = "caldata_backup";
137 reg = <0x50000 0x10000>;
138 read-only;
139 };
140
141 partition@60000 {
142 label = "config";
143 reg = <0x60000 0x10000>;
144 };
145
146 partition@70000 {
147 label = "traffic_meter";
148 reg = <0x70000 0x10000>;
149 };
150
151 partition@80000 {
152 label = "pot";
153 reg = <0x80000 0x10000>;
154 };
155
156 partition@90000 {
157 label = "reserved";
158 reg = <0x90000 0x160000>;
159 };
160
161 caldata: partition@1f0000 {
162 label = "caldata";
163 reg = <0x1f0000 0x10000>;
164 read-only;
165 };
166 };
167 };
168
169 flash@1 {
170 compatible = "spi-nand";
171 reg = <1>;
172 spi-max-frequency = <25000000>;
173
174 partitions {
175 compatible = "fixed-partitions";
176 #address-cells = <1>;
177 #size-cells = <1>;
178
179 partition@0 {
180 label = "kernel";
181 reg = <0x0 0x400000>;
182 };
183
184 ubiconcat0: partition@400000 {
185 label = "ubiconcat0";
186 reg = <0x400000 0x5c00000>;
187 };
188
189 ubiconcat1: partition@6020000 {
190 label = "ubiconcat1";
191 reg = <0x6020000 0x1f60000>;
192 };
193 /*
194 * U-boot always unconditionally marks block 768, 1020 - 1023 as
195 * bad blocks on each boot. To avoid conflicts with the nand
196 * driver, manually skip them.
197 */
198 };
199 };
200 };
201
202 &mdio0 {
203 status = "okay";
204
205 phy0: ethernet-phy@0 {
206 reg = <0>;
207 phy-mode = "sgmii";
208 qca,mib-poll-interval = <500>;
209
210 qca,ar8327-initvals = <
211 0x04 0x00000080 /* PORT0 PAD MODE CTRL */
212 0x10 0x81000080 /* POWER_ON_STRAP */
213 0x50 0xcc35cc35 /* LED_CTRL0 */
214 0x54 0xcb37cb37 /* LED_CTRL1 */
215 0x58 0x00000000 /* LED_CTRL2 */
216 0x5c 0x00f3cf00 /* LED_CTRL3 */
217 0x7c 0x0000007e /* PORT0_STATUS */
218 0x94 0x00000200 /* PORT6_STATUS */
219 >;
220 };
221 };
222
223 &eth0 {
224 status = "okay";
225
226 pll-data = <0x03000101 0x00000101 0x00001919>;
227
228 nvmem-cells = <&macaddr_caldata_0>;
229 nvmem-cell-names = "mac-address";
230
231 phy-mode = "sgmii";
232 phy-handle = <&phy0>;
233 };
234
235 &wmac {
236 status = "okay";
237
238 nvmem-cells = <&macaddr_caldata_0>, <&cal_art_1000>;
239 nvmem-cell-names = "mac-address", "calibration";
240 };
241
242 &pcie {
243 status = "okay";
244
245 ath9k: wifi@0,0 {
246 /* chip is AR9580, override bogus PCI ID 168c:abcd */
247 compatible = "pci168c,0033";
248 reg = <0x0000 0 0 0 0>;
249 nvmem-cells = <&macaddr_caldata_c>, <&cal_art_5000>;
250 nvmem-cell-names = "mac-address", "calibration";
251 qca,gpio-mask=<0xf6ff>; /* unmask pin 9 for RFKILL button */
252 #gpio-cells = <2>;
253 gpio-controller;
254 };
255 };
256
257 &usb_phy0 {
258 status = "okay";
259 };
260
261 &usb0 {
262 status = "okay";
263 };
264
265 &caldata {
266 compatible = "nvmem-cells";
267 #address-cells = <1>;
268 #size-cells = <1>;
269
270 macaddr_caldata_0: macaddr@0 {
271 reg = <0x0 0x6>;
272 };
273
274 macaddr_caldata_c: macaddr@c {
275 reg = <0xc 0x6>;
276 };
277
278 cal_art_1000: cal@1000 {
279 reg = <0x1000 0x440>;
280 };
281
282 cal_art_5000: cal@5000 {
283 reg = <0x5000 0x440>;
284 };
285 };