ath79: ar: convert to nvmem-layout
[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 nvmem-layout {
132 compatible = "fixed-layout";
133 #address-cells = <1>;
134 #size-cells = <1>;
135
136 macaddr_caldata_0: macaddr@0 {
137 reg = <0x0 0x6>;
138 };
139
140 macaddr_caldata_c: macaddr@c {
141 reg = <0xc 0x6>;
142 };
143
144 cal_art_1000: cal@1000 {
145 reg = <0x1000 0x440>;
146 };
147
148 cal_art_5000: cal@5000 {
149 reg = <0x5000 0x440>;
150 };
151 };
152 };
153
154 partition@c0000 {
155 label = "pot";
156 reg = <0xc0000 0x80000>;
157 };
158
159 partition@140000 {
160 label = "language";
161 reg = <0x140000 0x200000>;
162 };
163
164 partition@340000 {
165 label = "config";
166 reg = <0x340000 0x80000>;
167 };
168
169 partition@3c0000 {
170 label = "traffic_meter";
171 reg = <0x3c0000 0x300000>;
172 };
173
174 kernel@6c0000 {
175 label = "kernel";
176 reg = <0x6c0000 0x400000>;
177 };
178
179 ubiconcat0: partition@ac0000 {
180 label = "ubiconcat0";
181 reg = <0xac0000 0x1500000>;
182 };
183
184 partition@6c0000 {
185 label = "firmware";
186 reg = <0x6c0000 0x1900000>;
187 compatible = "openwrt,uimage", "denx,uimage";
188 openwrt,ih-magic = <0x33373033>;
189 openwrt,ih-type = <IH_TYPE_FILESYSTEM>;
190 };
191
192 partition@1fc0000 {
193 label = "caldata_backup";
194 reg = <0x1fc0000 0x40000>;
195 read-only;
196 };
197
198 ubiconcat1: partition@2000000 {
199 label = "ubiconcat1";
200 reg = <0x2000000 0x6000000>;
201 };
202 };
203 };
204
205 &ref {
206 clock-frequency = <40000000>;
207 };
208
209 &builtin_switch {
210 resets = <&rst 8>, <&rst 12>;
211 reset-names = "switch", "switch-analog";
212 };
213
214 &mdio0 {
215 status = "okay";
216
217 phy0: ethernet-phy@0 {
218 reg = <0>;
219 phy-mode = "rgmii";
220 qca,mib-poll-interval = <500>;
221
222 qca,ar8327-initvals = <
223 0x04 0x07600000
224 0x0c 0x01000000
225 0x10 0xc1000000
226 0x50 0xcc35cc35
227 0x54 0xcb37cb37
228 0x58 0x00000000
229 0x5c 0x00f3cf00
230 0x7c 0x0000007e
231 0x94 0x0000007e
232 >;
233 };
234 };
235
236 &eth0 {
237 status = "okay";
238
239 /* default for ar934x, except for 1000M */
240 pll-data = <0x06000000 0x00000101 0x00001616>;
241
242 nvmem-cells = <&macaddr_caldata_0>;
243 nvmem-cell-names = "mac-address";
244
245 phy-mode = "rgmii";
246 phy-handle = <&phy0>;
247 };
248
249 &gpio {
250 lna0 {
251 gpio-hog;
252 line-name = "netgear:ext:lna0";
253 gpios = <18 GPIO_ACTIVE_HIGH>;
254 output-high;
255 };
256
257 lna1 {
258 gpio-hog;
259 line-name = "netgear:ext:lna1";
260 gpios = <19 GPIO_ACTIVE_HIGH>;
261 output-high;
262 };
263 };
264
265 &wmac {
266 status = "okay";
267
268 nvmem-cells = <&macaddr_caldata_0>, <&cal_art_1000>;
269 nvmem-cell-names = "mac-address", "calibration";
270 };
271
272 &pcie {
273 status = "okay";
274
275 ath9k: wifi@0,0 {
276 compatible = "pci168c,0033";
277 reg = <0x0000 0 0 0 0>;
278 nvmem-cells = <&macaddr_caldata_c>, <&cal_art_5000>;
279 nvmem-cell-names = "mac-address", "calibration";
280 #gpio-cells = <2>;
281 gpio-controller;
282 };
283 };