ath79: calibrate nand netgear wndrxxxx with nvmem
[openwrt/staging/hauke.git] / target / linux / ath79 / dts / ar9344_netgear_wndr.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "ar9344.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7 #include <dt-bindings/mtd/partitions/uimage.h>
8
9 / {
10 chosen {
11 bootargs = "console=ttyS0,115200n8";
12 };
13
14 aliases {
15 led-boot = &led_power_amber;
16 led-failsafe = &led_power_amber;
17 led-running = &led_power_green;
18 led-upgrade = &led_power_amber;
19 label-mac-device = &eth0;
20 };
21
22 keys {
23 compatible = "gpio-keys";
24
25 wps {
26 label = "wps";
27 linux,code = <KEY_WPS_BUTTON>;
28 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
29 };
30
31 reset {
32 label = "reset";
33 linux,code = <KEY_RESTART>;
34 gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
35 };
36
37 rfkill {
38 label = "rfkill";
39 linux,code = <KEY_RFKILL>;
40 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
41 };
42 };
43
44 leds: leds {
45 compatible = "gpio-leds";
46
47 pinctrl-names = "default";
48 pinctrl-0 = <&enable_gpio_11>;
49
50 led_power_green: power_green {
51 label = "green:power";
52 gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
53 };
54
55 led_power_amber: power_amber {
56 label = "amber:power";
57 gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
58 default-state = "keep";
59 };
60
61 wlan2g_green {
62 label = "green:wlan2g";
63 gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
64 linux,default-trigger = "phy0tpt";
65 };
66
67 wlan5g_blue {
68 label = "blue:wlan5g";
69 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
70 linux,default-trigger = "phy1tpt";
71 };
72
73 wps_green {
74 label = "green:wps";
75 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
76 };
77
78 wps_amber {
79 label = "amber:wps";
80 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
81 };
82 };
83
84 ubi-concat {
85 compatible = "mtd-concat";
86 devices = <&ubiconcat0 &ubiconcat1>;
87
88 partitions {
89 compatible = "fixed-partitions";
90 #address-cells = <1>;
91 #size-cells = <1>;
92
93 ubi@ac0000 {
94 label = "ubi";
95 reg = <0x0 0x7500000>;
96 };
97 };
98 };
99 };
100
101 &pinmux {
102 enable_gpio_11: pinmux_enable_gpio_11 {
103 pinctrl-single,bits = <0x8 0x0 0xff000000>;
104 };
105 };
106
107 &nand {
108 status = "okay";
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 0x40000>;
124 };
125
126 caldata: partition@80000 {
127 label = "caldata";
128 reg = <0x80000 0x40000>;
129 read-only;
130 };
131
132 partition@c0000 {
133 label = "pot";
134 reg = <0xc0000 0x80000>;
135 };
136
137 partition@140000 {
138 label = "language";
139 reg = <0x140000 0x200000>;
140 };
141
142 partition@340000 {
143 label = "config";
144 reg = <0x340000 0x80000>;
145 };
146
147 partition@3c0000 {
148 label = "traffic_meter";
149 reg = <0x3c0000 0x300000>;
150 };
151
152 kernel@6c0000 {
153 label = "kernel";
154 reg = <0x6c0000 0x400000>;
155 };
156
157 ubiconcat0: partition@ac0000 {
158 label = "ubiconcat0";
159 reg = <0xac0000 0x1500000>;
160 };
161
162 partition@6c0000 {
163 label = "firmware";
164 reg = <0x6c0000 0x1900000>;
165 compatible = "openwrt,uimage", "denx,uimage";
166 openwrt,ih-magic = <0x33373033>;
167 openwrt,ih-type = <IH_TYPE_FILESYSTEM>;
168 };
169
170 partition@1fc0000 {
171 label = "caldata_backup";
172 reg = <0x1fc0000 0x40000>;
173 read-only;
174 };
175
176 ubiconcat1: partition@2000000 {
177 label = "ubiconcat1";
178 reg = <0x2000000 0x6000000>;
179 };
180 };
181 };
182
183 &ref {
184 clock-frequency = <40000000>;
185 };
186
187 &builtin_switch {
188 resets = <&rst 8>, <&rst 12>;
189 reset-names = "switch", "switch-analog";
190 };
191
192 &mdio0 {
193 status = "okay";
194
195 phy0: ethernet-phy@0 {
196 reg = <0>;
197 phy-mode = "rgmii";
198 qca,mib-poll-interval = <500>;
199
200 qca,ar8327-initvals = <
201 0x04 0x07600000
202 0x0c 0x01000000
203 0x10 0xc1000000
204 0x50 0xcc35cc35
205 0x54 0xcb37cb37
206 0x58 0x00000000
207 0x5c 0x00f3cf00
208 0x7c 0x0000007e
209 0x94 0x0000007e
210 >;
211 };
212 };
213
214 &eth0 {
215 status = "okay";
216
217 /* default for ar934x, except for 1000M */
218 pll-data = <0x06000000 0x00000101 0x00001616>;
219
220 nvmem-cells = <&macaddr_caldata_0>;
221 nvmem-cell-names = "mac-address";
222
223 phy-mode = "rgmii";
224 phy-handle = <&phy0>;
225 };
226
227 &gpio {
228 lna0 {
229 gpio-hog;
230 line-name = "netgear:ext:lna0";
231 gpios = <18 GPIO_ACTIVE_HIGH>;
232 output-high;
233 };
234
235 lna1 {
236 gpio-hog;
237 line-name = "netgear:ext:lna1";
238 gpios = <19 GPIO_ACTIVE_HIGH>;
239 output-high;
240 };
241 };
242
243 &wmac {
244 status = "okay";
245
246 nvmem-cells = <&macaddr_caldata_0>, <&cal_art_1000>;
247 nvmem-cell-names = "mac-address", "calibration";
248 };
249
250 &pcie {
251 status = "okay";
252
253 ath9k: wifi@0,0 {
254 compatible = "pci168c,0033";
255 reg = <0x0000 0 0 0 0>;
256 nvmem-cells = <&macaddr_caldata_c>, <&cal_art_5000>;
257 nvmem-cell-names = "mac-address", "calibration";
258 #gpio-cells = <2>;
259 gpio-controller;
260 };
261 };
262
263 &caldata {
264 compatible = "nvmem-cells";
265 #address-cells = <1>;
266 #size-cells = <1>;
267
268 macaddr_caldata_0: macaddr@0 {
269 reg = <0x0 0x6>;
270 };
271
272 macaddr_caldata_c: macaddr@c {
273 reg = <0xc 0x6>;
274 };
275
276 cal_art_1000: cal@1000 {
277 reg = <0x1000 0x440>;
278 };
279
280 cal_art_5000: cal@5000 {
281 reg = <0x5000 0x440>;
282 };
283 };