8952f3339d9c0d4ee169a187fe511a524fa53018
[openwrt/openwrt.git] / target / linux / ipq806x / patches-4.4 / 802-ARM-qcom-add-TPLink-C2600-device-tree.patch
1 --- a/arch/arm/boot/dts/Makefile
2 +++ b/arch/arm/boot/dts/Makefile
3 @@ -506,6 +506,7 @@
4 qcom-apq8084-ifc6540.dtb \
5 qcom-apq8084-mtp.dtb \
6 qcom-ipq8064-ap148.dtb \
7 + qcom-ipq8064-c2600.dtb \
8 qcom-ipq8064-db149.dtb \
9 qcom-ipq8064-r7500.dtb \
10 qcom-ipq8064-d7800.dtb \
11 --- /dev/null
12 +++ b/arch/arm/boot/dts/qcom-ipq8064-c2600.dts
13 @@ -0,0 +1,412 @@
14 +#include "qcom-ipq8064-v1.0.dtsi"
15 +#include <dt-bindings/input/input.h>
16 +
17 +/ {
18 + model = "TP-Link Archer C2600";
19 + compatible = "tplink,c2600", "qcom,ipq8064";
20 +
21 + memory@0 {
22 + reg = <0x42000000 0x1e000000>;
23 + device_type = "memory";
24 + };
25 +
26 + reserved-memory {
27 + #address-cells = <1>;
28 + #size-cells = <1>;
29 + ranges;
30 + rsvd@41200000 {
31 + reg = <0x41200000 0x300000>;
32 + no-map;
33 + };
34 + };
35 +
36 + aliases {
37 + serial0 = &uart4;
38 + mdio-gpio0 = &mdio0;
39 + };
40 +
41 + chosen {
42 + linux,stdout-path = "serial0:115200n8";
43 + };
44 +
45 + soc {
46 + pinmux@800000 {
47 + i2c4_pins: i2c4_pinmux {
48 + pins = "gpio12", "gpio13";
49 + function = "gsbi4";
50 + bias-disable;
51 + };
52 +
53 + spi_pins: spi_pins {
54 + mux {
55 + pins = "gpio18", "gpio19", "gpio21";
56 + function = "gsbi5";
57 + drive-strength = <10>;
58 + bias-none;
59 + };
60 + };
61 +
62 + nand_pins: nand_pins {
63 + mux {
64 + pins = "gpio34", "gpio35", "gpio36",
65 + "gpio37", "gpio38", "gpio39",
66 + "gpio40", "gpio41", "gpio42",
67 + "gpio43", "gpio44", "gpio45",
68 + "gpio46", "gpio47";
69 + function = "nand";
70 + drive-strength = <10>;
71 + bias-disable;
72 + };
73 +
74 + pullups {
75 + pins = "gpio39";
76 + bias-pull-up;
77 + };
78 +
79 + hold {
80 + pins = "gpio40", "gpio41", "gpio42",
81 + "gpio43", "gpio44", "gpio45",
82 + "gpio46", "gpio47";
83 + bias-bus-hold;
84 + };
85 + };
86 +
87 + mdio0_pins: mdio0_pins {
88 + mux {
89 + pins = "gpio0", "gpio1";
90 + function = "gpio";
91 + drive-strength = <8>;
92 + bias-disable;
93 + };
94 + };
95 +
96 + rgmii2_pins: rgmii2_pins {
97 + mux {
98 + pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32",
99 + "gpio51", "gpio52", "gpio59", "gpio60", "gpio61", "gpio62" ;
100 + function = "rgmii2";
101 + drive-strength = <8>;
102 + bias-disable;
103 + };
104 + };
105 + };
106 +
107 + gsbi@16300000 {
108 + qcom,mode = <GSBI_PROT_I2C_UART>;
109 + status = "ok";
110 + serial@16340000 {
111 + status = "ok";
112 + };
113 + /*
114 + * The i2c device on gsbi4 should not be enabled.
115 + * On ipq806x designs gsbi4 i2c is meant for exclusive
116 + * RPM usage. Turning this on in kernel manifests as
117 + * i2c failure for the RPM.
118 + */
119 + };
120 +
121 + gsbi5: gsbi@1a200000 {
122 + qcom,mode = <GSBI_PROT_SPI>;
123 + status = "ok";
124 +
125 + spi4: spi@1a280000 {
126 + status = "ok";
127 + spi-max-frequency = <50000000>;
128 +
129 + pinctrl-0 = <&spi_pins>;
130 + pinctrl-names = "default";
131 +
132 + cs-gpios = <&qcom_pinmux 20 0>;
133 +
134 + flash: m25p80@0 {
135 + compatible = "s25fl256s1";
136 + #address-cells = <1>;
137 + #size-cells = <1>;
138 + spi-max-frequency = <50000000>;
139 + reg = <0>;
140 +
141 + SBL1@0 {
142 + label = "SBL1";
143 + reg = <0x0 0x20000>;
144 + read-only;
145 + };
146 + MIBIB@20000 {
147 + label = "MIBIB";
148 + reg = <0x20000 0x20000>;
149 + read-only;
150 + };
151 + SBL2@40000 {
152 + label = "SBL2";
153 + reg = <0x40000 0x20000>;
154 + read-only;
155 + };
156 + SBL3@60000 {
157 + label = "SBL3";
158 + reg = <0x60000 0x30000>;
159 + read-only;
160 + };
161 + DDRCONFIG@90000 {
162 + label = "DDRCONFIG";
163 + reg = <0x90000 0x10000>;
164 + read-only;
165 + };
166 + SSD@a0000 {
167 + label = "SSD";
168 + reg = <0xa0000 0x10000>;
169 + read-only;
170 + };
171 + TZ@b0000 {
172 + label = "TZ";
173 + reg = <0xb0000 0x30000>;
174 + read-only;
175 + };
176 + RPM@e0000 {
177 + label = "RPM";
178 + reg = <0xe0000 0x20000>;
179 + read-only;
180 + };
181 + fs-uboot@100000 {
182 + label = "fs-uboot";
183 + reg = <0x100000 0x70000>;
184 + read-only;
185 + };
186 + uboot-env@170000 {
187 + label = "uboot-env";
188 + reg = <0x170000 0x40000>;
189 + read-only;
190 + };
191 + radio@1b0000 {
192 + label = "radio";
193 + reg = <0x1b0000 0x40000>;
194 + read-only;
195 + };
196 + os-image@1f0000 {
197 + label = "os-image";
198 + reg = <0x1f0000 0x200000>;
199 + };
200 + rootfs@3f0000 {
201 + label = "rootfs";
202 + reg = <0x3f0000 0x1b00000>;
203 + };
204 + defaultmac: default-mac@1ef0000 {
205 + label = "default-mac";
206 + reg = <0x1ef0000 0x00200>;
207 + read-only;
208 + };
209 + pin@1ef0200 {
210 + label = "pin";
211 + reg = <0x1ef0200 0x00200>;
212 + read-only;
213 + };
214 + product-info@1ef0400 {
215 + label = "product-info";
216 + reg = <0x1ef0400 0x0fc00>;
217 + read-only;
218 + };
219 + partition-table@1f00000 {
220 + label = "partition-table";
221 + reg = <0x1f00000 0x10000>;
222 + read-only;
223 + };
224 + soft-version@1f10000 {
225 + label = "soft-version";
226 + reg = <0x1f10000 0x10000>;
227 + read-only;
228 + };
229 + support-list@1f20000 {
230 + label = "support-list";
231 + reg = <0x1f20000 0x10000>;
232 + read-only;
233 + };
234 + profile@1f30000 {
235 + label = "profile";
236 + reg = <0x1f30000 0x10000>;
237 + read-only;
238 + };
239 + default-config@1f40000 {
240 + label = "default-config";
241 + reg = <0x1f40000 0x10000>;
242 + read-only;
243 + };
244 + user-config@1f50000 {
245 + label = "user-config";
246 + reg = <0x1f50000 0x40000>;
247 + read-only;
248 + };
249 + qos-db@1f90000 {
250 + label = "qos-db";
251 + reg = <0x1f90000 0x40000>;
252 + read-only;
253 + };
254 + usb-config@1fd0000 {
255 + label = "usb-config";
256 + reg = <0x1fd0000 0x10000>;
257 + read-only;
258 + };
259 + log@1fe0000 {
260 + label = "log";
261 + reg = <0x1fe0000 0x20000>;
262 + read-only;
263 + };
264 + };
265 + };
266 + };
267 +
268 + phy@100f8800 { /* USB3 port 1 HS phy */
269 + status = "ok";
270 + };
271 +
272 + phy@100f8830 { /* USB3 port 1 SS phy */
273 + status = "ok";
274 + };
275 +
276 + phy@110f8800 { /* USB3 port 0 HS phy */
277 + status = "ok";
278 + };
279 +
280 + phy@110f8830 { /* USB3 port 0 SS phy */
281 + status = "ok";
282 + };
283 +
284 + usb30@0 {
285 + status = "ok";
286 + };
287 +
288 + usb30@1 {
289 + status = "ok";
290 + };
291 +
292 + pcie0: pci@1b500000 {
293 + status = "ok";
294 + phy-tx0-term-offset = <7>;
295 + };
296 +
297 + pcie1: pci@1b700000 {
298 + status = "ok";
299 + phy-tx0-term-offset = <7>;
300 + };
301 +
302 + mdio0: mdio {
303 + compatible = "virtual,mdio-gpio";
304 + #address-cells = <1>;
305 + #size-cells = <0>;
306 + gpios = <&qcom_pinmux 1 0 &qcom_pinmux 0 0>;
307 + pinctrl-0 = <&mdio0_pins>;
308 + pinctrl-names = "default";
309 +
310 + phy0: ethernet-phy@0 {
311 + device_type = "ethernet-phy";
312 + reg = <0>;
313 + qca,ar8327-initvals = <
314 + 0x00004 0x7600000 /* PAD0_MODE */
315 + 0x00008 0x1000000 /* PAD5_MODE */
316 + 0x0000c 0x80 /* PAD6_MODE */
317 + 0x000e4 0xaa545 /* MAC_POWER_SEL */
318 + 0x000e0 0xc74164de /* SGMII_CTRL */
319 + 0x0007c 0x4e /* PORT0_STATUS */
320 + 0x00094 0x4e /* PORT6_STATUS */
321 + >;
322 + };
323 +
324 + phy4: ethernet-phy@4 {
325 + device_type = "ethernet-phy";
326 + reg = <4>;
327 + };
328 + };
329 +
330 + gmac1: ethernet@37200000 {
331 + status = "ok";
332 + phy-mode = "rgmii";
333 + qcom,id = <1>;
334 +
335 + pinctrl-0 = <&rgmii2_pins>;
336 + pinctrl-names = "default";
337 +
338 + mtd-mac-address = <&defaultmac 0x8>;
339 + mtd-mac-address-increment = <1>;
340 +
341 + fixed-link {
342 + speed = <1000>;
343 + full-duplex;
344 + };
345 + };
346 +
347 + gmac2: ethernet@37400000 {
348 + status = "ok";
349 + phy-mode = "sgmii";
350 + qcom,id = <2>;
351 +
352 + mtd-mac-address = <&defaultmac 0x8>;
353 +
354 + fixed-link {
355 + speed = <1000>;
356 + full-duplex;
357 + };
358 + };
359 + };
360 +
361 + gpio-keys {
362 + compatible = "gpio-keys";
363 +
364 + wifi {
365 + label = "wifi";
366 + gpios = <&qcom_pinmux 49 1>;
367 + linux,code = <KEY_WLAN>;
368 + };
369 +
370 + reset {
371 + label = "reset";
372 + gpios = <&qcom_pinmux 64 1>;
373 + linux,code = <KEY_RESTART>;
374 + };
375 +
376 + wps {
377 + label = "wps";
378 + gpios = <&qcom_pinmux 65 1>;
379 + linux,code = <KEY_WPS_BUTTON>;
380 + };
381 + ledgeneral {
382 + label = "ledgeneral";
383 + gpios = <&qcom_pinmux 16 1>;
384 + linux,code = <KEY_DOLLAR>;
385 + };
386 + };
387 +
388 + gpio-leds {
389 + compatible = "gpio-leds";
390 +
391 + lan {
392 + label = "lan:blue";
393 + gpios = <&qcom_pinmux 6 0>;
394 + };
395 + usb4 {
396 + label = "usb_4:blue";
397 + gpios = <&qcom_pinmux 7 0>;
398 + };
399 + usb2 {
400 + label = "usb_2:blue";
401 + gpios = <&qcom_pinmux 8 0>;
402 + };
403 + wps {
404 + label = "wps:blue";
405 + gpios = <&qcom_pinmux 9 0>;
406 + };
407 + wan_blue {
408 + label = "wan:blue";
409 + gpios = <&qcom_pinmux 33 1>;
410 + };
411 + status {
412 + label = "status:blue";
413 + gpios = <&qcom_pinmux 53 0>;
414 + default-state = "on";
415 + };
416 + ledgnr {
417 + label = "ledgnr:blue";
418 + gpios = <&qcom_pinmux 66 0>;
419 + };
420 + };
421 +};
422 +
423 +&adm_dma {
424 + status = "ok";
425 +};