ath79: qca: convert to nvmem-layout
[openwrt/staging/wigyori.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 nvmem-layout {
167 compatible = "fixed-layout";
168 #address-cells = <1>;
169 #size-cells = <1>;
170
171 macaddr_caldata_0: macaddr@0 {
172 reg = <0x0 0x6>;
173 };
174
175 macaddr_caldata_c: macaddr@c {
176 reg = <0xc 0x6>;
177 };
178
179 cal_art_1000: cal@1000 {
180 reg = <0x1000 0x440>;
181 };
182
183 cal_art_5000: cal@5000 {
184 reg = <0x5000 0x440>;
185 };
186 };
187 };
188 };
189 };
190
191 flash@1 {
192 compatible = "spi-nand";
193 reg = <1>;
194 spi-max-frequency = <25000000>;
195
196 partitions {
197 compatible = "fixed-partitions";
198 #address-cells = <1>;
199 #size-cells = <1>;
200
201 partition@0 {
202 label = "kernel";
203 reg = <0x0 0x400000>;
204 };
205
206 ubiconcat0: partition@400000 {
207 label = "ubiconcat0";
208 reg = <0x400000 0x5c00000>;
209 };
210
211 ubiconcat1: partition@6020000 {
212 label = "ubiconcat1";
213 reg = <0x6020000 0x1f60000>;
214 };
215 /*
216 * U-boot always unconditionally marks block 768, 1020 - 1023 as
217 * bad blocks on each boot. To avoid conflicts with the nand
218 * driver, manually skip them.
219 */
220 };
221 };
222 };
223
224 &mdio0 {
225 status = "okay";
226
227 phy0: ethernet-phy@0 {
228 reg = <0>;
229 phy-mode = "sgmii";
230 qca,mib-poll-interval = <500>;
231
232 qca,ar8327-initvals = <
233 0x04 0x00000080 /* PORT0 PAD MODE CTRL */
234 0x10 0x81000080 /* POWER_ON_STRAP */
235 0x50 0xcc35cc35 /* LED_CTRL0 */
236 0x54 0xcb37cb37 /* LED_CTRL1 */
237 0x58 0x00000000 /* LED_CTRL2 */
238 0x5c 0x00f3cf00 /* LED_CTRL3 */
239 0x7c 0x0000007e /* PORT0_STATUS */
240 0x94 0x00000200 /* PORT6_STATUS */
241 >;
242 };
243 };
244
245 &eth0 {
246 status = "okay";
247
248 pll-data = <0x03000101 0x00000101 0x00001919>;
249
250 nvmem-cells = <&macaddr_caldata_0>;
251 nvmem-cell-names = "mac-address";
252
253 phy-mode = "sgmii";
254 phy-handle = <&phy0>;
255 };
256
257 &wmac {
258 status = "okay";
259
260 nvmem-cells = <&macaddr_caldata_0>, <&cal_art_1000>;
261 nvmem-cell-names = "mac-address", "calibration";
262 };
263
264 &pcie {
265 status = "okay";
266
267 ath9k: wifi@0,0 {
268 /* chip is AR9580, override bogus PCI ID 168c:abcd */
269 compatible = "pci168c,0033";
270 reg = <0x0000 0 0 0 0>;
271 nvmem-cells = <&macaddr_caldata_c>, <&cal_art_5000>;
272 nvmem-cell-names = "mac-address", "calibration";
273 qca,gpio-mask=<0xf6ff>; /* unmask pin 9 for RFKILL button */
274 #gpio-cells = <2>;
275 gpio-controller;
276 };
277 };
278
279 &usb_phy0 {
280 status = "okay";
281 };
282
283 &usb0 {
284 status = "okay";
285 };