ipq806x: add support for Netgear Nighthawk X4 R7500
[openwrt.git] / target / linux / ipq806x / patches-4.1 / 301-ARM-qcom-add-Netgear-Nighthawk-X4-R7500-device-tree.patch
1 From 7e77aa188a7a7c4391856a9e5ef5ef58f769e679 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jogo@openwrt.org>
3 Date: Sun, 9 Aug 2015 13:02:38 +0200
4 Subject: [PATCH] ARM: qcom: add Netgear Nighthawk X4 R7500 device tree
5
6 Signed-off-by: Jonas Gorski <jogo@openwrt.org>
7 ---
8  arch/arm/boot/dts/Makefile               |   1 +
9  arch/arm/boot/dts/qcom-ipq8064-r7500.dts | 370 +++++++++++++++++++++++++++++++
10  2 files changed, 371 insertions(+)
11  create mode 100644 arch/arm/boot/dts/qcom-ipq8064-r7500.dts
12
13 --- a/arch/arm/boot/dts/Makefile
14 +++ b/arch/arm/boot/dts/Makefile
15 @@ -452,6 +452,7 @@ dtb-$(CONFIG_ARCH_QCOM) += \
16         qcom-apq8084-mtp.dtb \
17         qcom-ipq8064-ap148.dtb \
18         qcom-ipq8064-db149.dtb \
19 +       qcom-ipq8064-r7500.dtb \
20         qcom-msm8660-surf.dtb \
21         qcom-msm8960-cdp.dtb \
22         qcom-msm8974-sony-xperia-honami.dtb
23 --- /dev/null
24 +++ b/arch/arm/boot/dts/qcom-ipq8064-r7500.dts
25 @@ -0,0 +1,362 @@
26 +#include "qcom-ipq8064-v1.0.dtsi"
27 +
28 +#include <dt-bindings/input/input.h>
29 +
30 +/ {
31 +       model = "Netgear Nighthawk X4 R7500";
32 +       compatible = "netgear,r7500", "qcom,ipq8064";
33 +
34 +       memory@0 {
35 +               reg = <0x42000000 0xe000000>;
36 +               device_type = "memory";
37 +       };
38 +
39 +       reserved-memory {
40 +               #address-cells = <1>;
41 +               #size-cells = <1>;
42 +               ranges;
43 +               rsvd@41200000 {
44 +                       reg = <0x41200000 0x300000>;
45 +                       no-map;
46 +               };
47 +       };
48 +
49 +       aliases {
50 +               serial0 = &uart4;
51 +               mdio-gpio0 = &mdio0;
52 +       };
53 +
54 +       chosen {
55 +               bootargs = "rootfstype=squashfs noinitrd";
56 +               linux,stdout-path = "serial0:115200n8";
57 +       };
58 +
59 +       soc {
60 +               pinmux@800000 {
61 +                       i2c4_pins: i2c4_pinmux {
62 +                               pins = "gpio12", "gpio13";
63 +                               function = "gsbi4";
64 +                               bias-disable;
65 +                       };
66 +
67 +                       pcie0_pins: pcie0_pinmux {
68 +                               mux {
69 +                                       pins = "gpio3";
70 +                                       function = "pcie1_rst";
71 +                                       drive-strength = <12>;
72 +                                       bias-disable;
73 +                               };
74 +                       };
75 +
76 +                       pcie1_pins: pcie1_pinmux {
77 +                               mux {
78 +                                       pins = "gpio48";
79 +                                       function = "pcie2_rst";
80 +                                       drive-strength = <12>;
81 +                                       bias-disable;
82 +                               };
83 +                       };
84 +
85 +                       nand_pins: nand_pins {
86 +                               mux {
87 +                                       pins = "gpio34", "gpio35", "gpio36",
88 +                                              "gpio37", "gpio38", "gpio39",
89 +                                              "gpio40", "gpio41", "gpio42",
90 +                                              "gpio43", "gpio44", "gpio45",
91 +                                              "gpio46", "gpio47";
92 +                                       function = "nand";
93 +                                       drive-strength = <10>;
94 +                                       bias-disable;
95 +                               };
96 +                               pullups {
97 +                                       pins = "gpio39";
98 +                                       bias-pull-up;
99 +                               };
100 +                               hold {
101 +                                       pins = "gpio40", "gpio41", "gpio42",
102 +                                              "gpio43", "gpio44", "gpio45",
103 +                                              "gpio46", "gpio47";
104 +                                       bias-bus-hold;
105 +                               };
106 +                       };
107 +
108 +                       mdio0_pins: mdio0_pins {
109 +                               mux {
110 +                                       pins = "gpio0", "gpio1";
111 +                                       function = "gpio";
112 +                                       drive-strength = <8>;
113 +                                       bias-disable;
114 +                               };
115 +                       };
116 +
117 +                       rgmii2_pins: rgmii2_pins {
118 +                               mux {
119 +                                       pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32",
120 +                                              "gpio51", "gpio52", "gpio59", "gpio60", "gpio61", "gpio62" ;
121 +                                       function = "rgmii2";
122 +                                       drive-strength = <8>;
123 +                                       bias-disable;
124 +                               };
125 +                       };
126 +               };
127 +
128 +               gsbi@16300000 {
129 +                       qcom,mode = <GSBI_PROT_I2C_UART>;
130 +                       status = "ok";
131 +                       serial@16340000 {
132 +                               status = "ok";
133 +                       };
134 +                       /*
135 +                        * The i2c device on gsbi4 should not be enabled.
136 +                        * On ipq806x designs gsbi4 i2c is meant for exclusive
137 +                        * RPM usage. Turning this on in kernel manifests as
138 +                        * i2c failure for the RPM.
139 +                        */
140 +               };
141 +
142 +               sata-phy@1b400000 {
143 +                       status = "ok";
144 +               };
145 +
146 +               sata@29000000 {
147 +                       status = "ok";
148 +               };
149 +
150 +               phy@100f8800 {          /* USB3 port 1 HS phy */
151 +                       status = "ok";
152 +               };
153 +
154 +               phy@100f8830 {          /* USB3 port 1 SS phy */
155 +                       status = "ok";
156 +               };
157 +
158 +               phy@110f8800 {          /* USB3 port 0 HS phy */
159 +                       status = "ok";
160 +               };
161 +
162 +               phy@110f8830 {          /* USB3 port 0 SS phy */
163 +                       status = "ok";
164 +               };
165 +
166 +               usb30@0 {
167 +                       status = "ok";
168 +               };
169 +
170 +               usb30@1 {
171 +                       status = "ok";
172 +               };
173 +
174 +               pcie0: pci@1b500000 {
175 +                       status = "ok";
176 +                       reset-gpio = <&qcom_pinmux 3 0>;
177 +                       pinctrl-0 = <&pcie0_pins>;
178 +                       pinctrl-names = "default";
179 +               };
180 +
181 +               pcie1: pci@1b700000 {
182 +                       status = "ok";
183 +                       reset-gpio = <&qcom_pinmux 48 0>;
184 +                       pinctrl-0 = <&pcie1_pins>;
185 +                       pinctrl-names = "default";
186 +               };
187 +
188 +               nand@1ac00000 {
189 +                       status = "ok";
190 +
191 +                       pinctrl-0 = <&nand_pins>;
192 +                       pinctrl-names = "default";
193 +
194 +                       nand-ecc-strength = <4>;
195 +                       nand-bus-width = <8>;
196 +
197 +                       #address-cells = <1>;
198 +                       #size-cells = <1>;
199 +
200 +                       qcadata@0 {
201 +                               label = "qcadata";
202 +                               reg = <0x0000000 0x0c80000>;
203 +                               read-only;
204 +                       };
205 +
206 +                       APPSBL@c80000 {
207 +                               label = "APPSBL";
208 +                               reg = <0x0c80000 0x0500000>;
209 +                               read-only;
210 +                       };
211 +
212 +                       APPSBLENV@1180000 {
213 +                               label = "APPSBLENV";
214 +                               reg = <0x1180000 0x0080000>;
215 +                               read-only;
216 +                       };
217 +
218 +                       art: art@1200000 {
219 +                               label = "art";
220 +                               reg = <0x1200000 0x0140000>;
221 +                               read-only;
222 +                       };
223 +
224 +                       kernel@1340000 {
225 +                               label = "kernel";
226 +                               reg = <0x1340000 0x0200000>;
227 +                       };
228 +
229 +                       ubi@1540000 {
230 +                               label = "ubi";
231 +                               reg = <0x1540000 0x1800000>;
232 +                       };
233 +
234 +                       netgear@2d40000 {
235 +                               label = "netgear";
236 +                               reg = <0x2d40000 0x0c00000>;
237 +                               read-only;
238 +                       };
239 +
240 +                       reserve@3940000 {
241 +                               label = "reserve";
242 +                               reg = <0x3940000 0x46c0000>;
243 +                               read-only;
244 +                       };
245 +
246 +                       firmware@1340000 {
247 +                               label = "firmware";
248 +                               reg = <0x1340000 0x1a00000>;
249 +                       };
250 +
251 +               };
252 +
253 +               mdio0: mdio {
254 +                       compatible = "virtual,mdio-gpio";
255 +                       #address-cells = <1>;
256 +                       #size-cells = <0>;
257 +                       gpios = <&qcom_pinmux 1 0 &qcom_pinmux 0 0>;
258 +                       pinctrl-0 = <&mdio0_pins>;
259 +                       pinctrl-names = "default";
260 +
261 +                       phy0: ethernet-phy@0 {
262 +                               device_type = "ethernet-phy";
263 +                               reg = <0>;
264 +                               qca,ar8327-initvals = <
265 +                                       0x00004 0x7600000   /* PAD0_MODE */
266 +                                       0x00008 0x1000000   /* PAD5_MODE */
267 +                                       0x0000c 0x80        /* PAD6_MODE */
268 +                                       0x000e4 0xaa545     /* MAC_POWER_SEL */
269 +                                       0x000e0 0xc74164de  /* SGMII_CTRL */
270 +                                       0x0007c 0x4e        /* PORT0_STATUS */
271 +                                       0x00094 0x4e        /* PORT6_STATUS */
272 +                                       >;
273 +                       };
274 +
275 +                       phy4: ethernet-phy@4 {
276 +                               device_type = "ethernet-phy";
277 +                               reg = <4>;
278 +                       };
279 +               };
280 +
281 +               gmac1: ethernet@37200000 {
282 +                       status = "ok";
283 +                       phy-mode = "rgmii";
284 +                       phy-handle = <&phy4>;
285 +                       qcom,id = <1>;
286 +
287 +                       pinctrl-0 = <&rgmii2_pins>;
288 +                       pinctrl-names = "default";
289 +
290 +                       mtd-mac-address = <&art 6>;
291 +               };
292 +
293 +               gmac2: ethernet@37400000 {
294 +                       status = "ok";
295 +                       phy-mode = "sgmii";
296 +                       qcom,id = <2>;
297 +
298 +                       mtd-mac-address = <&art 0>;
299 +
300 +                       fixed-link {
301 +                               speed = <1000>;
302 +                               full-duplex;
303 +                       };
304 +               };
305 +       };
306 +
307 +       gpio-keys {
308 +               compatible = "gpio-keys";
309 +
310 +               wifi {
311 +                       label = "wifi";
312 +                       gpios = <&qcom_pinmux 6 1>;
313 +                       linux,code = <KEY_WLAN>;
314 +               };
315 +
316 +               reset {
317 +                       label = "reset";
318 +                       gpios = <&qcom_pinmux 54 1>;
319 +                       linux,code = <KEY_RESTART>;
320 +               };
321 +
322 +               wps {
323 +                       label = "wps";
324 +                       gpios = <&qcom_pinmux 65 1>;
325 +                       linux,code = <KEY_WPS_BUTTON>;
326 +               };
327 +       };
328 +
329 +       gpio-leds {
330 +               compatible = "gpio-leds";
331 +
332 +               usb1 {
333 +                       label = "r7500:amber:usb1";
334 +                       gpios = <&qcom_pinmux 7 0>;
335 +               };
336 +
337 +               usb3 {
338 +                       label = "r7500:amber:usb3";
339 +                       gpios = <&qcom_pinmux 8 0>;
340 +               };
341 +
342 +               status {
343 +                       label = "r7500:amber:status";
344 +                       gpios = <&qcom_pinmux 9 0>;
345 +               };
346 +
347 +               internet {
348 +                       label = "r7500:white:internet";
349 +                       gpios = <&qcom_pinmux 22 0>;
350 +               };
351 +
352 +               wan {
353 +                       label = "r7500:white:wan";
354 +                       gpios = <&qcom_pinmux 23 0>;
355 +               };
356 +
357 +               wps {
358 +                       label = "r7500:white:wps";
359 +                       gpios = <&qcom_pinmux 24 0>;
360 +               };
361 +
362 +               esata {
363 +                       label = "r7500:white:esata";
364 +                       gpios = <&qcom_pinmux 26 0>;
365 +               };
366 +
367 +               power {
368 +                       label = "r7500:white:power";
369 +                       gpios = <&qcom_pinmux 53 0>;
370 +                       default-state = "on";
371 +               };
372 +
373 +               rfkill {
374 +                       label = "r7500:white:rfkill";
375 +                       gpios = <&qcom_pinmux 64 0>;
376 +               };
377 +
378 +               wifi5g {
379 +                       label = "r7500:white:wifi5g";
380 +                       gpios = <&qcom_pinmux 67 0>;
381 +               };
382 +       };
383 +};
384 +
385 +&adm_dma {
386 +       status = "ok";
387 +};