e36f9e3c5a7ef6b540461e1957af1cccca6ca7e4
[openwrt/openwrt.git] / package / boot / uboot-sunxi / patches / 011-dt-sync-dts-files-with-kernel.patch
1 From 80e5f83c0fc4bf42110cc55ce671ad7ddc7b08a4 Mon Sep 17 00:00:00 2001
2 From: Hans de Goede <hdegoede@redhat.com>
3 Date: Mon, 14 Mar 2016 17:37:09 +0100
4 Subject: [PATCH] sunxi: Sync dts files with the upstream kernel
5
6 Sync dts files with the upstream kernel including
7 changes queued for 4.6:
8
9 https://git.kernel.org/cgit/linux/kernel/git/mripard/linux.git/commit/?h=sunxi/dt-for-4.6
10
11 Note this adds a number of new unused board dts files. I've asked the
12 authors of the kernel commits adding these to submit a matching defconfig
13 to u-boot.
14
15 Signed-off-by: Hans de Goede <hdegoede@redhat.com>
16 Acked-by: Ian Campbell <ijc@hellion.org.uk>
17 ---
18 arch/arm/dts/Makefile | 8 +-
19 arch/arm/dts/axp22x.dtsi | 145 ++++++++++++
20 arch/arm/dts/sun4i-a10-a1000.dts | 4 +
21 arch/arm/dts/sun4i-a10-chuwi-v7-cw0825.dts | 22 ++
22 arch/arm/dts/sun4i-a10-cubieboard.dts | 4 +
23 arch/arm/dts/sun4i-a10-gemei-g9.dts | 63 +++++-
24 arch/arm/dts/sun4i-a10-inet1.dts | 48 ++++
25 arch/arm/dts/sun4i-a10-inet97fv2.dts | 127 ++++++++++-
26 arch/arm/dts/sun4i-a10-inet9f-rev03.dts | 181 +++++++++++++++
27 arch/arm/dts/sun4i-a10-itead-iteaduino-plus.dts | 86 +------
28 arch/arm/dts/sun4i-a10-jesurun-q5.dts | 15 ++
29 arch/arm/dts/sun4i-a10-marsboard.dts | 23 ++
30 arch/arm/dts/sun4i-a10-mk802.dts | 37 +++
31 arch/arm/dts/sun4i-a10-olinuxino-lime.dts | 12 +
32 arch/arm/dts/sun4i-a10-pcduino.dts | 58 ++++-
33 arch/arm/dts/sun4i-a10-pcduino2.dts | 78 +++++++
34 arch/arm/dts/sun4i-a10-pov-protab2-ips9.dts | 69 ++++++
35 arch/arm/dts/sun4i-a10.dtsi | 153 +++++++++++--
36 arch/arm/dts/sun5i-a10s-auxtek-t004.dts | 14 ++
37 arch/arm/dts/sun5i-a10s-olinuxino-micro.dts | 2 +-
38 arch/arm/dts/sun5i-a13-empire-electronix-d709.dts | 19 +-
39 arch/arm/dts/sun5i-a13-inet-98v-rev2.dts | 26 +--
40 arch/arm/dts/sun5i-a13-utoo-p66.dts | 30 +++
41 arch/arm/dts/sun5i-q8-common.dtsi | 10 +
42 arch/arm/dts/sun5i-r8-chip.dts | 47 +++-
43 arch/arm/dts/sun5i.dtsi | 31 +++
44 arch/arm/dts/sun6i-a31-colombus.dts | 24 ++
45 arch/arm/dts/sun6i-a31-hummingbird.dts | 132 ++++++-----
46 arch/arm/dts/sun6i-a31.dtsi | 65 +++++-
47 arch/arm/dts/sun6i-a31s-primo81.dts | 247 ++++++++++++++++++++-
48 arch/arm/dts/sun6i-a31s-sina31s-core.dtsi | 142 ++++++++++++
49 arch/arm/dts/sun6i-a31s-sina31s.dts | 153 +++++++++++++
50 .../arm/dts/sun6i-a31s-yones-toptech-bs1078-v2.dts | 205 +++++++++++++++++
51 arch/arm/dts/sun7i-a20-bananapi.dts | 78 ++++++-
52 arch/arm/dts/sun7i-a20-cubieboard2.dts | 23 ++
53 arch/arm/dts/sun7i-a20-cubietruck.dts | 4 +
54 arch/arm/dts/sun7i-a20-icnova-swac.dts | 169 ++++++++++++++
55 arch/arm/dts/sun7i-a20-itead-ibox.dts | 125 +++++++++++
56 arch/arm/dts/sun7i-a20-lamobo-r1.dts | 10 -
57 arch/arm/dts/sun7i-a20-mk808c.dts | 39 ++++
58 arch/arm/dts/sun7i-a20-olimex-som-evb.dts | 95 ++++++--
59 arch/arm/dts/sun7i-a20-olinuxino-lime.dts | 12 +
60 arch/arm/dts/sun7i-a20-olinuxino-lime2.dts | 47 ++++
61 arch/arm/dts/sun7i-a20-olinuxino-micro.dts | 6 +
62 arch/arm/dts/sun7i-a20-orangepi-mini.dts | 33 +++
63 arch/arm/dts/sun7i-a20-orangepi.dts | 29 +++
64 arch/arm/dts/sun7i-a20-pcduino3-nano.dts | 69 +++++-
65 arch/arm/dts/sun7i-a20-pcduino3.dts | 58 ++++-
66 arch/arm/dts/sun7i-a20-wexler-tab7200.dts | 90 +++++++-
67 arch/arm/dts/sun7i-a20-wits-pro-a20-dkt.dts | 187 +++++++++++++++-
68 arch/arm/dts/sun7i-a20.dtsi | 113 +++++++++-
69 arch/arm/dts/sun8i-a23-a33.dtsi | 71 ++++--
70 arch/arm/dts/sun8i-a23-gt90h-v4.dts | 120 +++++++++-
71 arch/arm/dts/sun8i-a23.dtsi | 25 +++
72 arch/arm/dts/sun8i-a33-sinlinx-sina33.dts | 83 ++++++-
73 arch/arm/dts/sun8i-a33.dtsi | 45 ++++
74 arch/arm/dts/sun8i-a83t-cubietruck-plus.dts | 65 ++++++
75 arch/arm/dts/sun8i-a83t.dtsi | 125 +++++------
76 arch/arm/dts/sun8i-h3-orangepi-pc.dts | 69 ++++++
77 arch/arm/dts/sun8i-h3-orangepi-plus.dts | 63 ++++++
78 arch/arm/dts/sun8i-h3.dtsi | 189 +++++++++++-----
79 arch/arm/dts/sun8i-q8-common.dtsi | 96 +++++++-
80 arch/arm/dts/sun9i-a80-cubieboard4.dts | 36 +++
81 arch/arm/dts/sun9i-a80-optimus.dts | 48 ++--
82 arch/arm/dts/sun9i-a80.dtsi | 204 +++++++++++++++--
83 arch/arm/dts/sunxi-itead-core-common.dtsi | 136 ++++++++++++
84 arch/arm/dts/sunxi-q8-common.dtsi | 6 +
85 67 files changed, 4351 insertions(+), 497 deletions(-)
86 create mode 100644 arch/arm/dts/axp22x.dtsi
87 create mode 100644 arch/arm/dts/sun4i-a10-pcduino2.dts
88 create mode 100644 arch/arm/dts/sun6i-a31s-sina31s-core.dtsi
89 create mode 100644 arch/arm/dts/sun6i-a31s-sina31s.dts
90 create mode 100644 arch/arm/dts/sun6i-a31s-yones-toptech-bs1078-v2.dts
91 create mode 100644 arch/arm/dts/sun7i-a20-icnova-swac.dts
92 create mode 100644 arch/arm/dts/sun7i-a20-itead-ibox.dts
93 create mode 100644 arch/arm/dts/sun8i-a83t-cubietruck-plus.dts
94 create mode 100644 arch/arm/dts/sunxi-itead-core-common.dtsi
95
96 --- a/arch/arm/dts/Makefile
97 +++ b/arch/arm/dts/Makefile
98 @@ -126,6 +126,7 @@ dtb-$(CONFIG_MACH_SUN4I) += \
99 sun4i-a10-mk802ii.dtb \
100 sun4i-a10-olinuxino-lime.dtb \
101 sun4i-a10-pcduino.dtb \
102 + sun4i-a10-pcduino2.dtb \
103 sun4i-a10-pov-protab2-ips9.dtb
104 dtb-$(CONFIG_MACH_SUN5I) += \
105 sun5i-a10s-auxtek-t003.dtb \
106 @@ -155,7 +156,9 @@ dtb-$(CONFIG_MACH_SUN6I) += \
107 sun6i-a31-pangolin.dtb \
108 sun6i-a31s-cs908.dtb \
109 sun6i-a31s-primo81.dtb \
110 - sun6i-a31s-sinovoip-bpi-m2.dtb
111 + sun6i-a31s-sina31s.dtb \
112 + sun6i-a31s-sinovoip-bpi-m2.dtb \
113 + sun6i-a31s-yones-toptech-bs1078-v2.dtb
114 dtb-$(CONFIG_MACH_SUN7I) += \
115 sun7i-a20-ainol-aw1.dtb \
116 sun7i-a20-bananapi.dtb \
117 @@ -164,6 +167,8 @@ dtb-$(CONFIG_MACH_SUN7I) += \
118 sun7i-a20-cubietruck.dtb \
119 sun7i-a20-hummingbird.dtb \
120 sun7i-a20-i12-tvbox.dtb \
121 + sun7i-a20-icnova-swac.dtb \
122 + sun7i-a20-itead-ibox.dtb \
123 sun7i-a20-lamobo-r1.dtb \
124 sun7i-a20-m3.dtb \
125 sun7i-a20-m5.dtb \
126 @@ -190,6 +195,7 @@ dtb-$(CONFIG_MACH_SUN8I_A33) += \
127 sun8i-a33-sinlinx-sina33.dtb
128 dtb-$(CONFIG_MACH_SUN8I_A83T) += \
129 sun8i-a83t-allwinner-h8homlet-v2.dtb \
130 + sun8i-a83t-cubietruck-plus.dtb \
131 sun8i-a83t-sinovoip-bpi-m3.dtb
132 dtb-$(CONFIG_MACH_SUN8I_H3) += \
133 sun8i-h3-orangepi-pc.dtb \
134 --- /dev/null
135 +++ b/arch/arm/dts/axp22x.dtsi
136 @@ -0,0 +1,145 @@
137 +/*
138 + * Copyright 2015 Chen-Yu Tsai
139 + *
140 + * Chen-Yu Tsai <wens@csie.org>
141 + *
142 + * This file is dual-licensed: you can use it either under the terms
143 + * of the GPL or the X11 license, at your option. Note that this dual
144 + * licensing only applies to this file, and not this project as a
145 + * whole.
146 + *
147 + * a) This file is free software; you can redistribute it and/or
148 + * modify it under the terms of the GNU General Public License as
149 + * published by the Free Software Foundation; either version 2 of the
150 + * License, or (at your option) any later version.
151 + *
152 + * This file is distributed in the hope that it will be useful,
153 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
154 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
155 + * GNU General Public License for more details.
156 + *
157 + * Or, alternatively,
158 + *
159 + * b) Permission is hereby granted, free of charge, to any person
160 + * obtaining a copy of this software and associated documentation
161 + * files (the "Software"), to deal in the Software without
162 + * restriction, including without limitation the rights to use,
163 + * copy, modify, merge, publish, distribute, sublicense, and/or
164 + * sell copies of the Software, and to permit persons to whom the
165 + * Software is furnished to do so, subject to the following
166 + * conditions:
167 + *
168 + * The above copyright notice and this permission notice shall be
169 + * included in all copies or substantial portions of the Software.
170 + *
171 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
172 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
173 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
174 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
175 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
176 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
177 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
178 + * OTHER DEALINGS IN THE SOFTWARE.
179 + */
180 +
181 +/*
182 + * AXP221/221s/223 Integrated Power Management Chip
183 + * http://www.x-powers.com/product/AXP22X.php
184 + * http://dl.linux-sunxi.org/AXP/AXP221%20Datasheet%20V1.2%2020130326%20.pdf
185 + */
186 +
187 +&axp22x {
188 + interrupt-controller;
189 + #interrupt-cells = <1>;
190 +
191 + regulators {
192 + /* Default work frequency for buck regulators */
193 + x-powers,dcdc-freq = <3000>;
194 +
195 + reg_dcdc1: dcdc1 {
196 + regulator-name = "dcdc1";
197 + };
198 +
199 + reg_dcdc2: dcdc2 {
200 + regulator-name = "dcdc2";
201 + };
202 +
203 + reg_dcdc3: dcdc3 {
204 + regulator-name = "dcdc3";
205 + };
206 +
207 + reg_dcdc4: dcdc4 {
208 + regulator-name = "dcdc4";
209 + };
210 +
211 + reg_dcdc5: dcdc5 {
212 + regulator-name = "dcdc5";
213 + };
214 +
215 + reg_dc1sw: dc1sw {
216 + regulator-name = "dc1sw";
217 + };
218 +
219 + reg_dc5ldo: dc5ldo {
220 + regulator-name = "dc5ldo";
221 + };
222 +
223 + reg_aldo1: aldo1 {
224 + regulator-name = "aldo1";
225 + };
226 +
227 + reg_aldo2: aldo2 {
228 + regulator-name = "aldo2";
229 + };
230 +
231 + reg_aldo3: aldo3 {
232 + regulator-name = "aldo3";
233 + };
234 +
235 + reg_dldo1: dldo1 {
236 + regulator-name = "dldo1";
237 + };
238 +
239 + reg_dldo2: dldo2 {
240 + regulator-name = "dldo2";
241 + };
242 +
243 + reg_dldo3: dldo3 {
244 + regulator-name = "dldo3";
245 + };
246 +
247 + reg_dldo4: dldo4 {
248 + regulator-name = "dldo4";
249 + };
250 +
251 + reg_eldo1: eldo1 {
252 + regulator-name = "eldo1";
253 + };
254 +
255 + reg_eldo2: eldo2 {
256 + regulator-name = "eldo2";
257 + };
258 +
259 + reg_eldo3: eldo3 {
260 + regulator-name = "eldo3";
261 + };
262 +
263 + reg_ldo_io0: ldo_io0 {
264 + regulator-name = "ldo_io0";
265 + status = "disabled";
266 + };
267 +
268 + reg_ldo_io1: ldo_io1 {
269 + regulator-name = "ldo_io1";
270 + status = "disabled";
271 + };
272 +
273 + reg_rtc_ldo: rtc_ldo {
274 + /* RTC_LDO is a fixed, always-on regulator */
275 + regulator-always-on;
276 + regulator-min-microvolt = <3000000>;
277 + regulator-max-microvolt = <3000000>;
278 + regulator-name = "rtc_ldo";
279 + };
280 + };
281 +};
282 --- a/arch/arm/dts/sun4i-a10-a1000.dts
283 +++ b/arch/arm/dts/sun4i-a10-a1000.dts
284 @@ -93,6 +93,10 @@
285 status = "okay";
286 };
287
288 +&codec {
289 + status = "okay";
290 +};
291 +
292 &ehci0 {
293 status = "okay";
294 };
295 --- a/arch/arm/dts/sun4i-a10-chuwi-v7-cw0825.dts
296 +++ b/arch/arm/dts/sun4i-a10-chuwi-v7-cw0825.dts
297 @@ -45,6 +45,7 @@
298 #include "sunxi-common-regulators.dtsi"
299 #include <dt-bindings/gpio/gpio.h>
300 #include <dt-bindings/input/input.h>
301 +#include <dt-bindings/interrupt-controller/irq.h>
302
303 / {
304 model = "Chuwi V7 CW0825";
305 @@ -78,6 +79,27 @@
306 };
307 };
308
309 +&i2c1 {
310 + pinctrl-names = "default";
311 + pinctrl-0 = <&i2c1_pins_a>;
312 + status = "okay";
313 +};
314 +
315 +&i2c2 {
316 + pinctrl-names = "default";
317 + pinctrl-0 = <&i2c2_pins_a>;
318 + status = "okay";
319 +
320 + ft5306de4: touchscreen@38 {
321 + compatible = "edt,edt-ft5406";
322 + reg = <0x38>;
323 + interrupt-parent = <&pio>;
324 + interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>;
325 + touchscreen-size-x = <1024>;
326 + touchscreen-size-y = <768>;
327 + };
328 +};
329 +
330 &lradc {
331 vref-supply = <&reg_vcc3v0>;
332 status = "okay";
333 --- a/arch/arm/dts/sun4i-a10-cubieboard.dts
334 +++ b/arch/arm/dts/sun4i-a10-cubieboard.dts
335 @@ -83,6 +83,10 @@
336 status = "okay";
337 };
338
339 +&codec {
340 + status = "okay";
341 +};
342 +
343 &cpu0 {
344 cpu-supply = <&reg_dcdc2>;
345 };
346 --- a/arch/arm/dts/sun4i-a10-gemei-g9.dts
347 +++ b/arch/arm/dts/sun4i-a10-gemei-g9.dts
348 @@ -47,6 +47,7 @@
349 #include "sunxi-common-regulators.dtsi"
350 #include <dt-bindings/gpio/gpio.h>
351 #include <dt-bindings/input/input.h>
352 +#include <dt-bindings/interrupt-controller/irq.h>
353
354 / {
355 model = "Gemei G9 Tablet";
356 @@ -64,12 +65,22 @@
357 /*
358 * TODO:
359 * 2x cameras via CSI
360 - * bma250 IRQs
361 * AXP battery management
362 * NAND
363 * OTG
364 * Touchscreen - gt801_2plus1 @ i2c adapter 2 @ 0x48
365 */
366 +&codec {
367 + /* PH15 controls power to external amplifier (ft2012q) */
368 + pinctrl-names = "default";
369 + pinctrl-0 = <&codec_pa_pin>;
370 + allwinner,pa-gpios = <&pio 7 15 GPIO_ACTIVE_HIGH>;
371 + status = "okay";
372 +};
373 +
374 +&cpu0 {
375 + cpu-supply = <&reg_dcdc2>;
376 +};
377
378 &ehci0 {
379 status = "okay";
380 @@ -85,15 +96,13 @@
381 status = "okay";
382
383 axp209: pmic@34 {
384 - compatible = "x-powers,axp209";
385 reg = <0x34>;
386 interrupts = <0>;
387 -
388 - interrupt-controller;
389 - #interrupt-cells = <1>;
390 };
391 };
392
393 +#include "axp209.dtsi"
394 +
395 &i2c1 {
396 pinctrl-names = "default";
397 pinctrl-0 = <&i2c1_pins_a>;
398 @@ -103,17 +112,13 @@
399 bma250@18 {
400 compatible = "bosch,bma250";
401 reg = <0x18>;
402 -
403 - /*
404 - * TODO: interrupt pins:
405 - * int1 - PH00
406 - * int2 - PI10
407 - */
408 + interrupt-parent = <&pio>;
409 + interrupts = <7 0 IRQ_TYPE_EDGE_RISING>; /* PH00 / EINT0 */
410 };
411 };
412
413 &lradc {
414 - vref-supply = <&reg_vcc3v0>;
415 + vref-supply = <&reg_ldo2>;
416
417 status = "okay";
418
419 @@ -149,6 +154,40 @@
420 status = "okay";
421 };
422
423 +&pio {
424 + codec_pa_pin: codec_pa_pin@0 {
425 + allwinner,pins = "PH15";
426 + allwinner,function = "gpio_out";
427 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
428 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
429 + };
430 +};
431 +
432 +&reg_dcdc2 {
433 + regulator-always-on;
434 + regulator-min-microvolt = <1000000>;
435 + regulator-max-microvolt = <1400000>;
436 + regulator-name = "vdd-cpu";
437 +};
438 +
439 +&reg_dcdc3 {
440 + regulator-always-on;
441 + regulator-min-microvolt = <1250000>;
442 + regulator-max-microvolt = <1250000>;
443 + regulator-name = "vdd-int-dll";
444 +};
445 +
446 +&reg_ldo1 {
447 + regulator-name = "vdd-rtc";
448 +};
449 +
450 +&reg_ldo2 {
451 + regulator-always-on;
452 + regulator-min-microvolt = <3000000>;
453 + regulator-max-microvolt = <3000000>;
454 + regulator-name = "avcc";
455 +};
456 +
457 &reg_usb1_vbus {
458 status = "okay";
459 };
460 --- a/arch/arm/dts/sun4i-a10-inet1.dts
461 +++ b/arch/arm/dts/sun4i-a10-inet1.dts
462 @@ -47,6 +47,7 @@
463 #include <dt-bindings/input/input.h>
464 #include <dt-bindings/interrupt-controller/irq.h>
465 #include <dt-bindings/pinctrl/sun4i-a10.h>
466 +#include <dt-bindings/pwm/pwm.h>
467
468 / {
469 model = "iNet-1";
470 @@ -56,11 +57,25 @@
471 serial0 = &uart0;
472 };
473
474 + backlight: backlight {
475 + compatible = "pwm-backlight";
476 + pinctrl-names = "default";
477 + pinctrl-0 = <&bl_en_pin_inet>;
478 + pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
479 + brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
480 + default-brightness-level = <8>;
481 + enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */
482 + };
483 +
484 chosen {
485 stdout-path = "serial0:115200n8";
486 };
487 };
488
489 +&codec {
490 + status = "okay";
491 +};
492 +
493 &cpu0 {
494 cpu-supply = <&reg_dcdc2>;
495 };
496 @@ -104,6 +119,19 @@
497 pinctrl-names = "default";
498 pinctrl-0 = <&i2c2_pins_a>;
499 status = "okay";
500 +
501 + ft5x: touchscreen@38 {
502 + compatible = "edt,edt-ft5406";
503 + reg = <0x38>;
504 + interrupt-parent = <&pio>;
505 + interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>;
506 + pinctrl-names = "default";
507 + pinctrl-0 = <&touchscreen_wake_pin>;
508 + wake-gpios = <&pio 1 13 GPIO_ACTIVE_HIGH>; /* PB13 */
509 + touchscreen-size-x = <600>;
510 + touchscreen-size-y = <1024>;
511 + touchscreen-swapped-x-y;
512 + };
513 };
514
515 &lradc {
516 @@ -151,6 +179,20 @@
517 };
518
519 &pio {
520 + bl_en_pin_inet: bl_en_pin@0 {
521 + allwinner,pins = "PH7";
522 + allwinner,function = "gpio_out";
523 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
524 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
525 + };
526 +
527 + touchscreen_wake_pin: touchscreen_wake_pin@0 {
528 + allwinner,pins = "PB13";
529 + allwinner,function = "gpio_out";
530 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
531 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
532 + };
533 +
534 usb0_id_detect_pin: usb0_id_detect_pin@0 {
535 allwinner,pins = "PH4";
536 allwinner,function = "gpio_in";
537 @@ -166,6 +208,12 @@
538 };
539 };
540
541 +&pwm {
542 + pinctrl-names = "default";
543 + pinctrl-0 = <&pwm0_pins_a>;
544 + status = "okay";
545 +};
546 +
547 &reg_dcdc2 {
548 regulator-always-on;
549 regulator-min-microvolt = <1000000>;
550 --- a/arch/arm/dts/sun4i-a10-inet97fv2.dts
551 +++ b/arch/arm/dts/sun4i-a10-inet97fv2.dts
552 @@ -47,6 +47,8 @@
553 #include "sunxi-common-regulators.dtsi"
554
555 #include <dt-bindings/gpio/gpio.h>
556 +#include <dt-bindings/input/input.h>
557 +#include <dt-bindings/interrupt-controller/irq.h>
558
559 / {
560 model = "INet-97F Rev 02";
561 @@ -61,8 +63,8 @@
562 };
563 };
564
565 -&ehci0 {
566 - status = "okay";
567 +&cpu0 {
568 + cpu-supply = <&reg_dcdc2>;
569 };
570
571 &ehci1 {
572 @@ -75,12 +77,71 @@
573 status = "okay";
574
575 axp209: pmic@34 {
576 - compatible = "x-powers,axp209";
577 reg = <0x34>;
578 interrupts = <0>;
579 + };
580 +};
581 +
582 +#include "axp209.dtsi"
583 +
584 +&i2c1 {
585 + pinctrl-names = "default";
586 + pinctrl-0 = <&i2c1_pins_a>;
587 + status = "okay";
588 +};
589 +
590 +&i2c2 {
591 + pinctrl-names = "default";
592 + pinctrl-0 = <&i2c2_pins_a>;
593 + status = "okay";
594 +
595 + ft5406ee8: touchscreen@38 {
596 + compatible = "edt,edt-ft5406";
597 + reg = <0x38>;
598 + interrupt-parent = <&pio>;
599 + interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>;
600 + touchscreen-size-x = <800>;
601 + touchscreen-size-y = <480>;
602 + };
603 +};
604 +
605 +&lradc {
606 + vref-supply = <&reg_ldo2>;
607 + status = "okay";
608 +
609 + button@200 {
610 + label = "Menu";
611 + linux,code = <KEY_MENU>;
612 + channel = <0>;
613 + voltage = <200000>;
614 + };
615 +
616 + button@600 {
617 + label = "Volume Up";
618 + linux,code = <KEY_VOLUMEUP>;
619 + channel = <0>;
620 + voltage = <600000>;
621 + };
622
623 - interrupt-controller;
624 - #interrupt-cells = <1>;
625 + button@800 {
626 + label = "Volume Down";
627 + linux,code = <KEY_VOLUMEDOWN>;
628 + channel = <0>;
629 + voltage = <800000>;
630 + };
631 +
632 + button@1000 {
633 + label = "Home";
634 + linux,code = <KEY_HOMEPAGE>;
635 + channel = <0>;
636 + voltage = <1000000>;
637 + };
638 +
639 + button@1200 {
640 + label = "Esc";
641 + linux,code = <KEY_ESC>;
642 + channel = <0>;
643 + voltage = <1200000>;
644 };
645 };
646
647 @@ -94,15 +155,52 @@
648 status = "okay";
649 };
650
651 -&ohci0 {
652 +&otg_sram {
653 status = "okay";
654 };
655
656 -&ohci1 {
657 - status = "okay";
658 +&pio {
659 + usb0_id_detect_pin: usb0_id_detect_pin@0 {
660 + allwinner,pins = "PH4";
661 + allwinner,function = "gpio_in";
662 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
663 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
664 + };
665 +
666 + usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
667 + allwinner,pins = "PH5";
668 + allwinner,function = "gpio_in";
669 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
670 + allwinner,pull = <SUN4I_PINCTRL_PULL_DOWN>;
671 + };
672 +};
673 +
674 +&reg_dcdc2 {
675 + regulator-always-on;
676 + regulator-min-microvolt = <1000000>;
677 + regulator-max-microvolt = <1400000>;
678 + regulator-name = "vdd-cpu";
679 };
680
681 -&reg_usb1_vbus {
682 +&reg_dcdc3 {
683 + regulator-always-on;
684 + regulator-min-microvolt = <1250000>;
685 + regulator-max-microvolt = <1250000>;
686 + regulator-name = "vdd-int-dll";
687 +};
688 +
689 +&reg_ldo1 {
690 + regulator-name = "vdd-rtc";
691 +};
692 +
693 +&reg_ldo2 {
694 + regulator-always-on;
695 + regulator-min-microvolt = <3000000>;
696 + regulator-max-microvolt = <3000000>;
697 + regulator-name = "avcc";
698 +};
699 +
700 +&reg_usb0_vbus {
701 status = "okay";
702 };
703
704 @@ -116,8 +214,17 @@
705 status = "okay";
706 };
707
708 +&usb_otg {
709 + dr_mode = "otg";
710 + status = "okay";
711 +};
712 +
713 &usbphy {
714 - usb1_vbus-supply = <&reg_usb1_vbus>;
715 + pinctrl-names = "default";
716 + pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
717 + usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
718 + usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
719 + usb0_vbus-supply = <&reg_usb0_vbus>;
720 usb2_vbus-supply = <&reg_usb2_vbus>;
721 status = "okay";
722 };
723 --- a/arch/arm/dts/sun4i-a10-inet9f-rev03.dts
724 +++ b/arch/arm/dts/sun4i-a10-inet9f-rev03.dts
725 @@ -59,6 +59,159 @@
726 chosen {
727 stdout-path = "serial0:115200n8";
728 };
729 +
730 + gpio_keys {
731 + compatible = "gpio-keys-polled";
732 + pinctrl-names = "default";
733 + pinctrl-0 = <&key_pins_inet9f>;
734 + #address-cells = <1>;
735 + #size-cells = <0>;
736 + poll-interval = <20>;
737 +
738 + button@0 {
739 + label = "Left Joystick Left";
740 + linux,code = <ABS_X>;
741 + linux,input-type = <EV_ABS>;
742 + linux,input-value = <0xffffffff>; /* -1 */
743 + gpios = <&pio 0 6 GPIO_ACTIVE_LOW>; /* PA6 */
744 + };
745 +
746 + button@1 {
747 + label = "Left Joystick Right";
748 + linux,code = <ABS_X>;
749 + linux,input-type = <EV_ABS>;
750 + linux,input-value = <1>;
751 + gpios = <&pio 0 5 GPIO_ACTIVE_LOW>; /* PA5 */
752 + };
753 +
754 + button@2 {
755 + label = "Left Joystick Up";
756 + linux,code = <ABS_Y>;
757 + linux,input-type = <EV_ABS>;
758 + linux,input-value = <0xffffffff>; /* -1 */
759 + gpios = <&pio 0 8 GPIO_ACTIVE_LOW>; /* PA8 */
760 + };
761 +
762 + button@3 {
763 + label = "Left Joystick Down";
764 + linux,code = <ABS_Y>;
765 + linux,input-type = <EV_ABS>;
766 + linux,input-value = <1>;
767 + gpios = <&pio 0 9 GPIO_ACTIVE_LOW>; /* PA9 */
768 + };
769 +
770 + button@4 {
771 + label = "Right Joystick Left";
772 + linux,code = <ABS_Z>;
773 + linux,input-type = <EV_ABS>;
774 + linux,input-value = <0xffffffff>; /* -1 */
775 + gpios = <&pio 0 1 GPIO_ACTIVE_LOW>; /* PA1 */
776 + };
777 +
778 + button@5 {
779 + label = "Right Joystick Right";
780 + linux,code = <ABS_Z>;
781 + linux,input-type = <EV_ABS>;
782 + linux,input-value = <1>;
783 + gpios = <&pio 0 0 GPIO_ACTIVE_LOW>; /* PA0 */
784 + };
785 +
786 + button@6 {
787 + label = "Right Joystick Up";
788 + linux,code = <ABS_RZ>;
789 + linux,input-type = <EV_ABS>;
790 + linux,input-value = <0xffffffff>; /* -1 */
791 + gpios = <&pio 0 3 GPIO_ACTIVE_LOW>; /* PA3 */
792 + };
793 +
794 + button@7 {
795 + label = "Right Joystick Down";
796 + linux,code = <ABS_RZ>;
797 + linux,input-type = <EV_ABS>;
798 + linux,input-value = <1>;
799 + gpios = <&pio 0 4 GPIO_ACTIVE_LOW>; /* PA4 */
800 + };
801 +
802 + button@8 {
803 + label = "DPad Left";
804 + linux,code = <ABS_HAT0X>;
805 + linux,input-type = <EV_ABS>;
806 + linux,input-value = <0xffffffff>; /* -1 */
807 + gpios = <&pio 7 23 GPIO_ACTIVE_LOW>; /* PH23 */
808 + };
809 +
810 + button@9 {
811 + label = "DPad Right";
812 + linux,code = <ABS_HAT0X>;
813 + linux,input-type = <EV_ABS>;
814 + linux,input-value = <1>;
815 + gpios = <&pio 7 24 GPIO_ACTIVE_LOW>; /* PH24 */
816 + };
817 +
818 + button@10 {
819 + label = "DPad Up";
820 + linux,code = <ABS_HAT0Y>;
821 + linux,input-type = <EV_ABS>;
822 + linux,input-value = <0xffffffff>; /* -1 */
823 + gpios = <&pio 7 25 GPIO_ACTIVE_LOW>; /* PH25 */
824 + };
825 +
826 + button@11 {
827 + label = "DPad Down";
828 + linux,code = <ABS_HAT0Y>;
829 + linux,input-type = <EV_ABS>;
830 + linux,input-value = <1>;
831 + gpios = <&pio 7 26 GPIO_ACTIVE_LOW>; /* PH26 */
832 + };
833 +
834 + button@12 {
835 + label = "Button X";
836 + linux,code = <BTN_X>;
837 + gpios = <&pio 0 16 GPIO_ACTIVE_LOW>; /* PA16 */
838 + };
839 +
840 + button@13 {
841 + label = "Button Y";
842 + linux,code = <BTN_Y>;
843 + gpios = <&pio 0 14 GPIO_ACTIVE_LOW>; /* PA14 */
844 + };
845 +
846 + button@14 {
847 + label = "Button A";
848 + linux,code = <BTN_A>;
849 + gpios = <&pio 0 17 GPIO_ACTIVE_LOW>; /* PA17 */
850 + };
851 +
852 + button@15 {
853 + label = "Button B";
854 + linux,code = <BTN_B>;
855 + gpios = <&pio 0 15 GPIO_ACTIVE_LOW>; /* PA15 */
856 + };
857 +
858 + button@16 {
859 + label = "Select Button";
860 + linux,code = <BTN_SELECT>;
861 + gpios = <&pio 0 11 GPIO_ACTIVE_LOW>; /* PA11 */
862 + };
863 +
864 + button@17 {
865 + label = "Start Button";
866 + linux,code = <BTN_START>;
867 + gpios = <&pio 0 12 GPIO_ACTIVE_LOW>; /* PA12 */
868 + };
869 +
870 + button@18 {
871 + label = "Top Left Button";
872 + linux,code = <BTN_TL>;
873 + gpios = <&pio 7 22 GPIO_ACTIVE_LOW>; /* PH22 */
874 + };
875 +
876 + button@19 {
877 + label = "Top Right Button";
878 + linux,code = <BTN_TR>;
879 + gpios = <&pio 0 13 GPIO_ACTIVE_LOW>; /* PA13 */
880 + };
881 + };
882 };
883
884 &cpu0 {
885 @@ -86,12 +239,29 @@
886 pinctrl-names = "default";
887 pinctrl-0 = <&i2c1_pins_a>;
888 status = "okay";
889 +
890 + /* Accelerometer */
891 + bma250@18 {
892 + compatible = "bosch,bma250";
893 + reg = <0x18>;
894 + interrupt-parent = <&pio>;
895 + interrupts = <7 0 IRQ_TYPE_EDGE_RISING>; /* PH0 / EINT0 */
896 + };
897 };
898
899 &i2c2 {
900 pinctrl-names = "default";
901 pinctrl-0 = <&i2c2_pins_a>;
902 status = "okay";
903 +
904 + ft5406ee8: touchscreen@38 {
905 + compatible = "edt,edt-ft5406";
906 + reg = <0x38>;
907 + interrupt-parent = <&pio>;
908 + interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>;
909 + touchscreen-size-x = <800>;
910 + touchscreen-size-y = <480>;
911 + };
912 };
913
914 &lradc {
915 @@ -149,6 +319,17 @@
916 };
917
918 &pio {
919 + key_pins_inet9f: key_pins@0 {
920 + allwinner,pins = "PA0", "PA1", "PA3", "PA4",
921 + "PA5", "PA6", "PA8", "PA9",
922 + "PA11", "PA12", "PA13",
923 + "PA14", "PA15", "PA16", "PA17",
924 + "PH22", "PH23", "PH24", "PH25", "PH26";
925 + allwinner,function = "gpio_in";
926 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
927 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
928 + };
929 +
930 usb0_id_detect_pin: usb0_id_detect_pin@0 {
931 allwinner,pins = "PH4";
932 allwinner,function = "gpio_in";
933 --- a/arch/arm/dts/sun4i-a10-itead-iteaduino-plus.dts
934 +++ b/arch/arm/dts/sun4i-a10-itead-iteaduino-plus.dts
935 @@ -1,5 +1,6 @@
936 /*
937 * Copyright 2015 Josef Gajdusek <atx@atx.name>
938 + * Copyright 2015 - Marcus Cooper <codekipper@gmail.com>
939 *
940 * This file is dual-licensed: you can use it either under the terms
941 * of the GPL or the X11 license, at your option. Note that this dual
942 @@ -42,22 +43,11 @@
943
944 /dts-v1/;
945 #include "sun4i-a10.dtsi"
946 -#include "sunxi-common-regulators.dtsi"
947 -
948 -#include <dt-bindings/gpio/gpio.h>
949 -#include <dt-bindings/pinctrl/sun4i-a10.h>
950 +#include "sunxi-itead-core-common.dtsi"
951
952 / {
953 model = "Iteaduino Plus A10";
954 compatible = "itead,iteaduino-plus-a10", "allwinner,sun4i-a10";
955 -
956 - aliases {
957 - serial0 = &uart0;
958 - };
959 -
960 - chosen {
961 - stdout-path = "serial0:115200n8";
962 - };
963 };
964
965 &ahci {
966 @@ -65,18 +55,6 @@
967 status = "okay";
968 };
969
970 -&cpu0 {
971 - cpu-supply = <&reg_dcdc2>;
972 -};
973 -
974 -&ehci0 {
975 - status = "okay";
976 -};
977 -
978 -&ehci1 {
979 - status = "okay";
980 -};
981 -
982 &emac {
983 pinctrl-names = "default";
984 pinctrl-0 = <&emac_pins_a>;
985 @@ -89,12 +67,7 @@
986 };
987
988 &i2c0 {
989 - pinctrl-names = "default";
990 - pinctrl-0 = <&i2c0_pins_a>;
991 - status = "okay";
992 -
993 axp209: pmic@34 {
994 - reg = <0x34>;
995 interrupts = <0>;
996 };
997 };
998 @@ -135,68 +108,13 @@
999 status = "okay";
1000 };
1001
1002 -&ohci0 {
1003 - status = "okay";
1004 -};
1005 -
1006 -&ohci1 {
1007 - status = "okay";
1008 -};
1009 -
1010 &reg_ahci_5v {
1011 status = "okay";
1012 };
1013
1014 -#include "axp209.dtsi"
1015 -
1016 -&reg_dcdc2 {
1017 - regulator-always-on;
1018 - regulator-min-microvolt = <1000000>;
1019 - regulator-max-microvolt = <1450000>;
1020 - regulator-name = "vdd-cpu";
1021 -};
1022 -
1023 -&reg_dcdc3 {
1024 - regulator-always-on;
1025 - regulator-min-microvolt = <1000000>;
1026 - regulator-max-microvolt = <1400000>;
1027 - regulator-name = "vdd-int-dll";
1028 -};
1029 -
1030 -&reg_ldo1 {
1031 - regulator-name = "vdd-rtc";
1032 -};
1033 -
1034 -&reg_ldo2 {
1035 - regulator-always-on;
1036 - regulator-min-microvolt = <3000000>;
1037 - regulator-max-microvolt = <3000000>;
1038 - regulator-name = "avcc";
1039 -};
1040 -
1041 -&reg_usb1_vbus {
1042 - status = "okay";
1043 -};
1044 -
1045 -&reg_usb2_vbus {
1046 - status = "okay";
1047 -};
1048 -
1049 &spi0 {
1050 pinctrl-names = "default";
1051 pinctrl-0 = <&spi0_pins_a>,
1052 <&spi0_cs0_pins_a>;
1053 status = "okay";
1054 };
1055 -
1056 -&uart0 {
1057 - pinctrl-names = "default";
1058 - pinctrl-0 = <&uart0_pins_a>;
1059 - status = "okay";
1060 -};
1061 -
1062 -&usbphy {
1063 - usb1_vbus-supply = <&reg_usb1_vbus>;
1064 - usb2_vbus-supply = <&reg_usb2_vbus>;
1065 - status = "okay";
1066 -};
1067 --- a/arch/arm/dts/sun4i-a10-jesurun-q5.dts
1068 +++ b/arch/arm/dts/sun4i-a10-jesurun-q5.dts
1069 @@ -156,6 +156,10 @@
1070 status = "okay";
1071 };
1072
1073 +&otg_sram {
1074 + status = "okay";
1075 +};
1076 +
1077 &pio {
1078 emac_power_pin_q5: emac_power_pin@0 {
1079 allwinner,pins = "PH19";
1080 @@ -172,6 +176,11 @@
1081 };
1082 };
1083
1084 +&reg_usb0_vbus {
1085 + regulator-boot-on;
1086 + status = "okay";
1087 +};
1088 +
1089 &reg_usb1_vbus {
1090 status = "okay";
1091 };
1092 @@ -186,7 +195,13 @@
1093 status = "okay";
1094 };
1095
1096 +&usb_otg {
1097 + dr_mode = "host";
1098 + status = "okay";
1099 +};
1100 +
1101 &usbphy {
1102 + usb0_vbus-supply = <&reg_usb0_vbus>;
1103 usb1_vbus-supply = <&reg_usb1_vbus>;
1104 usb2_vbus-supply = <&reg_usb2_vbus>;
1105 status = "okay";
1106 --- a/arch/arm/dts/sun4i-a10-marsboard.dts
1107 +++ b/arch/arm/dts/sun4i-a10-marsboard.dts
1108 @@ -91,6 +91,10 @@
1109 status = "okay";
1110 };
1111
1112 +&codec {
1113 + status = "okay";
1114 +};
1115 +
1116 &ehci0 {
1117 status = "okay";
1118 };
1119 @@ -154,6 +158,10 @@
1120 status = "okay";
1121 };
1122
1123 +&otg_sram {
1124 + status = "okay";
1125 +};
1126 +
1127 &pio {
1128 led_pins_marsboard: led_pins@0 {
1129 allwinner,pins = "PB5", "PB6", "PB7", "PB8";
1130 @@ -161,6 +169,13 @@
1131 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
1132 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
1133 };
1134 +
1135 + usb0_id_detect_pin: usb0_id_detect_pin@0 {
1136 + allwinner,pins = "PH4";
1137 + allwinner,function = "gpio_in";
1138 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
1139 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
1140 + };
1141 };
1142
1143 &reg_usb1_vbus {
1144 @@ -184,7 +199,15 @@
1145 status = "okay";
1146 };
1147
1148 +&usb_otg {
1149 + dr_mode = "otg";
1150 + status = "okay";
1151 +};
1152 +
1153 &usbphy {
1154 + pinctrl-names = "default";
1155 + pinctrl-0 = <&usb0_id_detect_pin>;
1156 + usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
1157 usb1_vbus-supply = <&reg_usb1_vbus>;
1158 usb2_vbus-supply = <&reg_usb2_vbus>;
1159 status = "okay";
1160 --- a/arch/arm/dts/sun4i-a10-mk802.dts
1161 +++ b/arch/arm/dts/sun4i-a10-mk802.dts
1162 @@ -44,6 +44,7 @@
1163 #include "sun4i-a10.dtsi"
1164 #include "sunxi-common-regulators.dtsi"
1165 #include <dt-bindings/gpio/gpio.h>
1166 +#include <dt-bindings/pinctrl/sun4i-a10.h>
1167
1168 / {
1169 model = "MK802";
1170 @@ -58,6 +59,10 @@
1171 };
1172 };
1173
1174 +&codec {
1175 + status = "okay";
1176 +};
1177 +
1178 &ehci0 {
1179 status = "okay";
1180 };
1181 @@ -80,7 +85,25 @@
1182 status = "okay";
1183 };
1184
1185 +&otg_sram {
1186 + status = "okay";
1187 +};
1188 +
1189 &pio {
1190 + usb0_id_detect_pin: usb0_id_detect_pin@0 {
1191 + allwinner,pins = "PH4";
1192 + allwinner,function = "gpio_in";
1193 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
1194 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
1195 + };
1196 +
1197 + usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
1198 + allwinner,pins = "PH5";
1199 + allwinner,function = "gpio_in";
1200 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
1201 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
1202 + };
1203 +
1204 usb2_vbus_pin_mk802: usb2_vbus_pin@0 {
1205 allwinner,pins = "PH12";
1206 allwinner,function = "gpio_out";
1207 @@ -89,6 +112,10 @@
1208 };
1209 };
1210
1211 +&reg_usb0_vbus {
1212 + status = "okay";
1213 +};
1214 +
1215 &reg_usb1_vbus {
1216 status = "okay";
1217 };
1218 @@ -105,7 +132,17 @@
1219 status = "okay";
1220 };
1221
1222 +&usb_otg {
1223 + dr_mode = "otg";
1224 + status = "okay";
1225 +};
1226 +
1227 &usbphy {
1228 + pinctrl-names = "default";
1229 + pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
1230 + usb0_id_det-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
1231 + usb0_vbus_det-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
1232 + usb0_vbus-supply = <&reg_usb0_vbus>;
1233 usb1_vbus-supply = <&reg_usb1_vbus>;
1234 usb2_vbus-supply = <&reg_usb2_vbus>;
1235 status = "okay";
1236 --- a/arch/arm/dts/sun4i-a10-olinuxino-lime.dts
1237 +++ b/arch/arm/dts/sun4i-a10-olinuxino-lime.dts
1238 @@ -124,6 +124,18 @@
1239 };
1240 };
1241
1242 +&i2c1 {
1243 + pinctrl-names = "default";
1244 + pinctrl-0 = <&i2c1_pins_a>;
1245 + status = "okay";
1246 +
1247 + eeprom: eeprom@50 {
1248 + compatible = "atmel,24c16";
1249 + reg = <0x50>;
1250 + pagesize = <16>;
1251 + };
1252 +};
1253 +
1254 &mdio {
1255 status = "okay";
1256
1257 --- a/arch/arm/dts/sun4i-a10-pcduino.dts
1258 +++ b/arch/arm/dts/sun4i-a10-pcduino.dts
1259 @@ -104,6 +104,10 @@
1260 };
1261 };
1262
1263 +&cpu0 {
1264 + cpu-supply = <&reg_dcdc2>;
1265 +};
1266 +
1267 &ehci0 {
1268 status = "okay";
1269 };
1270 @@ -129,12 +133,8 @@
1271 status = "okay";
1272
1273 axp209: pmic@34 {
1274 - compatible = "x-powers,axp209";
1275 reg = <0x34>;
1276 interrupts = <0>;
1277 -
1278 - interrupt-controller;
1279 - #interrupt-cells = <1>;
1280 };
1281 };
1282
1283 @@ -164,6 +164,10 @@
1284 status = "okay";
1285 };
1286
1287 +&otg_sram {
1288 + status = "okay";
1289 +};
1290 +
1291 &pio {
1292 led_pins_pcduino: led_pins@0 {
1293 allwinner,pins = "PH15", "PH16";
1294 @@ -178,14 +182,40 @@
1295 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
1296 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
1297 };
1298 +
1299 + usb0_id_detect_pin: usb0_id_detect_pin@0 {
1300 + allwinner,pins = "PH4";
1301 + allwinner,function = "gpio_in";
1302 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
1303 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
1304 + };
1305 };
1306
1307 -&reg_usb1_vbus {
1308 - status = "okay";
1309 +#include "axp209.dtsi"
1310 +
1311 +&reg_dcdc2 {
1312 + regulator-always-on;
1313 + regulator-min-microvolt = <1000000>;
1314 + regulator-max-microvolt = <1400000>;
1315 + regulator-name = "vdd-cpu";
1316 };
1317
1318 -&reg_usb2_vbus {
1319 - status = "okay";
1320 +&reg_dcdc3 {
1321 + regulator-always-on;
1322 + regulator-min-microvolt = <1000000>;
1323 + regulator-max-microvolt = <1400000>;
1324 + regulator-name = "vdd-int-dll";
1325 +};
1326 +
1327 +&reg_ldo1 {
1328 + regulator-name = "vdd-rtc";
1329 +};
1330 +
1331 +&reg_ldo2 {
1332 + regulator-always-on;
1333 + regulator-min-microvolt = <3000000>;
1334 + regulator-max-microvolt = <3000000>;
1335 + regulator-name = "avcc";
1336 };
1337
1338 &uart0 {
1339 @@ -194,8 +224,16 @@
1340 status = "okay";
1341 };
1342
1343 +&usb_otg {
1344 + dr_mode = "otg";
1345 + status = "okay";
1346 +};
1347 +
1348 &usbphy {
1349 - usb1_vbus-supply = <&reg_usb1_vbus>;
1350 - usb2_vbus-supply = <&reg_usb2_vbus>;
1351 + pinctrl-names = "default";
1352 + pinctrl-0 = <&usb0_id_detect_pin>;
1353 + usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
1354 + usb1_vbus-supply = <&reg_vcc5v0>; /* USB1 VBUS is always on */
1355 + usb2_vbus-supply = <&reg_vcc5v0>; /* USB2 VBUS is always on */
1356 status = "okay";
1357 };
1358 --- /dev/null
1359 +++ b/arch/arm/dts/sun4i-a10-pcduino2.dts
1360 @@ -0,0 +1,78 @@
1361 +/*
1362 + * Copyright 2015 Siarhei Siamashka <siarhei.siamashka@gmail.com>
1363 + *
1364 + * This file is dual-licensed: you can use it either under the terms
1365 + * of the GPL or the X11 license, at your option. Note that this dual
1366 + * licensing only applies to this file, and not this project as a
1367 + * whole.
1368 + *
1369 + * a) This file is free software; you can redistribute it and/or
1370 + * modify it under the terms of the GNU General Public License as
1371 + * published by the Free Software Foundation; either version 2 of the
1372 + * License, or (at your option) any later version.
1373 + *
1374 + * This file is distributed in the hope that it will be useful,
1375 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1376 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1377 + * GNU General Public License for more details.
1378 + *
1379 + * Or, alternatively,
1380 + *
1381 + * b) Permission is hereby granted, free of charge, to any person
1382 + * obtaining a copy of this software and associated documentation
1383 + * files (the "Software"), to deal in the Software without
1384 + * restriction, including without limitation the rights to use,
1385 + * copy, modify, merge, publish, distribute, sublicense, and/or
1386 + * sell copies of the Software, and to permit persons to whom the
1387 + * Software is furnished to do so, subject to the following
1388 + * conditions:
1389 + *
1390 + * The above copyright notice and this permission notice shall be
1391 + * included in all copies or substantial portions of the Software.
1392 + *
1393 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1394 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
1395 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
1396 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
1397 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
1398 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1399 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1400 + * OTHER DEALINGS IN THE SOFTWARE.
1401 + */
1402 +
1403 +/*
1404 + * The LinkSprite pcDuino2 board is almost identical to the older
1405 + * LinkSprite pcDuino1 board. The only software visible difference
1406 + * is that the pcDuino2 board got a USB VBUS voltage regulator, which
1407 + * is controlled by the PD2 pin (pulled-up by default). Also one of
1408 + * the USB host ports has been replaced with a USB WIFI chip.
1409 + */
1410 +
1411 +#include "sun4i-a10-pcduino.dts"
1412 +
1413 +/ {
1414 + model = "LinkSprite pcDuino2";
1415 + compatible = "linksprite,a10-pcduino2", "allwinner,sun4i-a10";
1416 +};
1417 +
1418 +&pio {
1419 + usb2_vbus_pin_pcduino2: usb2_vbus_pin@0 {
1420 + allwinner,pins = "PD2";
1421 + allwinner,function = "gpio_out";
1422 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
1423 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
1424 + };
1425 +};
1426 +
1427 +&reg_usb2_vbus {
1428 + pinctrl-names = "default";
1429 + pinctrl-0 = <&usb2_vbus_pin_pcduino2>;
1430 + gpio = <&pio 3 2 GPIO_ACTIVE_HIGH>;
1431 + status = "okay";
1432 +};
1433 +
1434 +&usbphy {
1435 + usb1_vbus-supply = <&reg_vcc3v3>; /* USB WIFI is always on */
1436 + usb2_vbus-supply = <&reg_usb2_vbus>;
1437 + status = "okay";
1438 +};
1439 --- a/arch/arm/dts/sun4i-a10-pov-protab2-ips9.dts
1440 +++ b/arch/arm/dts/sun4i-a10-pov-protab2-ips9.dts
1441 @@ -47,6 +47,7 @@
1442 #include <dt-bindings/input/input.h>
1443 #include <dt-bindings/interrupt-controller/irq.h>
1444 #include <dt-bindings/pinctrl/sun4i-a10.h>
1445 +#include <dt-bindings/pwm/pwm.h>
1446
1447 / {
1448 model = "Point of View Protab2-IPS9";
1449 @@ -56,11 +57,28 @@
1450 serial0 = &uart0;
1451 };
1452
1453 + backlight: backlight {
1454 + compatible = "pwm-backlight";
1455 + pinctrl-names = "default";
1456 + pinctrl-0 = <&bl_en_pin_protab>;
1457 + pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
1458 + brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
1459 + default-brightness-level = <8>;
1460 + enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */
1461 + };
1462 +
1463 chosen {
1464 stdout-path = "serial0:115200n8";
1465 };
1466 };
1467
1468 +&codec {
1469 + pinctrl-names = "default";
1470 + pinctrl-0 = <&codec_pa_pin>;
1471 + allwinner,pa-gpios = <&pio 7 15 GPIO_ACTIVE_HIGH>; /* PH15 */
1472 + status = "okay";
1473 +};
1474 +
1475 &cpu0 {
1476 cpu-supply = <&reg_dcdc2>;
1477 };
1478 @@ -86,12 +104,36 @@
1479 pinctrl-names = "default";
1480 pinctrl-0 = <&i2c1_pins_a>;
1481 status = "okay";
1482 +
1483 + /* Accelerometer */
1484 + bma250@18 {
1485 + compatible = "bosch,bma250";
1486 + reg = <0x18>;
1487 + interrupt-parent = <&pio>;
1488 + interrupts = <7 0 IRQ_TYPE_EDGE_RISING>; /* PH0 / EINT0 */
1489 + };
1490 };
1491
1492 &i2c2 {
1493 pinctrl-names = "default";
1494 pinctrl-0 = <&i2c2_pins_a>;
1495 status = "okay";
1496 +
1497 + pixcir_ts@5c {
1498 + pinctrl-names = "default";
1499 + pinctrl-0 = <&touchscreen_pins>;
1500 + compatible = "pixcir,pixcir_tangoc";
1501 + reg = <0x5c>;
1502 + interrupt-parent = <&pio>;
1503 + interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; /* EINT21 (PH21) */
1504 + attb-gpio = <&pio 7 21 GPIO_ACTIVE_HIGH>; /* PH21 */
1505 + enable-gpios = <&pio 0 5 GPIO_ACTIVE_LOW>;
1506 + wake-gpios = <&pio 1 13 GPIO_ACTIVE_LOW>;
1507 + touchscreen-size-x = <1024>;
1508 + touchscreen-size-y = <768>;
1509 + touchscreen-inverted-x;
1510 + touchscreen-inverted-y;
1511 + };
1512 };
1513
1514 &lradc {
1515 @@ -128,6 +170,27 @@
1516 };
1517
1518 &pio {
1519 + bl_en_pin_protab: bl_en_pin@0 {
1520 + allwinner,pins = "PH7";
1521 + allwinner,function = "gpio_out";
1522 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
1523 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
1524 + };
1525 +
1526 + codec_pa_pin: codec_pa_pin@0 {
1527 + allwinner,pins = "PH15";
1528 + allwinner,function = "gpio_out";
1529 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
1530 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
1531 + };
1532 +
1533 + touchscreen_pins: touchscreen_pins@0 {
1534 + allwinner,pins = "PA5", "PB13";
1535 + allwinner,function = "gpio_out";
1536 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
1537 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
1538 + };
1539 +
1540 usb0_id_detect_pin: usb0_id_detect_pin@0 {
1541 allwinner,pins = "PH4";
1542 allwinner,function = "gpio_in";
1543 @@ -143,6 +206,12 @@
1544 };
1545 };
1546
1547 +&pwm {
1548 + pinctrl-names = "default";
1549 + pinctrl-0 = <&pwm0_pins_a>;
1550 + status = "okay";
1551 +};
1552 +
1553 &reg_dcdc2 {
1554 regulator-always-on;
1555 regulator-min-microvolt = <1000000>;
1556 --- a/arch/arm/dts/sun4i-a10.dtsi
1557 +++ b/arch/arm/dts/sun4i-a10.dtsi
1558 @@ -45,6 +45,7 @@
1559
1560 #include <dt-bindings/thermal/thermal.h>
1561
1562 +#include <dt-bindings/clock/sun4i-a10-pll2.h>
1563 #include <dt-bindings/dma/sun4i-a10.h>
1564 #include <dt-bindings/pinctrl/sun4i-a10.h>
1565
1566 @@ -65,7 +66,7 @@
1567 "simple-framebuffer";
1568 allwinner,pipeline = "de_be0-lcd0-hdmi";
1569 clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>,
1570 - <&ahb_gates 44>;
1571 + <&ahb_gates 44>, <&dram_gates 26>;
1572 status = "disabled";
1573 };
1574
1575 @@ -74,7 +75,8 @@
1576 "simple-framebuffer";
1577 allwinner,pipeline = "de_fe0-de_be0-lcd0-hdmi";
1578 clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>,
1579 - <&ahb_gates 44>, <&ahb_gates 46>;
1580 + <&ahb_gates 44>, <&ahb_gates 46>,
1581 + <&dram_gates 25>, <&dram_gates 26>;
1582 status = "disabled";
1583 };
1584
1585 @@ -83,7 +85,8 @@
1586 "simple-framebuffer";
1587 allwinner,pipeline = "de_fe0-de_be0-lcd0";
1588 clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>,
1589 - <&ahb_gates 46>;
1590 + <&ahb_gates 46>, <&dram_gates 25>,
1591 + <&dram_gates 26>;
1592 status = "disabled";
1593 };
1594
1595 @@ -92,7 +95,8 @@
1596 "simple-framebuffer";
1597 allwinner,pipeline = "de_fe0-de_be0-lcd0-tve0";
1598 clocks = <&pll5 1>, <&ahb_gates 34>, <&ahb_gates 36>,
1599 - <&ahb_gates 44>, <&ahb_gates 46>;
1600 + <&ahb_gates 44>, <&ahb_gates 46>,
1601 + <&dram_gates 25>, <&dram_gates 26>;
1602 status = "disabled";
1603 };
1604 };
1605 @@ -195,6 +199,15 @@
1606 clock-output-names = "pll1";
1607 };
1608
1609 + pll2: clk@01c20008 {
1610 + #clock-cells = <1>;
1611 + compatible = "allwinner,sun4i-a10-pll2-clk";
1612 + reg = <0x01c20008 0x8>;
1613 + clocks = <&osc24M>;
1614 + clock-output-names = "pll2-1x", "pll2-2x",
1615 + "pll2-4x", "pll2-8x";
1616 + };
1617 +
1618 pll4: clk@01c20018 {
1619 #clock-cells = <0>;
1620 compatible = "allwinner,sun4i-a10-pll1-clk";
1621 @@ -241,6 +254,7 @@
1622 compatible = "allwinner,sun4i-a10-axi-gates-clk";
1623 reg = <0x01c2005c 0x4>;
1624 clocks = <&axi>;
1625 + clock-indices = <0>;
1626 clock-output-names = "axi_dram";
1627 };
1628
1629 @@ -257,17 +271,36 @@
1630 compatible = "allwinner,sun4i-a10-ahb-gates-clk";
1631 reg = <0x01c20060 0x8>;
1632 clocks = <&ahb>;
1633 + clock-indices = <0>, <1>,
1634 + <2>, <3>,
1635 + <4>, <5>, <6>,
1636 + <7>, <8>, <9>,
1637 + <10>, <11>, <12>,
1638 + <13>, <14>, <16>,
1639 + <17>, <18>, <20>,
1640 + <21>, <22>, <23>,
1641 + <24>, <25>, <26>,
1642 + <32>, <33>, <34>,
1643 + <35>, <36>, <37>,
1644 + <40>, <41>, <43>,
1645 + <44>, <45>,
1646 + <46>, <47>,
1647 + <50>, <52>;
1648 clock-output-names = "ahb_usb0", "ahb_ehci0",
1649 - "ahb_ohci0", "ahb_ehci1", "ahb_ohci1", "ahb_ss",
1650 - "ahb_dma", "ahb_bist", "ahb_mmc0", "ahb_mmc1",
1651 - "ahb_mmc2", "ahb_mmc3", "ahb_ms", "ahb_nand",
1652 - "ahb_sdram", "ahb_ace", "ahb_emac", "ahb_ts",
1653 - "ahb_spi0", "ahb_spi1", "ahb_spi2", "ahb_spi3",
1654 - "ahb_pata", "ahb_sata", "ahb_gps", "ahb_ve",
1655 - "ahb_tvd", "ahb_tve0", "ahb_tve1", "ahb_lcd0",
1656 - "ahb_lcd1", "ahb_csi0", "ahb_csi1", "ahb_hdmi",
1657 - "ahb_de_be0", "ahb_de_be1", "ahb_de_fe0",
1658 - "ahb_de_fe1", "ahb_mp", "ahb_mali400";
1659 + "ahb_ohci0", "ahb_ehci1",
1660 + "ahb_ohci1", "ahb_ss", "ahb_dma",
1661 + "ahb_bist", "ahb_mmc0", "ahb_mmc1",
1662 + "ahb_mmc2", "ahb_mmc3", "ahb_ms",
1663 + "ahb_nand", "ahb_sdram", "ahb_ace",
1664 + "ahb_emac", "ahb_ts", "ahb_spi0",
1665 + "ahb_spi1", "ahb_spi2", "ahb_spi3",
1666 + "ahb_pata", "ahb_sata", "ahb_gps",
1667 + "ahb_ve", "ahb_tvd", "ahb_tve0",
1668 + "ahb_tve1", "ahb_lcd0", "ahb_lcd1",
1669 + "ahb_csi0", "ahb_csi1", "ahb_hdmi",
1670 + "ahb_de_be0", "ahb_de_be1",
1671 + "ahb_de_fe0", "ahb_de_fe1",
1672 + "ahb_mp", "ahb_mali400";
1673 };
1674
1675 apb0: apb0@01c20054 {
1676 @@ -283,9 +316,14 @@
1677 compatible = "allwinner,sun4i-a10-apb0-gates-clk";
1678 reg = <0x01c20068 0x4>;
1679 clocks = <&apb0>;
1680 + clock-indices = <0>, <1>,
1681 + <2>, <3>,
1682 + <5>, <6>,
1683 + <7>, <10>;
1684 clock-output-names = "apb0_codec", "apb0_spdif",
1685 - "apb0_ac97", "apb0_iis", "apb0_pio", "apb0_ir0",
1686 - "apb0_ir1", "apb0_keypad";
1687 + "apb0_ac97", "apb0_iis",
1688 + "apb0_pio", "apb0_ir0",
1689 + "apb0_ir1", "apb0_keypad";
1690 };
1691
1692 apb1: clk@01c20058 {
1693 @@ -301,12 +339,22 @@
1694 compatible = "allwinner,sun4i-a10-apb1-gates-clk";
1695 reg = <0x01c2006c 0x4>;
1696 clocks = <&apb1>;
1697 + clock-indices = <0>, <1>,
1698 + <2>, <4>,
1699 + <5>, <6>,
1700 + <7>, <16>,
1701 + <17>, <18>,
1702 + <19>, <20>,
1703 + <21>, <22>,
1704 + <23>;
1705 clock-output-names = "apb1_i2c0", "apb1_i2c1",
1706 - "apb1_i2c2", "apb1_can", "apb1_scr",
1707 - "apb1_ps20", "apb1_ps21", "apb1_uart0",
1708 - "apb1_uart1", "apb1_uart2", "apb1_uart3",
1709 - "apb1_uart4", "apb1_uart5", "apb1_uart6",
1710 - "apb1_uart7";
1711 + "apb1_i2c2", "apb1_can",
1712 + "apb1_scr", "apb1_ps20",
1713 + "apb1_ps21", "apb1_uart0",
1714 + "apb1_uart1", "apb1_uart2",
1715 + "apb1_uart3", "apb1_uart4",
1716 + "apb1_uart5", "apb1_uart6",
1717 + "apb1_uart7";
1718 };
1719
1720 nand_clk: clk@01c20080 {
1721 @@ -446,6 +494,48 @@
1722 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
1723 clock-output-names = "spi3";
1724 };
1725 +
1726 + dram_gates: clk@01c20100 {
1727 + #clock-cells = <1>;
1728 + compatible = "allwinner,sun4i-a10-dram-gates-clk";
1729 + reg = <0x01c20100 0x4>;
1730 + clocks = <&pll5 0>;
1731 + clock-indices = <0>,
1732 + <1>, <2>,
1733 + <3>,
1734 + <4>,
1735 + <5>, <6>,
1736 + <15>,
1737 + <24>, <25>,
1738 + <26>, <27>,
1739 + <28>, <29>;
1740 + clock-output-names = "dram_ve",
1741 + "dram_csi0", "dram_csi1",
1742 + "dram_ts",
1743 + "dram_tvd",
1744 + "dram_tve0", "dram_tve1",
1745 + "dram_output",
1746 + "dram_de_fe1", "dram_de_fe0",
1747 + "dram_de_be0", "dram_de_be1",
1748 + "dram_de_mp", "dram_ace";
1749 + };
1750 +
1751 + ve_clk: clk@01c2013c {
1752 + #clock-cells = <0>;
1753 + #reset-cells = <0>;
1754 + compatible = "allwinner,sun4i-a10-ve-clk";
1755 + reg = <0x01c2013c 0x4>;
1756 + clocks = <&pll4>;
1757 + clock-output-names = "ve";
1758 + };
1759 +
1760 + codec_clk: clk@01c20140 {
1761 + #clock-cells = <0>;
1762 + compatible = "allwinner,sun4i-a10-codec-clk";
1763 + reg = <0x01c20140 0x4>;
1764 + clocks = <&pll2 SUN4I_A10_PLL2_1X>;
1765 + clock-output-names = "codec";
1766 + };
1767 };
1768
1769 soc@01c00000 {
1770 @@ -656,6 +746,14 @@
1771 status = "disabled";
1772 };
1773
1774 + crypto: crypto-engine@01c15000 {
1775 + compatible = "allwinner,sun4i-a10-crypto";
1776 + reg = <0x01c15000 0x1000>;
1777 + interrupts = <86>;
1778 + clocks = <&ahb_gates 5>, <&ss_clk>;
1779 + clock-names = "ahb", "mod";
1780 + };
1781 +
1782 spi2: spi@01c17000 {
1783 compatible = "allwinner,sun4i-a10-spi";
1784 reg = <0x01c17000 0x1000>;
1785 @@ -961,6 +1059,19 @@
1786 status = "disabled";
1787 };
1788
1789 + codec: codec@01c22c00 {
1790 + #sound-dai-cells = <0>;
1791 + compatible = "allwinner,sun4i-a10-codec";
1792 + reg = <0x01c22c00 0x40>;
1793 + interrupts = <30>;
1794 + clocks = <&apb0_gates 0>, <&codec_clk>;
1795 + clock-names = "apb", "codec";
1796 + dmas = <&dma SUN4I_DMA_NORMAL 19>,
1797 + <&dma SUN4I_DMA_NORMAL 19>;
1798 + dma-names = "rx", "tx";
1799 + status = "disabled";
1800 + };
1801 +
1802 sid: eeprom@01c23800 {
1803 compatible = "allwinner,sun4i-a10-sid";
1804 reg = <0x01c23800 0x10>;
1805 --- a/arch/arm/dts/sun5i-a10s-auxtek-t004.dts
1806 +++ b/arch/arm/dts/sun5i-a10s-auxtek-t004.dts
1807 @@ -86,6 +86,20 @@
1808 status = "okay";
1809 };
1810
1811 +&i2c0 {
1812 + pinctrl-names = "default";
1813 + pinctrl-0 = <&i2c0_pins_a>;
1814 + status = "okay";
1815 +
1816 + axp152: pmic@30 {
1817 + compatible = "x-powers,axp152";
1818 + reg = <0x30>;
1819 + interrupts = <0>;
1820 + interrupt-controller;
1821 + #interrupt-cells = <1>;
1822 + };
1823 +};
1824 +
1825 &mmc0 {
1826 pinctrl-names = "default";
1827 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_t004>;
1828 --- a/arch/arm/dts/sun5i-a10s-olinuxino-micro.dts
1829 +++ b/arch/arm/dts/sun5i-a10s-olinuxino-micro.dts
1830 @@ -111,7 +111,7 @@
1831 status = "okay";
1832
1833 at24@50 {
1834 - compatible = "at,24c16";
1835 + compatible = "atmel,24c16";
1836 pagesize = <16>;
1837 reg = <0x50>;
1838 read-only;
1839 --- a/arch/arm/dts/sun5i-a13-empire-electronix-d709.dts
1840 +++ b/arch/arm/dts/sun5i-a13-empire-electronix-d709.dts
1841 @@ -123,7 +123,7 @@
1842
1843 &mmc0 {
1844 pinctrl-names = "default";
1845 - pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_inet98fv2>;
1846 + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_d709>;
1847 vmmc-supply = <&reg_vcc3v3>;
1848 bus-width = <4>;
1849 cd-gpios = <&pio 6 0 GPIO_ACTIVE_HIGH>; /* PG0 */
1850 @@ -131,27 +131,12 @@
1851 status = "okay";
1852 };
1853
1854 -&mmc2 {
1855 - pinctrl-names = "default";
1856 - pinctrl-0 = <&mmc2_pins_a>;
1857 - vmmc-supply = <&reg_vcc3v3>;
1858 - bus-width = <8>;
1859 - non-removable;
1860 - status = "okay";
1861 -
1862 - mmccard: mmccard@0 {
1863 - reg = <0>;
1864 - compatible = "mmc-card";
1865 - broken-hpi;
1866 - };
1867 -};
1868 -
1869 &otg_sram {
1870 status = "okay";
1871 };
1872
1873 &pio {
1874 - mmc0_cd_pin_inet98fv2: mmc0_cd_pin@0 {
1875 + mmc0_cd_pin_d709: mmc0_cd_pin@0 {
1876 allwinner,pins = "PG0";
1877 allwinner,function = "gpio_in";
1878 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
1879 --- a/arch/arm/dts/sun5i-a13-inet-98v-rev2.dts
1880 +++ b/arch/arm/dts/sun5i-a13-inet-98v-rev2.dts
1881 @@ -123,21 +123,6 @@
1882 status = "okay";
1883 };
1884
1885 -&mmc2 {
1886 - pinctrl-names = "default";
1887 - pinctrl-0 = <&mmc2_pins_a>;
1888 - vmmc-supply = <&reg_vcc3v3>;
1889 - bus-width = <8>;
1890 - non-removable;
1891 - status = "okay";
1892 -
1893 - mmccard: mmccard@0 {
1894 - reg = <0>;
1895 - compatible = "mmc-card";
1896 - broken-hpi;
1897 - };
1898 -};
1899 -
1900 &otg_sram {
1901 status = "okay";
1902 };
1903 @@ -201,11 +186,6 @@
1904 status = "okay";
1905 };
1906
1907 -&reg_usb1_vbus {
1908 - gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */
1909 - status = "okay";
1910 -};
1911 -
1912 &uart1 {
1913 pinctrl-names = "default";
1914 pinctrl-0 = <&uart1_pins_b>;
1915 @@ -221,16 +201,12 @@
1916 allwinner,pins = "PG12";
1917 };
1918
1919 -&usb1_vbus_pin_a {
1920 - allwinner,pins = "PG11";
1921 -};
1922 -
1923 &usbphy {
1924 pinctrl-names = "default";
1925 pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
1926 usb0_id_det-gpio = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */
1927 usb0_vbus_det-gpio = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */
1928 usb0_vbus-supply = <&reg_usb0_vbus>;
1929 - usb1_vbus-supply = <&reg_usb1_vbus>;
1930 + usb1_vbus-supply = <&reg_ldo3>;
1931 status = "okay";
1932 };
1933 --- a/arch/arm/dts/sun5i-a13-utoo-p66.dts
1934 +++ b/arch/arm/dts/sun5i-a13-utoo-p66.dts
1935 @@ -47,11 +47,21 @@
1936 #include <dt-bindings/input/input.h>
1937 #include <dt-bindings/interrupt-controller/irq.h>
1938 #include <dt-bindings/pinctrl/sun4i-a10.h>
1939 +#include <dt-bindings/pwm/pwm.h>
1940
1941 / {
1942 model = "Utoo P66";
1943 compatible = "utoo,p66", "allwinner,sun5i-a13";
1944
1945 + backlight: backlight {
1946 + compatible = "pwm-backlight";
1947 + pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
1948 + /* Note levels of 10 / 20% result in backlight off */
1949 + brightness-levels = <0 30 40 50 60 70 80 90 100>;
1950 + default-brightness-level = <6>;
1951 + /* TODO: backlight uses axp gpio1 as enable pin */
1952 + };
1953 +
1954 i2c_lcd: i2c@0 {
1955 /* The lcd panel i2c interface is hooked up via gpios */
1956 compatible = "i2c-gpio";
1957 @@ -63,6 +73,13 @@
1958 };
1959 };
1960
1961 +&codec {
1962 + pinctrl-names = "default";
1963 + pinctrl-0 = <&codec_pa_pin>;
1964 + allwinner,pa-gpios = <&pio 6 3 GPIO_ACTIVE_HIGH>; /* PG3 */
1965 + status = "okay";
1966 +};
1967 +
1968 &cpu0 {
1969 cpu-supply = <&reg_dcdc2>;
1970 };
1971 @@ -158,6 +175,13 @@
1972 };
1973
1974 &pio {
1975 + codec_pa_pin: codec_pa_pin@0 {
1976 + allwinner,pins = "PG3";
1977 + allwinner,function = "gpio_out";
1978 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
1979 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
1980 + };
1981 +
1982 mmc0_cd_pin_p66: mmc0_cd_pin@0 {
1983 allwinner,pins = "PG0";
1984 allwinner,function = "gpio_in";
1985 @@ -201,6 +225,12 @@
1986 };
1987 };
1988
1989 +&pwm {
1990 + pinctrl-names = "default";
1991 + pinctrl-0 = <&pwm0_pins>;
1992 + status = "okay";
1993 +};
1994 +
1995 &reg_dcdc2 {
1996 regulator-always-on;
1997 regulator-min-microvolt = <1000000>;
1998 --- a/arch/arm/dts/sun5i-q8-common.dtsi
1999 +++ b/arch/arm/dts/sun5i-q8-common.dtsi
2000 @@ -41,11 +41,21 @@
2001 */
2002 #include "sunxi-q8-common.dtsi"
2003
2004 +#include <dt-bindings/pwm/pwm.h>
2005 +
2006 / {
2007 aliases {
2008 serial0 = &uart1;
2009 };
2010
2011 + backlight: backlight {
2012 + compatible = "pwm-backlight";
2013 + pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
2014 + brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
2015 + default-brightness-level = <8>;
2016 + /* TODO: backlight uses axp gpio1 as enable pin */
2017 + };
2018 +
2019 chosen {
2020 stdout-path = "serial0:115200n8";
2021 };
2022 --- a/arch/arm/dts/sun5i-r8-chip.dts
2023 +++ b/arch/arm/dts/sun5i-r8-chip.dts
2024 @@ -64,6 +64,26 @@
2025 chosen {
2026 stdout-path = "serial0:115200n8";
2027 };
2028 +
2029 + wifi_reg_on: wifi_reg_on {
2030 + compatible = "regulator-fixed";
2031 + pinctrl-names = "default";
2032 + pinctrl-0 = <&chip_wifi_reg_on_pin>;
2033 +
2034 + regulator-name = "wifi-reg-on";
2035 + regulator-min-microvolt = <3300000>;
2036 + regulator-max-microvolt = <3300000>;
2037 + gpio = <&pio 2 19 GPIO_ACTIVE_HIGH>; /* PC19 */
2038 + enable-active-high;
2039 + };
2040 +};
2041 +
2042 +&codec {
2043 + status = "okay";
2044 +};
2045 +
2046 +&cpu0 {
2047 + cpu-supply = <&reg_dcdc2>;
2048 };
2049
2050 &ehci0 {
2051 @@ -109,10 +129,14 @@
2052 };
2053 };
2054
2055 +&mmc0_pins_a {
2056 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
2057 +};
2058 +
2059 &mmc0 {
2060 pinctrl-names = "default";
2061 pinctrl-0 = <&mmc0_pins_a>;
2062 - vmmc-supply = <&reg_vcc3v3>;
2063 + vmmc-supply = <&wifi_reg_on>;
2064 bus-width = <4>;
2065 non-removable;
2066 status = "okay";
2067 @@ -134,6 +158,13 @@
2068 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
2069 };
2070
2071 + chip_wifi_reg_on_pin: chip_wifi_reg_on_pin@0 {
2072 + allwinner,pins = "PC19";
2073 + allwinner,function = "gpio_out";
2074 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
2075 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
2076 + };
2077 +
2078 chip_id_det_pin: chip_id_det_pin@0 {
2079 allwinner,pins = "PG2";
2080 allwinner,function = "gpio_in";
2081 @@ -167,6 +198,20 @@
2082 regulator-always-on;
2083 };
2084
2085 +&reg_ldo3 {
2086 + regulator-min-microvolt = <3300000>;
2087 + regulator-max-microvolt = <3300000>;
2088 + regulator-name = "vdd-wifi1";
2089 + regulator-always-on;
2090 +};
2091 +
2092 +&reg_ldo4 {
2093 + regulator-min-microvolt = <3300000>;
2094 + regulator-max-microvolt = <3300000>;
2095 + regulator-name = "vdd-wifi2";
2096 + regulator-always-on;
2097 +};
2098 +
2099 &reg_ldo5 {
2100 regulator-min-microvolt = <1800000>;
2101 regulator-max-microvolt = <1800000>;
2102 --- a/arch/arm/dts/sun5i.dtsi
2103 +++ b/arch/arm/dts/sun5i.dtsi
2104 @@ -44,6 +44,7 @@
2105
2106 #include "skeleton.dtsi"
2107
2108 +#include <dt-bindings/clock/sun4i-a10-pll2.h>
2109 #include <dt-bindings/dma/sun4i-a10.h>
2110 #include <dt-bindings/pinctrl/sun4i-a10.h>
2111
2112 @@ -102,6 +103,15 @@
2113 clock-output-names = "pll1";
2114 };
2115
2116 + pll2: clk@01c20008 {
2117 + #clock-cells = <1>;
2118 + compatible = "allwinner,sun5i-a13-pll2-clk";
2119 + reg = <0x01c20008 0x8>;
2120 + clocks = <&osc24M>;
2121 + clock-output-names = "pll2-1x", "pll2-2x",
2122 + "pll2-4x", "pll2-8x";
2123 + };
2124 +
2125 pll4: clk@01c20018 {
2126 #clock-cells = <0>;
2127 compatible = "allwinner,sun4i-a10-pll1-clk";
2128 @@ -285,6 +295,14 @@
2129 clock-output-names = "usb_ohci0", "usb_phy";
2130 };
2131
2132 + codec_clk: clk@01c20140 {
2133 + #clock-cells = <0>;
2134 + compatible = "allwinner,sun4i-a10-codec-clk";
2135 + reg = <0x01c20140 0x4>;
2136 + clocks = <&pll2 SUN4I_A10_PLL2_1X>;
2137 + clock-output-names = "codec";
2138 + };
2139 +
2140 mbus_clk: clk@01c2015c {
2141 #clock-cells = <0>;
2142 compatible = "allwinner,sun5i-a13-mbus-clk";
2143 @@ -571,6 +589,19 @@
2144 status = "disabled";
2145 };
2146
2147 + codec: codec@01c22c00 {
2148 + #sound-dai-cells = <0>;
2149 + compatible = "allwinner,sun4i-a10-codec";
2150 + reg = <0x01c22c00 0x40>;
2151 + interrupts = <30>;
2152 + clocks = <&apb0_gates 0>, <&codec_clk>;
2153 + clock-names = "apb", "codec";
2154 + dmas = <&dma SUN4I_DMA_NORMAL 19>,
2155 + <&dma SUN4I_DMA_NORMAL 19>;
2156 + dma-names = "rx", "tx";
2157 + status = "disabled";
2158 + };
2159 +
2160 sid: eeprom@01c23800 {
2161 compatible = "allwinner,sun4i-a10-sid";
2162 reg = <0x01c23800 0x10>;
2163 --- a/arch/arm/dts/sun6i-a31-colombus.dts
2164 +++ b/arch/arm/dts/sun6i-a31-colombus.dts
2165 @@ -60,6 +60,16 @@
2166 chosen {
2167 stdout-path = "serial0:115200n8";
2168 };
2169 +
2170 + i2c_lcd: i2c@0 {
2171 + /* The lcd panel i2c interface is hooked up via gpios */
2172 + compatible = "i2c-gpio";
2173 + pinctrl-names = "default";
2174 + pinctrl-0 = <&i2c_lcd_pins>;
2175 + gpios = <&pio 0 23 GPIO_ACTIVE_HIGH>, /* PA23, sda */
2176 + <&pio 0 24 GPIO_ACTIVE_HIGH>; /* PA24, scl */
2177 + i2c-gpio,delay-us = <5>;
2178 + };
2179 };
2180
2181 &ehci1 {
2182 @@ -94,6 +104,13 @@
2183 pinctrl-names = "default";
2184 pinctrl-0 = <&i2c2_pins_a>;
2185 status = "okay";
2186 +
2187 + mma8452: mma8452@1d {
2188 + compatible = "fsl,mma8452";
2189 + reg = <0x1d>;
2190 + interrupt-parent = <&pio>;
2191 + interrupts = <0 9 IRQ_TYPE_LEVEL_LOW>; /* PA9 */
2192 + };
2193 };
2194
2195 &mmc0 {
2196 @@ -124,6 +141,13 @@
2197 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
2198 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
2199 };
2200 +
2201 + i2c_lcd_pins: i2c_lcd_pin@0 {
2202 + allwinner,pins = "PA23", "PA24";
2203 + allwinner,function = "gpio_out";
2204 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
2205 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
2206 + };
2207 };
2208
2209 &reg_usb2_vbus {
2210 --- a/arch/arm/dts/sun6i-a31-hummingbird.dts
2211 +++ b/arch/arm/dts/sun6i-a31-hummingbird.dts
2212 @@ -54,6 +54,8 @@
2213 compatible = "merrii,a31-hummingbird", "allwinner,sun6i-a31";
2214
2215 aliases {
2216 + rtc0 = &pcf8563;
2217 + rtc1 = &rtc;
2218 serial0 = &uart0;
2219 };
2220
2221 @@ -67,13 +69,17 @@
2222 };
2223 };
2224
2225 +&cpu0 {
2226 + cpu-supply = <&reg_dcdc3>;
2227 +};
2228 +
2229 &ehci0 {
2230 status = "okay";
2231 };
2232
2233 &gmac {
2234 pinctrl-names = "default";
2235 - pinctrl-0 = <&gmac_pins_rgmii_a>;
2236 + pinctrl-0 = <&gmac_pins_rgmii_a>, <&gmac_phy_reset_pin_hummingbird>;
2237 phy = <&phy1>;
2238 phy-mode = "rgmii";
2239 snps,reset-gpio = <&pio 0 21 GPIO_ACTIVE_HIGH>;
2240 @@ -119,7 +125,7 @@
2241 &mmc0 {
2242 pinctrl-names = "default";
2243 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_hummingbird>;
2244 - vmmc-supply = <&vcc_3v0>;
2245 + vmmc-supply = <&reg_dcdc1>;
2246 bus-width = <4>;
2247 cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */
2248 cd-inverted;
2249 @@ -134,7 +140,7 @@
2250 &mmc1 {
2251 pinctrl-names = "default";
2252 pinctrl-0 = <&mmc1_pins_a>, <&wifi_reset_pin_hummingbird>;
2253 - vmmc-supply = <&vcc_wifi>;
2254 + vmmc-supply = <&reg_aldo1>;
2255 mmc-pwrseq = <&wifi_pwrseq>;
2256 bus-width = <4>;
2257 non-removable;
2258 @@ -146,6 +152,13 @@
2259 };
2260
2261 &pio {
2262 + gmac_phy_reset_pin_hummingbird: gmac_phy_reset_pin@0 {
2263 + allwinner,pins = "PA21";
2264 + allwinner,function = "gpio_out";
2265 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
2266 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
2267 + };
2268 +
2269 mmc0_cd_pin_hummingbird: mmc0_cd_pin@0 {
2270 allwinner,pins = "PA8";
2271 allwinner,function = "gpio_in";
2272 @@ -164,70 +177,69 @@
2273 &p2wi {
2274 status = "okay";
2275
2276 - axp221: pmic@68 {
2277 + axp22x: pmic@68 {
2278 compatible = "x-powers,axp221";
2279 reg = <0x68>;
2280 interrupt-parent = <&nmi_intc>;
2281 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
2282 - interrupt-controller;
2283 - #interrupt-cells = <1>;
2284 - dcdc1-supply = <&vcc_3v0>;
2285 - dcdc5-supply = <&vcc_dram>;
2286 -
2287 - regulators {
2288 - x-powers,dcdc-freq = <3000>;
2289 -
2290 - vcc_3v0: dcdc1 {
2291 - regulator-always-on;
2292 - regulator-min-microvolt = <3000000>;
2293 - regulator-max-microvolt = <3000000>;
2294 - regulator-name = "vcc-3v0";
2295 - };
2296 -
2297 - vdd_cpu: dcdc2 {
2298 - regulator-always-on;
2299 - regulator-min-microvolt = <700000>;
2300 - regulator-max-microvolt = <1320000>;
2301 - regulator-name = "vdd-cpu";
2302 - };
2303 -
2304 - vdd_gpu: dcdc3 {
2305 - regulator-always-on;
2306 - regulator-min-microvolt = <700000>;
2307 - regulator-max-microvolt = <1320000>;
2308 - regulator-name = "vdd-gpu";
2309 - };
2310 -
2311 - vdd_sys_dll: dcdc4 {
2312 - regulator-always-on;
2313 - regulator-min-microvolt = <1100000>;
2314 - regulator-max-microvolt = <1100000>;
2315 - regulator-name = "vdd-sys-dll";
2316 - };
2317 -
2318 - vcc_dram: dcdc5 {
2319 - regulator-always-on;
2320 - regulator-min-microvolt = <1500000>;
2321 - regulator-max-microvolt = <1500000>;
2322 - regulator-name = "vcc-dram";
2323 - };
2324 -
2325 - vcc_wifi: aldo1 {
2326 - regulator-min-microvolt = <3300000>;
2327 - regulator-max-microvolt = <3300000>;
2328 - regulator-name = "vcc_wifi";
2329 - };
2330 -
2331 - avcc: aldo3 {
2332 - regulator-always-on;
2333 - regulator-min-microvolt = <3000000>;
2334 - regulator-max-microvolt = <3000000>;
2335 - regulator-name = "avcc";
2336 - };
2337 - };
2338 };
2339 };
2340
2341 +#include "axp22x.dtsi"
2342 +
2343 +&reg_aldo1 {
2344 + regulator-min-microvolt = <3300000>;
2345 + regulator-max-microvolt = <3300000>;
2346 + regulator-name = "vcc-wifi";
2347 +};
2348 +
2349 +&reg_aldo3 {
2350 + regulator-always-on;
2351 + regulator-min-microvolt = <2700000>;
2352 + regulator-max-microvolt = <3300000>;
2353 + regulator-name = "avcc";
2354 +};
2355 +
2356 +&reg_dc5ldo {
2357 + regulator-min-microvolt = <700000>;
2358 + regulator-max-microvolt = <1320000>;
2359 + regulator-name = "vdd-cpus";
2360 +};
2361 +
2362 +&reg_dcdc1 {
2363 + regulator-always-on;
2364 + regulator-min-microvolt = <3000000>;
2365 + regulator-max-microvolt = <3000000>;
2366 + regulator-name = "vcc-3v0";
2367 +};
2368 +
2369 +&reg_dcdc2 {
2370 + regulator-min-microvolt = <700000>;
2371 + regulator-max-microvolt = <1320000>;
2372 + regulator-name = "vdd-gpu";
2373 +};
2374 +
2375 +&reg_dcdc3 {
2376 + regulator-always-on;
2377 + regulator-min-microvolt = <700000>;
2378 + regulator-max-microvolt = <1320000>;
2379 + regulator-name = "vdd-cpu";
2380 +};
2381 +
2382 +&reg_dcdc4 {
2383 + regulator-always-on;
2384 + regulator-min-microvolt = <700000>;
2385 + regulator-max-microvolt = <1320000>;
2386 + regulator-name = "vdd-sys-dll";
2387 +};
2388 +
2389 +&reg_dcdc5 {
2390 + regulator-always-on;
2391 + regulator-min-microvolt = <1500000>;
2392 + regulator-max-microvolt = <1500000>;
2393 + regulator-name = "vcc-dram";
2394 +};
2395 +
2396 &reg_usb1_vbus {
2397 gpio = <&pio 7 24 GPIO_ACTIVE_HIGH>; /* PH24 */
2398 status = "okay";
2399 --- a/arch/arm/dts/sun6i-a31.dtsi
2400 +++ b/arch/arm/dts/sun6i-a31.dtsi
2401 @@ -61,7 +61,7 @@
2402 #size-cells = <1>;
2403 ranges;
2404
2405 - framebuffer@0 {
2406 + simplefb_hdmi: framebuffer@0 {
2407 compatible = "allwinner,simple-framebuffer",
2408 "simple-framebuffer";
2409 allwinner,pipeline = "de_be0-lcd0-hdmi";
2410 @@ -69,7 +69,7 @@
2411 status = "disabled";
2412 };
2413
2414 - framebuffer@1 {
2415 + simplefb_lcd: framebuffer@1 {
2416 compatible = "allwinner,simple-framebuffer",
2417 "simple-framebuffer";
2418 allwinner,pipeline = "de_be0-lcd0";
2419 @@ -252,6 +252,20 @@
2420 compatible = "allwinner,sun6i-a31-ahb1-gates-clk";
2421 reg = <0x01c20060 0x8>;
2422 clocks = <&ahb1>;
2423 + clock-indices = <1>, <5>,
2424 + <6>, <8>, <9>,
2425 + <10>, <11>, <12>,
2426 + <13>, <14>,
2427 + <17>, <18>, <19>,
2428 + <20>, <21>, <22>,
2429 + <23>, <24>, <26>,
2430 + <27>, <29>,
2431 + <30>, <31>, <32>,
2432 + <36>, <37>, <40>,
2433 + <43>, <44>, <45>,
2434 + <46>, <47>, <50>,
2435 + <52>, <55>, <56>,
2436 + <57>, <58>;
2437 clock-output-names = "ahb1_mipidsi", "ahb1_ss",
2438 "ahb1_dma", "ahb1_mmc0", "ahb1_mmc1",
2439 "ahb1_mmc2", "ahb1_mmc3", "ahb1_nand1",
2440 @@ -281,6 +295,9 @@
2441 compatible = "allwinner,sun6i-a31-apb1-gates-clk";
2442 reg = <0x01c20068 0x4>;
2443 clocks = <&apb1>;
2444 + clock-indices = <0>, <4>,
2445 + <5>, <12>,
2446 + <13>;
2447 clock-output-names = "apb1_codec", "apb1_digital_mic",
2448 "apb1_pio", "apb1_daudio0",
2449 "apb1_daudio1";
2450 @@ -299,6 +316,10 @@
2451 compatible = "allwinner,sun6i-a31-apb2-gates-clk";
2452 reg = <0x01c2006c 0x4>;
2453 clocks = <&apb2>;
2454 + clock-indices = <0>, <1>,
2455 + <2>, <3>, <16>,
2456 + <17>, <18>, <19>,
2457 + <20>, <21>;
2458 clock-output-names = "apb2_i2c0", "apb2_i2c1",
2459 "apb2_i2c2", "apb2_i2c3",
2460 "apb2_uart0", "apb2_uart1",
2461 @@ -346,6 +367,14 @@
2462 "mmc3_sample";
2463 };
2464
2465 + ss_clk: clk@01c2009c {
2466 + #clock-cells = <0>;
2467 + compatible = "allwinner,sun4i-a10-mod0-clk";
2468 + reg = <0x01c2009c 0x4>;
2469 + clocks = <&osc24M>, <&pll6 0>;
2470 + clock-output-names = "ss";
2471 + };
2472 +
2473 spi0_clk: clk@01c200a0 {
2474 #clock-cells = <0>;
2475 compatible = "allwinner,sun4i-a10-mod0-clk";
2476 @@ -384,6 +413,9 @@
2477 compatible = "allwinner,sun6i-a31-usb-clk";
2478 reg = <0x01c200cc 0x4>;
2479 clocks = <&osc24M>;
2480 + clock-indices = <8>, <9>, <10>,
2481 + <16>, <17>,
2482 + <18>;
2483 clock-output-names = "usb_phy0", "usb_phy1", "usb_phy2",
2484 "usb_ohci0", "usb_ohci1",
2485 "usb_ohci2";
2486 @@ -684,6 +716,16 @@
2487 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
2488 };
2489
2490 + mmc3_8bit_emmc_pins: mmc3@1 {
2491 + allwinner,pins = "PC6", "PC7", "PC8", "PC9",
2492 + "PC10", "PC11", "PC12",
2493 + "PC13", "PC14", "PC15",
2494 + "PC24";
2495 + allwinner,function = "mmc3";
2496 + allwinner,drive = <SUN4I_PINCTRL_40_MA>;
2497 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
2498 + };
2499 +
2500 gmac_pins_mii_a: gmac_mii@0 {
2501 allwinner,pins = "PA0", "PA1", "PA2", "PA3",
2502 "PA8", "PA9", "PA11",
2503 @@ -761,6 +803,13 @@
2504 reg = <0x01c20ca0 0x20>;
2505 };
2506
2507 + lradc: lradc@01c22800 {
2508 + compatible = "allwinner,sun4i-a10-lradc-keys";
2509 + reg = <0x01c22800 0x100>;
2510 + interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
2511 + status = "disabled";
2512 + };
2513 +
2514 rtp: rtp@01c25000 {
2515 compatible = "allwinner,sun6i-a31-ts";
2516 reg = <0x01c25000 0x100>;
2517 @@ -907,6 +956,16 @@
2518 #size-cells = <0>;
2519 };
2520
2521 + crypto: crypto-engine@01c15000 {
2522 + compatible = "allwinner,sun4i-a10-crypto";
2523 + reg = <0x01c15000 0x1000>;
2524 + interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>;
2525 + clocks = <&ahb1_gates 5>, <&ss_clk>;
2526 + clock-names = "ahb", "mod";
2527 + resets = <&ahb1_rst 5>;
2528 + reset-names = "ahb";
2529 + };
2530 +
2531 timer@01c60000 {
2532 compatible = "allwinner,sun6i-a31-hstimer",
2533 "allwinner,sun7i-a20-hstimer";
2534 @@ -1068,7 +1127,7 @@
2535 resets = <&apb0_rst 0>;
2536 gpio-controller;
2537 interrupt-controller;
2538 - #interrupt-cells = <2>;
2539 + #interrupt-cells = <3>;
2540 #size-cells = <0>;
2541 #gpio-cells = <3>;
2542
2543 --- a/arch/arm/dts/sun6i-a31s-primo81.dts
2544 +++ b/arch/arm/dts/sun6i-a31s-primo81.dts
2545 @@ -1,16 +1,57 @@
2546 /*
2547 - * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
2548 + * Copyright 2014 Siarhei Siamashka <siarhei.siamashka@gmail.com>
2549 + * Copyright 2015 Karsten Merker <merker@debian.org>
2550 + * Copyright 2015 Chen-Yu Tsai <wens@csie.org>
2551 *
2552 - * Minimal dts file for the MSI Primo81 for u-boot only
2553 + * This file is dual-licensed: you can use it either under the terms
2554 + * of the GPL or the X11 license, at your option. Note that this dual
2555 + * licensing only applies to this file, and not this project as a
2556 + * whole.
2557 *
2558 - * SPDX-License-Identifier: GPL-2.0+ or X11
2559 + * a) This file is free software; you can redistribute it and/or
2560 + * modify it under the terms of the GNU General Public License as
2561 + * published by the Free Software Foundation; either version 2 of the
2562 + * License, or (at your option) any later version.
2563 + *
2564 + * This file is distributed in the hope that it will be useful,
2565 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2566 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2567 + * GNU General Public License for more details.
2568 + *
2569 + * Or, alternatively,
2570 + *
2571 + * b) Permission is hereby granted, free of charge, to any person
2572 + * obtaining a copy of this software and associated documentation
2573 + * files (the "Software"), to deal in the Software without
2574 + * restriction, including without limitation the rights to use,
2575 + * copy, modify, merge, publish, distribute, sublicense, and/or
2576 + * sell copies of the Software, and to permit persons to whom the
2577 + * Software is furnished to do so, subject to the following
2578 + * conditions:
2579 + *
2580 + * The above copyright notice and this permission notice shall be
2581 + * included in all copies or substantial portions of the Software.
2582 + *
2583 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
2584 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
2585 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
2586 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
2587 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
2588 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2589 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2590 + * OTHER DEALINGS IN THE SOFTWARE.
2591 */
2592
2593 /dts-v1/;
2594 #include "sun6i-a31s.dtsi"
2595 +#include "sunxi-common-regulators.dtsi"
2596 +
2597 +#include <dt-bindings/gpio/gpio.h>
2598 +#include <dt-bindings/input/input.h>
2599 +#include <dt-bindings/pinctrl/sun4i-a10.h>
2600
2601 / {
2602 - model = "MSI Primo81";
2603 + model = "MSI Primo81 tablet";
2604 compatible = "msi,primo81", "allwinner,sun6i-a31s";
2605
2606 aliases {
2607 @@ -22,8 +63,202 @@
2608 };
2609 };
2610
2611 -&uart0 {
2612 +&cpu0 {
2613 + cpu-supply = <&reg_dcdc3>;
2614 +};
2615 +
2616 +&ehci0 {
2617 + /* rtl8188etv wifi is connected here */
2618 + status = "okay";
2619 +};
2620 +
2621 +&i2c0 {
2622 + /* pull-ups and device VDDIO use AXP221 DLDO3 */
2623 + pinctrl-names = "default";
2624 + pinctrl-0 = <&i2c0_pins_a>;
2625 + status = "failed";
2626 +};
2627 +
2628 +&i2c1 {
2629 + pinctrl-names = "default";
2630 + pinctrl-0 = <&i2c1_pins_a>;
2631 + status = "okay";
2632 +
2633 + ctp@5d {
2634 + pinctrl-names = "default";
2635 + pinctrl-0 = <&gt911_int_primo81>;
2636 + compatible = "goodix,gt911";
2637 + reg = <0x5d>;
2638 + interrupt-parent = <&pio>;
2639 + interrupts = <0 3 IRQ_TYPE_LEVEL_HIGH>; /* PA3 */
2640 + touchscreen-swapped-x-y;
2641 + };
2642 +};
2643 +
2644 +&i2c2 {
2645 pinctrl-names = "default";
2646 - pinctrl-0 = <&uart0_pins_a>;
2647 + pinctrl-0 = <&i2c2_pins_a>;
2648 + status = "okay";
2649 +
2650 + accelerometer@1c {
2651 + pinctrl-names = "default";
2652 + pinctrl-0 = <&mma8452_int_primo81>;
2653 + compatible = "fsl,mma8452";
2654 + reg = <0x1c>;
2655 + interrupt-parent = <&pio>;
2656 + interrupts = <0 9 IRQ_TYPE_LEVEL_HIGH>; /* PA9 */
2657 + #io-channel-cells = <1>;
2658 + };
2659 +};
2660 +
2661 +&lradc {
2662 + vref-supply = <&reg_aldo3>;
2663 + status = "okay";
2664 +
2665 + button@158 {
2666 + label = "Volume Up";
2667 + linux,code = <KEY_VOLUMEUP>;
2668 + channel = <0>;
2669 + voltage = <158730>;
2670 + };
2671 +
2672 + button@349 {
2673 + label = "Volume Down";
2674 + linux,code = <KEY_VOLUMEDOWN>;
2675 + channel = <0>;
2676 + voltage = <349206>;
2677 + };
2678 +};
2679 +
2680 +&mmc0 {
2681 + pinctrl-names = "default";
2682 + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_primo81>;
2683 + vmmc-supply = <&reg_dcdc1>;
2684 + bus-width = <4>;
2685 + cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */
2686 + cd-inverted;
2687 + status = "okay";
2688 +};
2689 +
2690 +&pio {
2691 + gt911_int_primo81: gt911_int_pin@0 {
2692 + allwinner,pins = "PA3";
2693 + allwinner,function = "gpio_in";
2694 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
2695 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
2696 + };
2697 +
2698 + mma8452_int_primo81: mma8452_int_pin@0 {
2699 + allwinner,pins = "PA9";
2700 + allwinner,function = "gpio_in";
2701 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
2702 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
2703 + };
2704 +
2705 + mmc0_cd_pin_primo81: mmc0_cd_pin@0 {
2706 + allwinner,pins = "PA8";
2707 + allwinner,function = "gpio_in";
2708 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
2709 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
2710 + };
2711 +};
2712 +
2713 +&p2wi {
2714 + status = "okay";
2715 +
2716 + axp22x: pmic@68 {
2717 + compatible = "x-powers,axp221";
2718 + reg = <0x68>;
2719 + interrupt-parent = <&nmi_intc>;
2720 + interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
2721 + };
2722 +};
2723 +
2724 +#include "axp22x.dtsi"
2725 +
2726 +&reg_aldo3 {
2727 + regulator-always-on;
2728 + regulator-min-microvolt = <2700000>;
2729 + regulator-max-microvolt = <3300000>;
2730 + regulator-name = "avcc";
2731 +};
2732 +
2733 +&reg_dc1sw {
2734 + regulator-min-microvolt = <3000000>;
2735 + regulator-max-microvolt = <3000000>;
2736 + regulator-name = "vcc-lcd";
2737 +};
2738 +
2739 +&reg_dc5ldo {
2740 + regulator-min-microvolt = <700000>;
2741 + regulator-max-microvolt = <1320000>;
2742 + regulator-name = "vdd-cpus"; /* This is an educated guess */
2743 +};
2744 +
2745 +&reg_dcdc1 {
2746 + regulator-always-on;
2747 + regulator-min-microvolt = <3000000>;
2748 + regulator-max-microvolt = <3000000>;
2749 + regulator-name = "vcc-3v0";
2750 +};
2751 +
2752 +&reg_dcdc2 {
2753 + regulator-min-microvolt = <700000>;
2754 + regulator-max-microvolt = <1320000>;
2755 + regulator-name = "vdd-gpu";
2756 +};
2757 +
2758 +&reg_dcdc3 {
2759 + regulator-always-on;
2760 + regulator-min-microvolt = <700000>;
2761 + regulator-max-microvolt = <1320000>;
2762 + regulator-name = "vdd-cpu";
2763 +};
2764 +
2765 +&reg_dcdc4 {
2766 + regulator-always-on;
2767 + regulator-min-microvolt = <700000>;
2768 + regulator-max-microvolt = <1320000>;
2769 + regulator-name = "vdd-sys-dll";
2770 +};
2771 +
2772 +&reg_dcdc5 {
2773 + regulator-always-on;
2774 + regulator-min-microvolt = <1500000>;
2775 + regulator-max-microvolt = <1500000>;
2776 + regulator-name = "vcc-dram";
2777 +};
2778 +
2779 +&reg_dldo1 {
2780 + regulator-min-microvolt = <3300000>;
2781 + regulator-max-microvolt = <3300000>;
2782 + regulator-name = "vcc-wifi";
2783 +};
2784 +
2785 +&reg_dldo3 {
2786 + regulator-min-microvolt = <2800000>;
2787 + regulator-max-microvolt = <2800000>;
2788 + regulator-name = "vddio-csi";
2789 +};
2790 +
2791 +&reg_eldo3 {
2792 + regulator-min-microvolt = <1080000>;
2793 + regulator-max-microvolt = <1320000>;
2794 + regulator-name = "vdd-mipi-bridge";
2795 +};
2796 +
2797 +&simplefb_lcd {
2798 + vcc-lcd-supply = <&reg_dc1sw>;
2799 + vdd-mipi-bridge-supply = <&reg_eldo3>;
2800 +};
2801 +
2802 +&usb_otg {
2803 + /* otg support requires support for AXP221 usb-power-supply and GPIO */
2804 + dr_mode = "host";
2805 + status = "okay";
2806 +};
2807 +
2808 +&usbphy {
2809 + usb1_vbus-supply = <&reg_dldo1>;
2810 status = "okay";
2811 };
2812 --- /dev/null
2813 +++ b/arch/arm/dts/sun6i-a31s-sina31s-core.dtsi
2814 @@ -0,0 +1,142 @@
2815 +/*
2816 + * Copyright 2015 Chen-Yu Tsai <wens@csie.org>
2817 + *
2818 + * This file is dual-licensed: you can use it either under the terms
2819 + * of the GPL or the X11 license, at your option. Note that this dual
2820 + * licensing only applies to this file, and not this project as a
2821 + * whole.
2822 + *
2823 + * a) This file is free software; you can redistribute it and/or
2824 + * modify it under the terms of the GNU General Public License as
2825 + * published by the Free Software Foundation; either version 2 of the
2826 + * License, or (at your option) any later version.
2827 + *
2828 + * This file is distributed in the hope that it will be useful,
2829 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2830 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2831 + * GNU General Public License for more details.
2832 + *
2833 + * Or, alternatively,
2834 + *
2835 + * b) Permission is hereby granted, free of charge, to any person
2836 + * obtaining a copy of this software and associated documentation
2837 + * files (the "Software"), to deal in the Software without
2838 + * restriction, including without limitation the rights to use,
2839 + * copy, modify, merge, publish, distribute, sublicense, and/or
2840 + * sell copies of the Software, and to permit persons to whom the
2841 + * Software is furnished to do so, subject to the following
2842 + * conditions:
2843 + *
2844 + * The above copyright notice and this permission notice shall be
2845 + * included in all copies or substantial portions of the Software.
2846 + *
2847 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
2848 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
2849 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
2850 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
2851 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
2852 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2853 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2854 + * OTHER DEALINGS IN THE SOFTWARE.
2855 + */
2856 +
2857 +/dts-v1/;
2858 +#include "sun6i-a31s.dtsi"
2859 +#include "sunxi-common-regulators.dtsi"
2860 +
2861 +#include <dt-bindings/gpio/gpio.h>
2862 +#include <dt-bindings/pinctrl/sun4i-a10.h>
2863 +
2864 +/ {
2865 + model = "Sinlinx SinA31s Core Board";
2866 + compatible = "sinlinx,sina31s", "allwinner,sun6i-a31s";
2867 +
2868 + aliases {
2869 + serial0 = &uart0;
2870 + };
2871 +};
2872 +
2873 +&cpu0 {
2874 + cpu-supply = <&reg_dcdc3>;
2875 +};
2876 +
2877 +/* eMMC on core board */
2878 +&mmc3 {
2879 + pinctrl-names = "default";
2880 + pinctrl-0 = <&mmc3_8bit_emmc_pins>;
2881 + vmmc-supply = <&reg_dcdc1>;
2882 + vqmmc-supply = <&reg_dcdc1>;
2883 + bus-width = <8>;
2884 + non-removable;
2885 + cap-mmc-hw-reset;
2886 + status = "okay";
2887 +};
2888 +
2889 +/* AXP221s PMIC on core board */
2890 +&p2wi {
2891 + status = "okay";
2892 +
2893 + axp22x: pmic@68 {
2894 + compatible = "x-powers,axp221";
2895 + reg = <0x68>;
2896 + interrupt-parent = <&nmi_intc>;
2897 + interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
2898 + };
2899 +};
2900 +
2901 +#include "axp22x.dtsi"
2902 +
2903 +&reg_aldo3 {
2904 + regulator-always-on;
2905 + regulator-min-microvolt = <2700000>;
2906 + regulator-max-microvolt = <3300000>;
2907 + regulator-name = "avcc";
2908 +};
2909 +
2910 +&reg_dc5ldo {
2911 + regulator-min-microvolt = <700000>;
2912 + regulator-max-microvolt = <1320000>;
2913 + regulator-name = "vdd-cpus";
2914 +};
2915 +
2916 +&reg_dcdc1 {
2917 + regulator-always-on;
2918 + regulator-min-microvolt = <3000000>;
2919 + regulator-max-microvolt = <3000000>;
2920 + regulator-name = "vcc-3v0";
2921 +};
2922 +
2923 +&reg_dcdc2 {
2924 + regulator-min-microvolt = <700000>;
2925 + regulator-max-microvolt = <1320000>;
2926 + regulator-name = "vdd-gpu";
2927 +};
2928 +
2929 +&reg_dcdc3 {
2930 + regulator-always-on;
2931 + regulator-min-microvolt = <700000>;
2932 + regulator-max-microvolt = <1320000>;
2933 + regulator-name = "vdd-cpu";
2934 +};
2935 +
2936 +&reg_dcdc4 {
2937 + regulator-always-on;
2938 + regulator-min-microvolt = <700000>;
2939 + regulator-max-microvolt = <1320000>;
2940 + regulator-name = "vdd-sys-dll";
2941 +};
2942 +
2943 +&reg_dcdc5 {
2944 + regulator-always-on;
2945 + regulator-min-microvolt = <1500000>;
2946 + regulator-max-microvolt = <1500000>;
2947 + regulator-name = "vcc-dram";
2948 +};
2949 +
2950 +/* UART0 pads available on core board */
2951 +&uart0 {
2952 + pinctrl-names = "default";
2953 + pinctrl-0 = <&uart0_pins_a>;
2954 + status = "okay";
2955 +};
2956 +
2957 --- /dev/null
2958 +++ b/arch/arm/dts/sun6i-a31s-sina31s.dts
2959 @@ -0,0 +1,153 @@
2960 +/*
2961 + * Copyright 2015 Chen-Yu Tsai <wens@csie.org>
2962 + *
2963 + * This file is dual-licensed: you can use it either under the terms
2964 + * of the GPL or the X11 license, at your option. Note that this dual
2965 + * licensing only applies to this file, and not this project as a
2966 + * whole.
2967 + *
2968 + * a) This file is free software; you can redistribute it and/or
2969 + * modify it under the terms of the GNU General Public License as
2970 + * published by the Free Software Foundation; either version 2 of the
2971 + * License, or (at your option) any later version.
2972 + *
2973 + * This file is distributed in the hope that it will be useful,
2974 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2975 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2976 + * GNU General Public License for more details.
2977 + *
2978 + * Or, alternatively,
2979 + *
2980 + * b) Permission is hereby granted, free of charge, to any person
2981 + * obtaining a copy of this software and associated documentation
2982 + * files (the "Software"), to deal in the Software without
2983 + * restriction, including without limitation the rights to use,
2984 + * copy, modify, merge, publish, distribute, sublicense, and/or
2985 + * sell copies of the Software, and to permit persons to whom the
2986 + * Software is furnished to do so, subject to the following
2987 + * conditions:
2988 + *
2989 + * The above copyright notice and this permission notice shall be
2990 + * included in all copies or substantial portions of the Software.
2991 + *
2992 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
2993 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
2994 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
2995 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
2996 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
2997 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2998 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2999 + * OTHER DEALINGS IN THE SOFTWARE.
3000 + */
3001 +
3002 +/* The SinA31s development board has the SinA31s core board soldered on */
3003 +#include "sun6i-a31s-sina31s-core.dtsi"
3004 +
3005 +#include <dt-bindings/input/input.h>
3006 +
3007 +/ {
3008 + model = "Sinlinx SinA31s Development Board";
3009 + compatible = "sinlinx,sina31s-sdk", "allwinner,sun6i-a31s";
3010 +
3011 + chosen {
3012 + stdout-path = "serial0:115200n8";
3013 + };
3014 +
3015 + leds {
3016 + compatible = "gpio-leds";
3017 + pinctrl-names = "default";
3018 + pinctrl-0 = <&led_pin_sina31s>;
3019 +
3020 + status {
3021 + label = "sina31s:status:usr";
3022 + gpios = <&pio 7 13 GPIO_ACTIVE_HIGH>; /* PH13 */
3023 + };
3024 + };
3025 +};
3026 +
3027 +&ehci0 {
3028 + /* USB 2.0 4 port hub IC */
3029 + status = "okay";
3030 +};
3031 +
3032 +&ehci1 {
3033 + status = "okay";
3034 +};
3035 +
3036 +&gmac {
3037 + pinctrl-names = "default";
3038 + pinctrl-0 = <&gmac_pins_mii_a>;
3039 + phy = <&phy1>;
3040 + phy-mode = "mii";
3041 + phy-supply = <&reg_dldo1>;
3042 + status = "okay";
3043 +
3044 + phy1: ethernet-phy@1 {
3045 + reg = <1>;
3046 + };
3047 +};
3048 +
3049 +&ir {
3050 + pinctrl-names = "default";
3051 + pinctrl-0 = <&ir_pins_a>;
3052 + status = "okay";
3053 +};
3054 +
3055 +&lradc {
3056 + vref-supply = <&reg_aldo3>;
3057 + status = "okay";
3058 +
3059 + button@158 {
3060 + label = "Volume Up";
3061 + linux,code = <KEY_VOLUMEUP>;
3062 + channel = <0>;
3063 + voltage = <158730>;
3064 + };
3065 +
3066 + button@349 {
3067 + label = "Volume Down";
3068 + linux,code = <KEY_VOLUMEDOWN>;
3069 + channel = <0>;
3070 + voltage = <349206>;
3071 + };
3072 +};
3073 +
3074 +&mmc0 {
3075 + pinctrl-names = "default";
3076 + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_sina31s>;
3077 + vmmc-supply = <&reg_dcdc1>;
3078 + bus-width = <4>;
3079 + cd-gpios = <&pio 0 4 GPIO_ACTIVE_HIGH>; /* PA4 */
3080 + cd-inverted;
3081 + status = "okay";
3082 +};
3083 +
3084 +&ohci1 {
3085 + status = "okay";
3086 +};
3087 +
3088 +&pio {
3089 + led_pin_sina31s: led_pin@0 {
3090 + allwinner,pins = "PH13";
3091 + allwinner,function = "gpio_out";
3092 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
3093 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
3094 + };
3095 +
3096 + mmc0_cd_pin_sina31s: mmc0_cd_pin@0 {
3097 + allwinner,pins = "PA4";
3098 + allwinner,function = "gpio_in";
3099 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
3100 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
3101 + };
3102 +};
3103 +
3104 +&reg_dldo1 {
3105 + regulator-min-microvolt = <3300000>;
3106 + regulator-max-microvolt = <3300000>;
3107 + regulator-name = "vcc-gmac-phy";
3108 +};
3109 +
3110 +&usbphy {
3111 + status = "okay";
3112 +};
3113 --- /dev/null
3114 +++ b/arch/arm/dts/sun6i-a31s-yones-toptech-bs1078-v2.dts
3115 @@ -0,0 +1,205 @@
3116 +/*
3117 + * Copyright 2015 Lawrence Yu <lyu@micile.com>
3118 + *
3119 + * This file is dual-licensed: you can use it either under the terms
3120 + * of the GPL or the X11 license, at your option. Note that this dual
3121 + * licensing only applies to this file, and not this project as a
3122 + * whole.
3123 + *
3124 + * a) This file is free software; you can redistribute it and/or
3125 + * modify it under the terms of the GNU General Public License as
3126 + * published by the Free Software Foundation; either version 2 of the
3127 + * License, or (at your option) any later version.
3128 + *
3129 + * This file is distributed in the hope that it will be useful,
3130 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
3131 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3132 + * GNU General Public License for more details.
3133 + *
3134 + * Or, alternatively,
3135 + *
3136 + * b) Permission is hereby granted, free of charge, to any person
3137 + * obtaining a copy of this software and associated documentation
3138 + * files (the "Software"), to deal in the Software without
3139 + * restriction, including without limitation the rights to use,
3140 + * copy, modify, merge, publish, distribute, sublicense, and/or
3141 + * sell copies of the Software, and to permit persons to whom the
3142 + * Software is furnished to do so, subject to the following
3143 + * conditions:
3144 + *
3145 + * The above copyright notice and this permission notice shall be
3146 + * included in all copies or substantial portions of the Software.
3147 + *
3148 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
3149 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
3150 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
3151 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
3152 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
3153 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
3154 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
3155 + * OTHER DEALINGS IN THE SOFTWARE.
3156 + */
3157 +
3158 +/dts-v1/;
3159 +#include "sun6i-a31s.dtsi"
3160 +#include "sunxi-common-regulators.dtsi"
3161 +
3162 +#include <dt-bindings/gpio/gpio.h>
3163 +#include <dt-bindings/pinctrl/sun4i-a10.h>
3164 +
3165 +/ {
3166 + model = "Yones TopTech BS1078 v2 Tablet";
3167 + compatible = "yones-toptech,bs1078-v2", "allwinner,sun6i-a31s";
3168 +
3169 + aliases {
3170 + serial0 = &uart0;
3171 + i2c1 = &i2c1;
3172 + i2c2 = &i2c2;
3173 + };
3174 +
3175 + chosen {
3176 + stdout-path = "serial0:115200n8";
3177 + };
3178 +};
3179 +
3180 +&i2c1 {
3181 + pinctrl-names = "default";
3182 + pinctrl-0 = <&i2c1_pins_a>;
3183 + status = "okay";
3184 +};
3185 +
3186 +&i2c2 {
3187 + pinctrl-names = "default";
3188 + pinctrl-0 = <&i2c2_pins_a>;
3189 + status = "okay";
3190 +};
3191 +
3192 +&ehci0 {
3193 + status = "okay";
3194 +};
3195 +
3196 +&ehci1 {
3197 + status = "okay";
3198 +};
3199 +
3200 +&ohci0 {
3201 + status = "okay";
3202 +};
3203 +
3204 +&ohci1 {
3205 + status = "okay";
3206 +};
3207 +
3208 +&pio {
3209 + mmc0_cd_pin_bs1078v2: mmc0_cd_pin@0 {
3210 + allwinner,pins = "PA8";
3211 + allwinner,function = "gpio_in";
3212 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
3213 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
3214 + };
3215 +};
3216 +
3217 +&mmc0 {
3218 + pinctrl-names = "default";
3219 + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bs1078v2>;
3220 + vmmc-supply = <&reg_vcc3v0>;
3221 + bus-width = <4>;
3222 + cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */
3223 + cd-inverted;
3224 + status = "okay";
3225 +};
3226 +
3227 +&mmc0_pins_a {
3228 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
3229 +};
3230 +
3231 +&p2wi {
3232 + status = "okay";
3233 +
3234 + axp22x: pmic@68 {
3235 + compatible = "x-powers,axp221";
3236 + reg = <0x68>;
3237 + interrupt-parent = <&nmi_intc>;
3238 + interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
3239 + };
3240 +};
3241 +
3242 +#include "axp22x.dtsi"
3243 +
3244 +&reg_aldo3 {
3245 + regulator-always-on;
3246 + regulator-min-microvolt = <2700000>;
3247 + regulator-max-microvolt = <3300000>;
3248 + regulator-name = "avcc";
3249 +};
3250 +
3251 +&reg_dc1sw {
3252 + regulator-name = "vcc-lcd-usb2";
3253 + regulator-min-microvolt = <3000000>;
3254 + regulator-max-microvolt = <3000000>;
3255 +};
3256 +
3257 +&reg_dc5ldo {
3258 + regulator-min-microvolt = <700000>;
3259 + regulator-max-microvolt = <1320000>;
3260 + regulator-name = "vdd-cpus";
3261 +};
3262 +
3263 +&reg_dcdc1 {
3264 + regulator-always-on;
3265 + regulator-min-microvolt = <3000000>;
3266 + regulator-max-microvolt = <3000000>;
3267 + regulator-name = "vcc-3v0";
3268 +};
3269 +
3270 +&reg_dcdc2 {
3271 + regulator-min-microvolt = <700000>;
3272 + regulator-max-microvolt = <1320000>;
3273 + regulator-name = "vdd-gpu";
3274 +};
3275 +
3276 +&reg_dcdc3 {
3277 + regulator-always-on;
3278 + regulator-min-microvolt = <700000>;
3279 + regulator-max-microvolt = <1320000>;
3280 + regulator-name = "vdd-cpu";
3281 +};
3282 +
3283 +&reg_dcdc4 {
3284 + regulator-always-on;
3285 + regulator-min-microvolt = <700000>;
3286 + regulator-max-microvolt = <1320000>;
3287 + regulator-name = "vdd-sys-dll";
3288 +};
3289 +
3290 +&reg_dcdc5 {
3291 + regulator-always-on;
3292 + regulator-min-microvolt = <1500000>;
3293 + regulator-max-microvolt = <1500000>;
3294 + regulator-name = "vcc-dram";
3295 +};
3296 +
3297 +&reg_dldo1 {
3298 + regulator-min-microvolt = <3300000>;
3299 + regulator-max-microvolt = <3300000>;
3300 + regulator-name = "vcc-wifi";
3301 +};
3302 +
3303 +/* Voltage source for I2C pullup resistors for I2C Bus 0 */
3304 +&reg_dldo3 {
3305 + regulator-min-microvolt = <2800000>;
3306 + regulator-max-microvolt = <2800000>;
3307 + regulator-name = "vddio-csi";
3308 +};
3309 +
3310 +&uart0 {
3311 + pinctrl-names = "default";
3312 + pinctrl-0 = <&uart0_pins_a>;
3313 + status = "okay";
3314 +};
3315 +
3316 +&usbphy {
3317 + usb1_vbus-supply = <&reg_dldo1>;
3318 + usb2_vbus-supply = <&reg_dc1sw>;
3319 + status = "okay";
3320 +};
3321 --- a/arch/arm/dts/sun7i-a20-bananapi.dts
3322 +++ b/arch/arm/dts/sun7i-a20-bananapi.dts
3323 @@ -92,6 +92,24 @@
3324 status = "okay";
3325 };
3326
3327 +&codec {
3328 + status = "okay";
3329 +};
3330 +
3331 +&cpu0 {
3332 + cpu-supply = <&reg_dcdc2>;
3333 + operating-points = <
3334 + /* kHz uV */
3335 + 960000 1400000
3336 + 912000 1400000
3337 + 864000 1350000
3338 + 720000 1250000
3339 + 528000 1150000
3340 + 312000 1100000
3341 + 144000 1050000
3342 + >;
3343 +};
3344 +
3345 &ehci0 {
3346 status = "okay";
3347 };
3348 @@ -119,13 +137,9 @@
3349 status = "okay";
3350
3351 axp209: pmic@34 {
3352 - compatible = "x-powers,axp209";
3353 reg = <0x34>;
3354 interrupt-parent = <&nmi_intc>;
3355 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
3356 -
3357 - interrupt-controller;
3358 - #interrupt-cells = <1>;
3359 };
3360 };
3361
3362 @@ -159,7 +173,18 @@
3363 status = "okay";
3364 };
3365
3366 +&otg_sram {
3367 + status = "okay";
3368 +};
3369 +
3370 &pio {
3371 + usb0_id_detect_pin: usb0_id_detect_pin@0 {
3372 + allwinner,pins = "PH4";
3373 + allwinner,function = "gpio_in";
3374 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
3375 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
3376 + };
3377 +
3378 mmc0_cd_pin_bananapi: mmc0_cd_pin@0 {
3379 allwinner,pins = "PH10";
3380 allwinner,function = "gpio_in";
3381 @@ -182,6 +207,37 @@
3382 };
3383 };
3384
3385 +#include "axp209.dtsi"
3386 +
3387 +&reg_dcdc2 {
3388 + regulator-always-on;
3389 + regulator-min-microvolt = <1000000>;
3390 + regulator-max-microvolt = <1400000>;
3391 + regulator-name = "vdd-cpu";
3392 +};
3393 +
3394 +&reg_dcdc3 {
3395 + regulator-always-on;
3396 + regulator-min-microvolt = <1000000>;
3397 + regulator-max-microvolt = <1400000>;
3398 + regulator-name = "vdd-int-dll";
3399 +};
3400 +
3401 +&reg_ldo1 {
3402 + regulator-name = "vdd-rtc";
3403 +};
3404 +
3405 +&reg_ldo2 {
3406 + regulator-always-on;
3407 + regulator-min-microvolt = <3000000>;
3408 + regulator-max-microvolt = <3000000>;
3409 + regulator-name = "avcc";
3410 +};
3411 +
3412 +&reg_usb0_vbus {
3413 + status = "okay";
3414 +};
3415 +
3416 &reg_usb1_vbus {
3417 status = "okay";
3418 };
3419 @@ -216,7 +272,21 @@
3420 status = "okay";
3421 };
3422
3423 +&usb_otg {
3424 + dr_mode = "otg";
3425 + status = "okay";
3426 +};
3427 +
3428 +&usb_power_supply {
3429 + status = "okay";
3430 +};
3431 +
3432 &usbphy {
3433 + pinctrl-names = "default";
3434 + pinctrl-0 = <&usb0_id_detect_pin>;
3435 + usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
3436 + usb0_vbus_power-supply = <&usb_power_supply>;
3437 + usb0_vbus-supply = <&reg_usb0_vbus>;
3438 usb1_vbus-supply = <&reg_usb1_vbus>;
3439 usb2_vbus-supply = <&reg_usb2_vbus>;
3440 status = "okay";
3441 --- a/arch/arm/dts/sun7i-a20-cubieboard2.dts
3442 +++ b/arch/arm/dts/sun7i-a20-cubieboard2.dts
3443 @@ -84,6 +84,10 @@
3444 status = "okay";
3445 };
3446
3447 +&codec {
3448 + status = "okay";
3449 +};
3450 +
3451 &cpu0 {
3452 cpu-supply = <&reg_dcdc2>;
3453 };
3454 @@ -150,6 +154,10 @@
3455 status = "okay";
3456 };
3457
3458 +&otg_sram {
3459 + status = "okay";
3460 +};
3461 +
3462 &pio {
3463 led_pins_cubieboard2: led_pins@0 {
3464 allwinner,pins = "PH20", "PH21";
3465 @@ -157,12 +165,24 @@
3466 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
3467 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
3468 };
3469 +
3470 + usb0_id_detect_pin: usb0_id_detect_pin@0 {
3471 + allwinner,pins = "PH4";
3472 + allwinner,function = "gpio_in";
3473 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
3474 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
3475 + };
3476 };
3477
3478 &reg_ahci_5v {
3479 status = "okay";
3480 };
3481
3482 +&usb_otg {
3483 + dr_mode = "otg";
3484 + status = "okay";
3485 +};
3486 +
3487 #include "axp209.dtsi"
3488
3489 &reg_dcdc2 {
3490 @@ -205,6 +225,9 @@
3491 };
3492
3493 &usbphy {
3494 + pinctrl-names = "default";
3495 + pinctrl-0 = <&usb0_id_detect_pin>;
3496 + usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
3497 usb1_vbus-supply = <&reg_usb1_vbus>;
3498 usb2_vbus-supply = <&reg_usb2_vbus>;
3499 status = "okay";
3500 --- a/arch/arm/dts/sun7i-a20-cubietruck.dts
3501 +++ b/arch/arm/dts/sun7i-a20-cubietruck.dts
3502 @@ -101,6 +101,10 @@
3503 status = "okay";
3504 };
3505
3506 +&codec {
3507 + status = "okay";
3508 +};
3509 +
3510 &cpu0 {
3511 cpu-supply = <&reg_dcdc2>;
3512 };
3513 --- /dev/null
3514 +++ b/arch/arm/dts/sun7i-a20-icnova-swac.dts
3515 @@ -0,0 +1,169 @@
3516 +/*
3517 + * Copyright 2015 Stefan Roese <sr@denx.de>
3518 + *
3519 + * This file is dual-licensed: you can use it either under the terms
3520 + * of the GPL or the X11 license, at your option. Note that this dual
3521 + * licensing only applies to this file, and not this project as a
3522 + * whole.
3523 + *
3524 + * a) This file is free software; you can redistribute it and/or
3525 + * modify it under the terms of the GNU General Public License as
3526 + * published by the Free Software Foundation; either version 2 of the
3527 + * License, or (at your option) any later version.
3528 + *
3529 + * This file is distributed in the hope that it will be useful,
3530 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
3531 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3532 + * GNU General Public License for more details.
3533 + *
3534 + * Or, alternatively,
3535 + *
3536 + * b) Permission is hereby granted, free of charge, to any person
3537 + * obtaining a copy of this software and associated documentation
3538 + * files (the "Software"), to deal in the Software without
3539 + * restriction, including without limitation the rights to use,
3540 + * copy, modify, merge, publish, distribute, sublicense, and/or
3541 + * sell copies of the Software, and to permit persons to whom the
3542 + * Software is furnished to do so, subject to the following
3543 + * conditions:
3544 + *
3545 + * The above copyright notice and this permission notice shall be
3546 + * included in all copies or substantial portions of the Software.
3547 + *
3548 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
3549 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
3550 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
3551 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
3552 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
3553 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
3554 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
3555 + * OTHER DEALINGS IN THE SOFTWARE.
3556 + */
3557 +
3558 +/dts-v1/;
3559 +#include "sun7i-a20.dtsi"
3560 +#include "sunxi-common-regulators.dtsi"
3561 +
3562 +#include <dt-bindings/gpio/gpio.h>
3563 +#include <dt-bindings/interrupt-controller/irq.h>
3564 +#include <dt-bindings/pinctrl/sun4i-a10.h>
3565 +
3566 +/ {
3567 + model = "ICnova-A20 SWAC";
3568 + compatible = "swac,icnova-a20-swac", "incircuit,icnova-a20", "allwinner,sun7i-a20";
3569 +
3570 + aliases {
3571 + serial0 = &uart0;
3572 + };
3573 +
3574 + chosen {
3575 + stdout-path = "serial0:115200n8";
3576 + };
3577 +};
3578 +
3579 +&cpu0 {
3580 + cpu-supply = <&reg_dcdc2>;
3581 +};
3582 +
3583 +&ehci0 {
3584 + status = "okay";
3585 +};
3586 +
3587 +&ehci1 {
3588 + status = "okay";
3589 +};
3590 +
3591 +&gmac {
3592 + pinctrl-names = "default";
3593 + pinctrl-0 = <&gmac_pins_mii_a>;
3594 + phy = <&phy1>;
3595 + phy-mode = "mii";
3596 + status = "okay";
3597 +
3598 + phy1: ethernet-phy@1 {
3599 + reg = <1>;
3600 + };
3601 +};
3602 +
3603 +&i2c0 {
3604 + pinctrl-names = "default";
3605 + pinctrl-0 = <&i2c0_pins_a>;
3606 + status = "okay";
3607 +
3608 + axp209: pmic@34 {
3609 + reg = <0x34>;
3610 + interrupt-parent = <&nmi_intc>;
3611 + interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
3612 + };
3613 +};
3614 +
3615 +&i2c1 {
3616 + pinctrl-names = "default";
3617 + pinctrl-0 = <&i2c1_pins_a>;
3618 + status = "okay";
3619 +};
3620 +
3621 +&mmc0 {
3622 + pinctrl-names = "default";
3623 + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
3624 + vmmc-supply = <&reg_vcc3v3>;
3625 + bus-width = <4>;
3626 + cd-gpios = <&pio 8 5 GPIO_ACTIVE_HIGH>; /* PI5 */
3627 + cd-inverted;
3628 + status = "okay";
3629 +};
3630 +
3631 +&ohci0 {
3632 + status = "okay";
3633 +};
3634 +
3635 +&ohci1 {
3636 + status = "okay";
3637 +};
3638 +
3639 +#include "axp209.dtsi"
3640 +
3641 +&reg_dcdc2 {
3642 + regulator-always-on;
3643 + regulator-min-microvolt = <1000000>;
3644 + regulator-max-microvolt = <1400000>;
3645 + regulator-name = "vdd-cpu";
3646 +};
3647 +
3648 +&reg_dcdc3 {
3649 + regulator-always-on;
3650 + regulator-min-microvolt = <1000000>;
3651 + regulator-max-microvolt = <1400000>;
3652 + regulator-name = "vdd-int-dll";
3653 +};
3654 +
3655 +&reg_ldo1 {
3656 + regulator-name = "vdd-rtc";
3657 +};
3658 +
3659 +&reg_ldo2 {
3660 + regulator-always-on;
3661 + regulator-min-microvolt = <3000000>;
3662 + regulator-max-microvolt = <3000000>;
3663 + regulator-name = "avcc";
3664 +};
3665 +
3666 +&reg_usb1_vbus {
3667 + status = "okay";
3668 +};
3669 +
3670 +&reg_usb2_vbus {
3671 + status = "okay";
3672 +};
3673 +
3674 +&uart0 {
3675 + pinctrl-names = "default";
3676 + pinctrl-0 = <&uart0_pins_a>;
3677 + status = "okay";
3678 +};
3679 +
3680 +&usbphy {
3681 + usb1_vbus-supply = <&reg_usb1_vbus>;
3682 + usb2_vbus-supply = <&reg_usb2_vbus>;
3683 + status = "okay";
3684 +};
3685 --- /dev/null
3686 +++ b/arch/arm/dts/sun7i-a20-itead-ibox.dts
3687 @@ -0,0 +1,125 @@
3688 +/*
3689 + * Copyright 2015 - Marcus Cooper <codekipper@gmail.com>
3690 + *
3691 + * This file is dual-licensed: you can use it either under the terms
3692 + * of the GPL or the X11 license, at your option. Note that this dual
3693 + * licensing only applies to this file, and not this project as a
3694 + * whole.
3695 + *
3696 + * a) This file is free software; you can redistribute it and/or
3697 + * modify it under the terms of the GNU General Public License as
3698 + * published by the Free Software Foundation; either version 2 of the
3699 + * License, or (at your option) any later version.
3700 + *
3701 + * This file is distributed in the hope that it will be useful,
3702 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
3703 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3704 + * GNU General Public License for more details.
3705 + *
3706 + * Or, alternatively,
3707 + *
3708 + * b) Permission is hereby granted, free of charge, to any person
3709 + * obtaining a copy of this software and associated documentation
3710 + * files (the "Software"), to deal in the Software without
3711 + * restriction, including without limitation the rights to use,
3712 + * copy, modify, merge, publish, distribute, sublicense, and/or
3713 + * sell copies of the Software, and to permit persons to whom the
3714 + * Software is furnished to do so, subject to the following
3715 + * conditions:
3716 + *
3717 + * The above copyright notice and this permission notice shall be
3718 + * included in all copies or substantial portions of the Software.
3719 + *
3720 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
3721 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
3722 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
3723 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
3724 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
3725 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
3726 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
3727 + * OTHER DEALINGS IN THE SOFTWARE.
3728 + */
3729 +
3730 +/dts-v1/;
3731 +#include "sun7i-a20.dtsi"
3732 +#include "sunxi-itead-core-common.dtsi"
3733 +
3734 +/ {
3735 + model = "Itead Ibox A20";
3736 + compatible = "itead,itead-ibox-a20", "allwinner,sun7i-a20";
3737 +
3738 + leds {
3739 + compatible = "gpio-leds";
3740 + pinctrl-names = "default";
3741 + pinctrl-0 = <&led_pins_itead_core>;
3742 +
3743 + green {
3744 + label = "itead_core:green:usr";
3745 + gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>;
3746 + default-state = "on";
3747 + };
3748 +
3749 + blue {
3750 + label = "itead_core:blue:usr";
3751 + gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>;
3752 + default-state = "on";
3753 + };
3754 + };
3755 +};
3756 +
3757 +&ahci {
3758 + target-supply = <&reg_ahci_5v>;
3759 + status = "okay";
3760 +};
3761 +
3762 +&codec {
3763 + status = "okay";
3764 +};
3765 +
3766 +&gmac {
3767 + pinctrl-names = "default";
3768 + pinctrl-0 = <&gmac_pins_mii_a>;
3769 + phy = <&phy1>;
3770 + phy-mode = "mii";
3771 + status = "okay";
3772 +
3773 + phy1: ethernet-phy@1 {
3774 + reg = <1>;
3775 + };
3776 +};
3777 +
3778 +&i2c0 {
3779 + axp209: pmic@34 {
3780 + interrupt-parent = <&nmi_intc>;
3781 + interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
3782 + };
3783 +};
3784 +
3785 +&ir0 {
3786 + pinctrl-names = "default";
3787 + pinctrl-0 = <&ir0_rx_pins_a>;
3788 + status = "okay";
3789 +};
3790 +
3791 +&mmc0 {
3792 + pinctrl-names = "default";
3793 + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
3794 + vmmc-supply = <&reg_vcc3v3>;
3795 + bus-width = <4>;
3796 + cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
3797 + cd-inverted;
3798 + status = "okay";
3799 +};
3800 +
3801 +&pio {
3802 + led_pins_itead_core: led_pins@0 {
3803 + allwinner,pins = "PH20","PH21";
3804 + allwinner,function = "gpio_out";
3805 + allwinner,drive = <SUN4I_PINCTRL_20_MA>;
3806 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
3807 + };
3808 +};
3809 +
3810 +&reg_ahci_5v {
3811 + status = "okay";
3812 +};
3813 --- a/arch/arm/dts/sun7i-a20-lamobo-r1.dts
3814 +++ b/arch/arm/dts/sun7i-a20-lamobo-r1.dts
3815 @@ -97,16 +97,6 @@
3816
3817 &cpu0 {
3818 cpu-supply = <&reg_dcdc2>;
3819 - operating-points = <
3820 - /* kHz uV */
3821 - 960000 1400000
3822 - 912000 1400000
3823 - 864000 1350000
3824 - 720000 1250000
3825 - 528000 1150000
3826 - 312000 1100000
3827 - 144000 1050000
3828 - >;
3829 };
3830
3831 &ehci0 {
3832 --- a/arch/arm/dts/sun7i-a20-mk808c.dts
3833 +++ b/arch/arm/dts/sun7i-a20-mk808c.dts
3834 @@ -53,6 +53,7 @@
3835
3836 #include <dt-bindings/gpio/gpio.h>
3837 #include <dt-bindings/interrupt-controller/irq.h>
3838 +#include <dt-bindings/pinctrl/sun4i-a10.h>
3839
3840 / {
3841 model = "mk808c";
3842 @@ -68,6 +69,10 @@
3843 };
3844 };
3845
3846 +&codec {
3847 + status = "okay";
3848 +};
3849 +
3850 &ehci0 {
3851 status = "okay";
3852 };
3853 @@ -121,6 +126,30 @@
3854 status = "okay";
3855 };
3856
3857 +&otg_sram {
3858 + status = "okay";
3859 +};
3860 +
3861 +&pio {
3862 + usb0_id_detect_pin: usb0_id_detect_pin@0 {
3863 + allwinner,pins = "PH4";
3864 + allwinner,function = "gpio_in";
3865 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
3866 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
3867 + };
3868 +
3869 + usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
3870 + allwinner,pins = "PH5";
3871 + allwinner,function = "gpio_in";
3872 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
3873 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
3874 + };
3875 +};
3876 +
3877 +&reg_usb0_vbus {
3878 + status = "okay";
3879 +};
3880 +
3881 &reg_usb1_vbus {
3882 status = "okay";
3883 };
3884 @@ -141,7 +170,17 @@
3885 status = "okay";
3886 };
3887
3888 +&usb_otg {
3889 + dr_mode = "otg";
3890 + status = "okay";
3891 +};
3892 +
3893 &usbphy {
3894 + pinctrl-names = "default";
3895 + pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
3896 + usb0_id_det-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
3897 + usb0_vbus_det-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
3898 + usb0_vbus-supply = <&reg_usb0_vbus>;
3899 usb1_vbus-supply = <&reg_usb1_vbus>;
3900 usb2_vbus-supply = <&reg_usb2_vbus>;
3901 status = "okay";
3902 --- a/arch/arm/dts/sun7i-a20-olimex-som-evb.dts
3903 +++ b/arch/arm/dts/sun7i-a20-olimex-som-evb.dts
3904 @@ -1,5 +1,6 @@
3905 /*
3906 * Copyright 2015 - Marcus Cooper <codekipper@gmail.com>
3907 + * Copyright 2015 - Karsten Merker <merker@debian.org>
3908 *
3909 * This file is dual-licensed: you can use it either under the terms
3910 * of the GPL or the X11 license, at your option. Note that this dual
3911 @@ -45,6 +46,7 @@
3912 #include "sunxi-common-regulators.dtsi"
3913
3914 #include <dt-bindings/gpio/gpio.h>
3915 +#include <dt-bindings/input/input.h>
3916 #include <dt-bindings/interrupt-controller/irq.h>
3917 #include <dt-bindings/pinctrl/sun4i-a10.h>
3918
3919 @@ -71,14 +73,6 @@
3920 default-state = "on";
3921 };
3922 };
3923 -
3924 - reg_axp_ipsout: axp_ipsout {
3925 - compatible = "regulator-fixed";
3926 - regulator-name = "axp-ipsout";
3927 - regulator-min-microvolt = <5000000>;
3928 - regulator-max-microvolt = <5000000>;
3929 - regulator-always-on;
3930 - };
3931 };
3932
3933 &ahci {
3934 @@ -94,6 +88,10 @@
3935 status = "okay";
3936 };
3937
3938 +&codec {
3939 + status = "okay";
3940 +};
3941 +
3942 &gmac {
3943 pinctrl-names = "default";
3944 pinctrl-0 = <&gmac_pins_rgmii_a>;
3945 @@ -118,10 +116,58 @@
3946 };
3947 };
3948
3949 -&i2c1 {
3950 - pinctrl-names = "default";
3951 - pinctrl-0 = <&i2c1_pins_a>;
3952 +&lradc {
3953 + vref-supply = <&reg_vcc3v0>;
3954 status = "okay";
3955 +
3956 + button@190 {
3957 + label = "Volume Up";
3958 + linux,code = <KEY_VOLUMEUP>;
3959 + channel = <0>;
3960 + voltage = <190000>;
3961 + };
3962 +
3963 + button@390 {
3964 + label = "Volume Down";
3965 + linux,code = <KEY_VOLUMEDOWN>;
3966 + channel = <0>;
3967 + voltage = <390000>;
3968 + };
3969 +
3970 + button@600 {
3971 + label = "Menu";
3972 + linux,code = <KEY_MENU>;
3973 + channel = <0>;
3974 + voltage = <600000>;
3975 + };
3976 +
3977 + button@800 {
3978 + label = "Search";
3979 + linux,code = <KEY_SEARCH>;
3980 + channel = <0>;
3981 + voltage = <800000>;
3982 + };
3983 +
3984 + button@980 {
3985 + label = "Home";
3986 + linux,code = <KEY_HOMEPAGE>;
3987 + channel = <0>;
3988 + voltage = <980000>;
3989 + };
3990 +
3991 + button@1180 {
3992 + label = "Esc";
3993 + linux,code = <KEY_ESC>;
3994 + channel = <0>;
3995 + voltage = <1180000>;
3996 + };
3997 +
3998 + button@1400 {
3999 + label = "Enter";
4000 + linux,code = <KEY_ENTER>;
4001 + channel = <0>;
4002 + voltage = <1400000>;
4003 + };
4004 };
4005
4006 &mmc0 {
4007 @@ -134,6 +180,16 @@
4008 status = "okay";
4009 };
4010
4011 +&mmc3 {
4012 + pinctrl-names = "default";
4013 + pinctrl-0 = <&mmc3_pins_a>, <&mmc3_cd_pin_olimex_som_evb>;
4014 + vmmc-supply = <&reg_vcc3v3>;
4015 + bus-width = <4>;
4016 + cd-gpios = <&pio 7 0 GPIO_ACTIVE_HIGH>; /* PH0 */
4017 + cd-inverted;
4018 + status = "okay";
4019 +};
4020 +
4021 &ohci0 {
4022 status = "okay";
4023 };
4024 @@ -161,15 +217,22 @@
4025 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
4026 };
4027
4028 + mmc3_cd_pin_olimex_som_evb: mmc3_cd_pin@0 {
4029 + allwinner,pins = "PH0";
4030 + allwinner,function = "gpio_in";
4031 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4032 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
4033 + };
4034 +
4035 usb0_id_detect_pin: usb0_id_detect_pin@0 {
4036 - allwinner,pins = "PH04";
4037 + allwinner,pins = "PH4";
4038 allwinner,function = "gpio_in";
4039 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4040 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
4041 };
4042
4043 usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
4044 - allwinner,pins = "PH05";
4045 + allwinner,pins = "PH5";
4046 allwinner,function = "gpio_in";
4047 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4048 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
4049 @@ -187,7 +250,7 @@
4050 &reg_dcdc2 {
4051 regulator-always-on;
4052 regulator-min-microvolt = <1000000>;
4053 - regulator-max-microvolt = <1425000>;
4054 + regulator-max-microvolt = <1400000>;
4055 regulator-name = "vdd-cpu";
4056 };
4057
4058 @@ -235,8 +298,8 @@
4059 &usbphy {
4060 pinctrl-names = "default";
4061 pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
4062 - usb0_id_det-gpios = <&pio 7 04 GPIO_ACTIVE_HIGH>; /* PH04 */
4063 - usb0_vbus_det-gpios = <&pio 7 05 GPIO_ACTIVE_HIGH>; /* PH05 */
4064 + usb0_id_det-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH04 */
4065 + usb0_vbus_det-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH05 */
4066 usb0_vbus-supply = <&reg_usb0_vbus>;
4067 usb1_vbus-supply = <&reg_usb1_vbus>;
4068 usb2_vbus-supply = <&reg_usb2_vbus>;
4069 --- a/arch/arm/dts/sun7i-a20-olinuxino-lime.dts
4070 +++ b/arch/arm/dts/sun7i-a20-olinuxino-lime.dts
4071 @@ -117,6 +117,18 @@
4072 };
4073 };
4074
4075 +&i2c1 {
4076 + pinctrl-names = "default";
4077 + pinctrl-0 = <&i2c1_pins_a>;
4078 + status = "okay";
4079 +
4080 + eeprom: eeprom@50 {
4081 + compatible = "atmel,24c16";
4082 + reg = <0x50>;
4083 + pagesize = <16>;
4084 + };
4085 +};
4086 +
4087 &mmc0 {
4088 pinctrl-names = "default";
4089 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
4090 --- a/arch/arm/dts/sun7i-a20-olinuxino-lime2.dts
4091 +++ b/arch/arm/dts/sun7i-a20-olinuxino-lime2.dts
4092 @@ -170,6 +170,12 @@
4093 pinctrl-names = "default";
4094 pinctrl-0 = <&i2c1_pins_a>;
4095 status = "okay";
4096 +
4097 + eeprom: eeprom@50 {
4098 + compatible = "atmel,24c16";
4099 + reg = <0x50>;
4100 + pagesize = <16>;
4101 + };
4102 };
4103
4104 &mmc0 {
4105 @@ -190,6 +196,10 @@
4106 status = "okay";
4107 };
4108
4109 +&otg_sram {
4110 + status = "okay";
4111 +};
4112 +
4113 &pio {
4114 ahci_pwr_pin_olinuxinolime: ahci_pwr_pin@1 {
4115 allwinner,pins = "PC3";
4116 @@ -204,6 +214,27 @@
4117 allwinner,drive = <SUN4I_PINCTRL_20_MA>;
4118 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
4119 };
4120 +
4121 + usb0_id_detect_pin: usb0_id_detect_pin@0 {
4122 + allwinner,pins = "PH4";
4123 + allwinner,function = "gpio_in";
4124 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4125 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
4126 + };
4127 +
4128 + usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
4129 + allwinner,pins = "PH5";
4130 + allwinner,function = "gpio_in";
4131 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4132 + allwinner,pull = <SUN4I_PINCTRL_PULL_DOWN>;
4133 + };
4134 +
4135 + usb0_vbus_pin_lime2: usb0_vbus_pin@0 {
4136 + allwinner,pins = "PC17";
4137 + allwinner,function = "gpio_out";
4138 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4139 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
4140 + };
4141 };
4142
4143 &reg_ahci_5v {
4144 @@ -212,6 +243,12 @@
4145 status = "okay";
4146 };
4147
4148 +&reg_usb0_vbus {
4149 + pinctrl-0 = <&usb0_vbus_pin_lime2>;
4150 + gpio = <&pio 2 17 GPIO_ACTIVE_HIGH>;
4151 + status = "okay";
4152 +};
4153 +
4154 &reg_usb1_vbus {
4155 status = "okay";
4156 };
4157 @@ -226,7 +263,17 @@
4158 status = "okay";
4159 };
4160
4161 +&usb_otg {
4162 + dr_mode = "otg";
4163 + status = "okay";
4164 +};
4165 +
4166 &usbphy {
4167 + pinctrl-names = "default";
4168 + pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
4169 + usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
4170 + usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
4171 + usb0_vbus-supply = <&reg_usb0_vbus>;
4172 usb1_vbus-supply = <&reg_usb1_vbus>;
4173 usb2_vbus-supply = <&reg_usb2_vbus>;
4174 status = "okay";
4175 --- a/arch/arm/dts/sun7i-a20-olinuxino-micro.dts
4176 +++ b/arch/arm/dts/sun7i-a20-olinuxino-micro.dts
4177 @@ -125,6 +125,12 @@
4178 pinctrl-names = "default";
4179 pinctrl-0 = <&i2c1_pins_a>;
4180 status = "okay";
4181 +
4182 + eeprom: eeprom@50 {
4183 + compatible = "atmel,24c16";
4184 + reg = <0x50>;
4185 + pagesize = <16>;
4186 + };
4187 };
4188
4189 &i2c2 {
4190 --- a/arch/arm/dts/sun7i-a20-orangepi-mini.dts
4191 +++ b/arch/arm/dts/sun7i-a20-orangepi-mini.dts
4192 @@ -95,6 +95,10 @@
4193 status = "okay";
4194 };
4195
4196 +&codec {
4197 + status = "okay";
4198 +};
4199 +
4200 &ehci0 {
4201 status = "okay";
4202 };
4203 @@ -156,7 +160,18 @@
4204 status = "okay";
4205 };
4206
4207 +&otg_sram {
4208 + status = "okay";
4209 +};
4210 +
4211 &pio {
4212 + usb0_id_detect_pin: usb0_id_detect_pin@0 {
4213 + allwinner,pins = "PH4";
4214 + allwinner,function = "gpio_in";
4215 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4216 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
4217 + };
4218 +
4219 mmc0_cd_pin_orangepi: mmc0_cd_pin@0 {
4220 allwinner,pins = "PH10";
4221 allwinner,function = "gpio_in";
4222 @@ -225,6 +240,10 @@
4223 regulator-name = "avcc";
4224 };
4225
4226 +&reg_usb0_vbus {
4227 + status = "okay";
4228 +};
4229 +
4230 &reg_usb1_vbus {
4231 pinctrl-0 = <&usb1_vbus_pin_bananapro>;
4232 gpio = <&pio 7 26 GPIO_ACTIVE_HIGH>; /* PH26 */
4233 @@ -243,7 +262,21 @@
4234 status = "okay";
4235 };
4236
4237 +&usb_otg {
4238 + dr_mode = "otg";
4239 + status = "okay";
4240 +};
4241 +
4242 +&usb_power_supply {
4243 + status = "okay";
4244 +};
4245 +
4246 &usbphy {
4247 + pinctrl-names = "default";
4248 + pinctrl-0 = <&usb0_id_detect_pin>;
4249 + usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
4250 + usb0_vbus_power-supply = <&usb_power_supply>;
4251 + usb0_vbus-supply = <&reg_usb0_vbus>;
4252 usb1_vbus-supply = <&reg_usb1_vbus>;
4253 usb2_vbus-supply = <&reg_usb2_vbus>;
4254 status = "okay";
4255 --- a/arch/arm/dts/sun7i-a20-orangepi.dts
4256 +++ b/arch/arm/dts/sun7i-a20-orangepi.dts
4257 @@ -141,7 +141,18 @@
4258 status = "okay";
4259 };
4260
4261 +&otg_sram {
4262 + status = "okay";
4263 +};
4264 +
4265 &pio {
4266 + usb0_id_detect_pin: usb0_id_detect_pin@0 {
4267 + allwinner,pins = "PH4";
4268 + allwinner,function = "gpio_in";
4269 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4270 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
4271 + };
4272 +
4273 mmc0_cd_pin_orangepi: mmc0_cd_pin@0 {
4274 allwinner,pins = "PH10";
4275 allwinner,function = "gpio_in";
4276 @@ -203,6 +214,10 @@
4277 regulator-name = "avcc";
4278 };
4279
4280 +&reg_usb0_vbus {
4281 + status = "okay";
4282 +};
4283 +
4284 &reg_usb1_vbus {
4285 pinctrl-0 = <&usb1_vbus_pin_bananapro>;
4286 gpio = <&pio 7 26 GPIO_ACTIVE_HIGH>; /* PH26 */
4287 @@ -221,7 +236,21 @@
4288 status = "okay";
4289 };
4290
4291 +&usb_otg {
4292 + dr_mode = "otg";
4293 + status = "okay";
4294 +};
4295 +
4296 +&usb_power_supply {
4297 + status = "okay";
4298 +};
4299 +
4300 &usbphy {
4301 + pinctrl-names = "default";
4302 + pinctrl-0 = <&usb0_id_detect_pin>;
4303 + usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
4304 + usb0_vbus_power-supply = <&usb_power_supply>;
4305 + usb0_vbus-supply = <&reg_usb0_vbus>;
4306 usb1_vbus-supply = <&reg_usb1_vbus>;
4307 usb2_vbus-supply = <&reg_usb2_vbus>;
4308 status = "okay";
4309 --- a/arch/arm/dts/sun7i-a20-pcduino3-nano.dts
4310 +++ b/arch/arm/dts/sun7i-a20-pcduino3-nano.dts
4311 @@ -82,6 +82,14 @@
4312 status = "okay";
4313 };
4314
4315 +&codec {
4316 + status = "okay";
4317 +};
4318 +
4319 +&cpu0 {
4320 + cpu-supply = <&reg_dcdc2>;
4321 +};
4322 +
4323 &ehci0 {
4324 status = "okay";
4325 };
4326 @@ -108,13 +116,9 @@
4327 status = "okay";
4328
4329 axp209: pmic@34 {
4330 - compatible = "x-powers,axp209";
4331 reg = <0x34>;
4332 interrupt-parent = <&nmi_intc>;
4333 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
4334 -
4335 - interrupt-controller;
4336 - #interrupt-cells = <1>;
4337 };
4338 };
4339
4340 @@ -142,6 +146,10 @@
4341 status = "okay";
4342 };
4343
4344 +&otg_sram {
4345 + status = "okay";
4346 +};
4347 +
4348 &pio {
4349 ahci_pwr_pin_pcduino3_nano: ahci_pwr_pin@0 {
4350 allwinner,pins = "PH2";
4351 @@ -157,8 +165,15 @@
4352 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
4353 };
4354
4355 + usb0_id_detect_pin: usb0_id_detect_pin@0 {
4356 + allwinner,pins = "PH4";
4357 + allwinner,function = "gpio_in";
4358 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4359 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
4360 + };
4361 +
4362 usb1_vbus_pin_pcduino3_nano: usb1_vbus_pin@0 {
4363 - allwinner,pins = "PH11";
4364 + allwinner,pins = "PD2";
4365 allwinner,function = "gpio_out";
4366 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4367 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
4368 @@ -171,13 +186,37 @@
4369 status = "okay";
4370 };
4371
4372 -&reg_usb1_vbus {
4373 - pinctrl-0 = <&usb1_vbus_pin_pcduino3_nano>;
4374 - gpio = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */
4375 - status = "okay";
4376 +#include "axp209.dtsi"
4377 +
4378 +&reg_dcdc2 {
4379 + regulator-always-on;
4380 + regulator-min-microvolt = <1000000>;
4381 + regulator-max-microvolt = <1400000>;
4382 + regulator-name = "vdd-cpu";
4383 +};
4384 +
4385 +&reg_dcdc3 {
4386 + regulator-always-on;
4387 + regulator-min-microvolt = <1000000>;
4388 + regulator-max-microvolt = <1400000>;
4389 + regulator-name = "vdd-int-pll";
4390 +};
4391 +
4392 +&reg_ldo1 {
4393 + regulator-name = "vdd-rtc";
4394 +};
4395 +
4396 +&reg_ldo2 {
4397 + regulator-always-on;
4398 + regulator-min-microvolt = <3000000>;
4399 + regulator-max-microvolt = <3000000>;
4400 + regulator-name = "avcc";
4401 };
4402
4403 -&reg_usb2_vbus {
4404 +/* A single regulator (U24) powers both USB host ports. */
4405 +&reg_usb1_vbus {
4406 + pinctrl-0 = <&usb1_vbus_pin_pcduino3_nano>;
4407 + gpio = <&pio 3 2 GPIO_ACTIVE_HIGH>; /* PD2 */
4408 status = "okay";
4409 };
4410
4411 @@ -187,8 +226,16 @@
4412 status = "okay";
4413 };
4414
4415 +&usb_otg {
4416 + dr_mode = "otg";
4417 + status = "okay";
4418 +};
4419 +
4420 &usbphy {
4421 + pinctrl-names = "default";
4422 + pinctrl-0 = <&usb0_id_detect_pin>;
4423 + usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
4424 usb1_vbus-supply = <&reg_usb1_vbus>;
4425 - usb2_vbus-supply = <&reg_usb2_vbus>;
4426 + usb2_vbus-supply = <&reg_usb1_vbus>;
4427 status = "okay";
4428 };
4429 --- a/arch/arm/dts/sun7i-a20-pcduino3.dts
4430 +++ b/arch/arm/dts/sun7i-a20-pcduino3.dts
4431 @@ -111,6 +111,14 @@
4432 allwinner,pins = "PH2";
4433 };
4434
4435 +&codec {
4436 + status = "okay";
4437 +};
4438 +
4439 +&cpu0 {
4440 + cpu-supply = <&reg_dcdc2>;
4441 +};
4442 +
4443 &ehci0 {
4444 status = "okay";
4445 };
4446 @@ -137,16 +145,14 @@
4447 status = "okay";
4448
4449 axp209: pmic@34 {
4450 - compatible = "x-powers,axp209";
4451 reg = <0x34>;
4452 interrupt-parent = <&nmi_intc>;
4453 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
4454 -
4455 - interrupt-controller;
4456 - #interrupt-cells = <1>;
4457 };
4458 };
4459
4460 +#include "axp209.dtsi"
4461 +
4462 &ir0 {
4463 pinctrl-names = "default";
4464 pinctrl-0 = <&ir0_rx_pins_a>;
4465 @@ -171,6 +177,10 @@
4466 status = "okay";
4467 };
4468
4469 +&otg_sram {
4470 + status = "okay";
4471 +};
4472 +
4473 &pio {
4474 led_pins_pcduino3: led_pins@0 {
4475 allwinner,pins = "PH15", "PH16";
4476 @@ -185,6 +195,13 @@
4477 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4478 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
4479 };
4480 +
4481 + usb0_id_detect_pin: usb0_id_detect_pin@0 {
4482 + allwinner,pins = "PH4";
4483 + allwinner,function = "gpio_in";
4484 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4485 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
4486 + };
4487 };
4488
4489 &reg_ahci_5v {
4490 @@ -192,6 +209,31 @@
4491 status = "okay";
4492 };
4493
4494 +&reg_dcdc2 {
4495 + regulator-always-on;
4496 + regulator-min-microvolt = <1000000>;
4497 + regulator-max-microvolt = <1400000>;
4498 + regulator-name = "vdd-cpu";
4499 +};
4500 +
4501 +&reg_dcdc3 {
4502 + regulator-always-on;
4503 + regulator-min-microvolt = <1000000>;
4504 + regulator-max-microvolt = <1400000>;
4505 + regulator-name = "vdd-int-pll";
4506 +};
4507 +
4508 +&reg_ldo1 {
4509 + regulator-name = "vdd-rtc";
4510 +};
4511 +
4512 +&reg_ldo2 {
4513 + regulator-always-on;
4514 + regulator-min-microvolt = <3000000>;
4515 + regulator-max-microvolt = <3000000>;
4516 + regulator-name = "avcc";
4517 +};
4518 +
4519 &reg_usb1_vbus {
4520 status = "okay";
4521 };
4522 @@ -206,7 +248,15 @@
4523 status = "okay";
4524 };
4525
4526 +&usb_otg {
4527 + dr_mode = "otg";
4528 + status = "okay";
4529 +};
4530 +
4531 &usbphy {
4532 + pinctrl-names = "default";
4533 + pinctrl-0 = <&usb0_id_detect_pin>;
4534 + usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
4535 usb1_vbus-supply = <&reg_usb1_vbus>;
4536 usb2_vbus-supply = <&reg_usb2_vbus>;
4537 status = "okay";
4538 --- a/arch/arm/dts/sun7i-a20-wexler-tab7200.dts
4539 +++ b/arch/arm/dts/sun7i-a20-wexler-tab7200.dts
4540 @@ -48,6 +48,7 @@
4541 #include <dt-bindings/gpio/gpio.h>
4542 #include <dt-bindings/input/input.h>
4543 #include <dt-bindings/interrupt-controller/irq.h>
4544 +#include <dt-bindings/pwm/pwm.h>
4545
4546 / {
4547 model = "Wexler TAB7200";
4548 @@ -57,11 +58,28 @@
4549 serial0 = &uart0;
4550 };
4551
4552 + backlight {
4553 + compatible = "pwm-backlight";
4554 + pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
4555 + brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
4556 + default-brightness-level = <8>;
4557 + pinctrl-names = "default";
4558 + pinctrl-0 = <&bl_enable_pin>;
4559 + enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */
4560 + };
4561 +
4562 chosen {
4563 stdout-path = "serial0:115200n8";
4564 };
4565 };
4566
4567 +&codec {
4568 + pinctrl-names = "default";
4569 + pinctrl-0 = <&codec_pa_pin>;
4570 + allwinner,pa-gpios = <&pio 7 15 GPIO_ACTIVE_HIGH>; /* PH15 */
4571 + status = "okay";
4572 +};
4573 +
4574 &cpu0 {
4575 cpu-supply = <&reg_dcdc2>;
4576 };
4577 @@ -86,6 +104,8 @@
4578 };
4579 };
4580
4581 +#include "axp209.dtsi"
4582 +
4583 &i2c1 {
4584 pinctrl-names = "default";
4585 pinctrl-0 = <&i2c1_pins_a>;
4586 @@ -96,6 +116,18 @@
4587 pinctrl-names = "default";
4588 pinctrl-0 = <&i2c2_pins_a>;
4589 status = "okay";
4590 +
4591 + gt911: touchscreen@5d {
4592 + compatible = "goodix,gt911";
4593 + reg = <0x5d>;
4594 + interrupt-parent = <&pio>;
4595 + interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; /* EINT21 (PH21) */
4596 + pinctrl-names = "default";
4597 + pinctrl-0 = <&ts_reset_pin>;
4598 + irq-gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>; /* INT (PH21) */
4599 + reset-gpios = <&pio 1 13 GPIO_ACTIVE_HIGH>; /* RST (PB13) */
4600 + touchscreen-swapped-x-y;
4601 + };
4602 };
4603
4604 &lradc {
4605 @@ -135,7 +167,45 @@
4606 status = "okay";
4607 };
4608
4609 -#include "axp209.dtsi"
4610 +&otg_sram {
4611 + status = "okay";
4612 +};
4613 +
4614 +&pio {
4615 + bl_enable_pin: bl_enable_pin@0 {
4616 + allwinner,pins = "PH7";
4617 + allwinner,function = "gpio_out";
4618 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4619 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
4620 + };
4621 +
4622 + codec_pa_pin: codec_pa_pin@0 {
4623 + allwinner,pins = "PH15";
4624 + allwinner,function = "gpio_out";
4625 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4626 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
4627 + };
4628 +
4629 + ts_reset_pin: ts_reset_pin@0 {
4630 + allwinner,pins = "PB13";
4631 + allwinner,function = "gpio_out";
4632 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4633 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
4634 + };
4635 +
4636 + usb0_id_detect_pin: usb0_id_detect_pin@0 {
4637 + allwinner,pins = "PH4";
4638 + allwinner,function = "gpio_in";
4639 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4640 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
4641 + };
4642 +};
4643 +
4644 +&pwm {
4645 + pinctrl-names = "default";
4646 + pinctrl-0 = <&pwm0_pins_a>;
4647 + status = "okay";
4648 +};
4649
4650 &reg_dcdc2 {
4651 regulator-always-on;
4652 @@ -162,6 +232,10 @@
4653 regulator-name = "avcc";
4654 };
4655
4656 +&reg_usb0_vbus {
4657 + status = "okay";
4658 +};
4659 +
4660 &reg_usb1_vbus {
4661 status = "okay";
4662 };
4663 @@ -176,7 +250,21 @@
4664 status = "okay";
4665 };
4666
4667 +&usb_otg {
4668 + dr_mode = "otg";
4669 + status = "okay";
4670 +};
4671 +
4672 +&usb_power_supply {
4673 + status = "okay";
4674 +};
4675 +
4676 &usbphy {
4677 + pinctrl-names = "default";
4678 + pinctrl-0 = <&usb0_id_detect_pin>;
4679 + usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
4680 + usb0_vbus_power-supply = <&usb_power_supply>;
4681 + usb0_vbus-supply = <&reg_usb0_vbus>;
4682 usb1_vbus-supply = <&reg_usb1_vbus>;
4683 usb2_vbus-supply = <&reg_usb2_vbus>;
4684 status = "okay";
4685 --- a/arch/arm/dts/sun7i-a20-wits-pro-a20-dkt.dts
4686 +++ b/arch/arm/dts/sun7i-a20-wits-pro-a20-dkt.dts
4687 @@ -1,13 +1,52 @@
4688 /*
4689 - * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
4690 + * Copyright 2015 Jelle de Jong <jelledejong@powercraft.nl>
4691 *
4692 - * Minimal dts file for the Wits Pro A20 DKT for u-boot only
4693 + * This file is dual-licensed: you can use it either under the terms
4694 + * of the GPL or the X11 license, at your option. Note that this dual
4695 + * licensing only applies to this file, and not this project as a
4696 + * whole.
4697 *
4698 - * SPDX-License-Identifier: GPL-2.0+ or X11
4699 + * a) This file is free software; you can redistribute it and/or
4700 + * modify it under the terms of the GNU General Public License as
4701 + * published by the Free Software Foundation; either version 2 of the
4702 + * License, or (at your option) any later version.
4703 + *
4704 + * This file is distributed in the hope that it will be useful,
4705 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
4706 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4707 + * GNU General Public License for more details.
4708 + *
4709 + * Or, alternatively,
4710 + *
4711 + * b) Permission is hereby granted, free of charge, to any person
4712 + * obtaining a copy of this software and associated documentation
4713 + * files (the "Software"), to deal in the Software without
4714 + * restriction, including without limitation the rights to use,
4715 + * copy, modify, merge, publish, distribute, sublicense, and/or
4716 + * sell copies of the Software, and to permit persons to whom the
4717 + * Software is furnished to do so, subject to the following
4718 + * conditions:
4719 + *
4720 + * The above copyright notice and this permission notice shall be
4721 + * included in all copies or substantial portions of the Software.
4722 + *
4723 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
4724 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
4725 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
4726 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
4727 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
4728 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
4729 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
4730 + * OTHER DEALINGS IN THE SOFTWARE.
4731 */
4732
4733 /dts-v1/;
4734 #include "sun7i-a20.dtsi"
4735 +#include "sunxi-common-regulators.dtsi"
4736 +
4737 +#include <dt-bindings/gpio/gpio.h>
4738 +#include <dt-bindings/input/input.h>
4739 +#include <dt-bindings/interrupt-controller/irq.h>
4740
4741 / {
4742 model = "Wits Pro A20 DKT";
4743 @@ -20,6 +59,17 @@
4744 chosen {
4745 stdout-path = "serial0:115200n8";
4746 };
4747 +
4748 + mmc3_pwrseq: mmc3_pwrseq {
4749 + compatible = "mmc-pwrseq-simple";
4750 + pinctrl-names = "default";
4751 + pinctrl-0 = <&vmmc3_pin_ap6xxx_wl_regon>;
4752 + reset-gpios = <&pio 7 9 GPIO_ACTIVE_LOW>; /* PH9 WIFI_EN */
4753 + };
4754 +};
4755 +
4756 +&cpu0 {
4757 + cpu-supply = <&reg_dcdc2>;
4758 };
4759
4760 &ehci0 {
4761 @@ -42,6 +92,60 @@
4762 };
4763 };
4764
4765 +&i2c0 {
4766 + pinctrl-names = "default";
4767 + pinctrl-0 = <&i2c0_pins_a>;
4768 + status = "okay";
4769 +
4770 + axp209: pmic@34 {
4771 + reg = <0x34>;
4772 + interrupt-parent = <&nmi_intc>;
4773 + interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
4774 + };
4775 +};
4776 +
4777 +&i2c1 {
4778 + pinctrl-names = "default";
4779 + pinctrl-0 = <&i2c1_pins_a>;
4780 + status = "okay";
4781 +};
4782 +
4783 +&i2c2 {
4784 + pinctrl-names = "default";
4785 + pinctrl-0 = <&i2c2_pins_a>;
4786 + status = "okay";
4787 +};
4788 +
4789 +#include "axp209.dtsi"
4790 +
4791 +&mmc0 {
4792 + pinctrl-names = "default";
4793 + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
4794 + vmmc-supply = <&reg_vcc3v3>;
4795 + bus-width = <4>;
4796 + cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
4797 + cd-inverted;
4798 + status = "okay";
4799 +};
4800 +
4801 +&mmc3 {
4802 + pinctrl-names = "default";
4803 + pinctrl-0 = <&mmc3_pins_a>;
4804 + vmmc-supply = <&reg_vcc3v3>;
4805 + mmc-pwrseq = <&mmc3_pwrseq>;
4806 + bus-width = <4>;
4807 + non-removable;
4808 + status = "okay";
4809 +
4810 + brcmf: bcrmf@1 {
4811 + reg = <1>;
4812 + compatible = "brcm,bcm4329-fmac";
4813 + interrupt-parent = <&pio>;
4814 + interrupts = <7 10 IRQ_TYPE_LEVEL_LOW>; /* PH10 / EINT10 */
4815 + interrupt-names = "host-wake";
4816 + };
4817 +};
4818 +
4819 &ohci0 {
4820 status = "okay";
4821 };
4822 @@ -50,8 +154,85 @@
4823 status = "okay";
4824 };
4825
4826 +&otg_sram {
4827 + status = "okay";
4828 +};
4829 +
4830 +&pio {
4831 + vmmc3_pin_ap6xxx_wl_regon: vmmc3_pin@0 {
4832 + allwinner,pins = "PH9";
4833 + allwinner,function = "gpio_out";
4834 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4835 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
4836 + };
4837 +
4838 + usb0_id_detect_pin: usb0_id_detect_pin@0 {
4839 + allwinner,pins = "PH4";
4840 + allwinner,function = "gpio_in";
4841 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4842 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
4843 + };
4844 +};
4845 +
4846 +&reg_dcdc2 {
4847 + regulator-always-on;
4848 + regulator-min-microvolt = <1000000>;
4849 + regulator-max-microvolt = <1450000>;
4850 + regulator-name = "vdd-cpu";
4851 +};
4852 +
4853 +&reg_dcdc3 {
4854 + regulator-always-on;
4855 + regulator-min-microvolt = <1000000>;
4856 + regulator-max-microvolt = <1400000>;
4857 + regulator-name = "vdd-int-dll";
4858 +};
4859 +
4860 +&reg_ldo1 {
4861 + regulator-name = "vdd-rtc";
4862 +};
4863 +
4864 +&reg_ldo2 {
4865 + regulator-always-on;
4866 + regulator-min-microvolt = <3000000>;
4867 + regulator-max-microvolt = <3000000>;
4868 + regulator-name = "avcc";
4869 +};
4870 +
4871 +&reg_usb0_vbus {
4872 + status = "okay";
4873 +};
4874 +
4875 +&reg_usb1_vbus {
4876 + status = "okay";
4877 +};
4878 +
4879 +&reg_usb2_vbus {
4880 + status = "okay";
4881 +};
4882 +
4883 &uart0 {
4884 pinctrl-names = "default";
4885 pinctrl-0 = <&uart0_pins_a>;
4886 status = "okay";
4887 };
4888 +
4889 +&usb_otg {
4890 + dr_mode = "otg";
4891 + status = "okay";
4892 +};
4893 +
4894 +&usb_power_supply {
4895 + status = "okay";
4896 +};
4897 +
4898 +&usbphy {
4899 + pinctrl-names = "default";
4900 + pinctrl-0 = <&usb0_id_detect_pin>;
4901 + usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
4902 + usb0_vbus_power-supply = <&usb_power_supply>;
4903 + usb0_vbus-supply = <&reg_usb0_vbus>;
4904 + usb1_vbus-supply = <&reg_usb1_vbus>;
4905 + usb2_vbus-supply = <&reg_usb2_vbus>;
4906 + status = "okay";
4907 +};
4908 --- a/arch/arm/dts/sun7i-a20.dtsi
4909 +++ b/arch/arm/dts/sun7i-a20.dtsi
4910 @@ -47,6 +47,7 @@
4911 #include <dt-bindings/interrupt-controller/arm-gic.h>
4912 #include <dt-bindings/thermal/thermal.h>
4913
4914 +#include <dt-bindings/clock/sun4i-a10-pll2.h>
4915 #include <dt-bindings/dma/sun4i-a10.h>
4916 #include <dt-bindings/pinctrl/sun4i-a10.h>
4917
4918 @@ -67,7 +68,7 @@
4919 "simple-framebuffer";
4920 allwinner,pipeline = "de_be0-lcd0-hdmi";
4921 clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>,
4922 - <&ahb_gates 44>;
4923 + <&ahb_gates 44>, <&dram_gates 26>;
4924 status = "disabled";
4925 };
4926
4927 @@ -75,7 +76,8 @@
4928 compatible = "allwinner,simple-framebuffer",
4929 "simple-framebuffer";
4930 allwinner,pipeline = "de_be0-lcd0";
4931 - clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>;
4932 + clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>,
4933 + <&dram_gates 26>;
4934 status = "disabled";
4935 };
4936
4937 @@ -84,7 +86,7 @@
4938 "simple-framebuffer";
4939 allwinner,pipeline = "de_be0-lcd0-tve0";
4940 clocks = <&pll5 1>, <&ahb_gates 34>, <&ahb_gates 36>,
4941 - <&ahb_gates 44>;
4942 + <&ahb_gates 44>, <&dram_gates 26>;
4943 status = "disabled";
4944 };
4945 };
4946 @@ -107,7 +109,7 @@
4947 720000 1200000
4948 528000 1100000
4949 312000 1000000
4950 - 144000 900000
4951 + 144000 1000000
4952 >;
4953 #cooling-cells = <2>;
4954 cooling-min-level = <0>;
4955 @@ -199,6 +201,15 @@
4956 clock-output-names = "pll1";
4957 };
4958
4959 + pll2: clk@01c20008 {
4960 + #clock-cells = <1>;
4961 + compatible = "allwinner,sun4i-a10-pll2-clk";
4962 + reg = <0x01c20008 0x8>;
4963 + clocks = <&osc24M>;
4964 + clock-output-names = "pll2-1x", "pll2-2x",
4965 + "pll2-4x", "pll2-8x";
4966 + };
4967 +
4968 pll4: clk@01c20018 {
4969 #clock-cells = <0>;
4970 compatible = "allwinner,sun7i-a20-pll4-clk";
4971 @@ -267,6 +278,19 @@
4972 compatible = "allwinner,sun7i-a20-ahb-gates-clk";
4973 reg = <0x01c20060 0x8>;
4974 clocks = <&ahb>;
4975 + clock-indices = <0>, <1>,
4976 + <2>, <3>, <4>,
4977 + <5>, <6>, <7>, <8>,
4978 + <9>, <10>, <11>, <12>,
4979 + <13>, <14>, <16>,
4980 + <17>, <18>, <20>, <21>,
4981 + <22>, <23>, <25>,
4982 + <28>, <32>, <33>, <34>,
4983 + <35>, <36>, <37>, <40>,
4984 + <41>, <42>, <43>,
4985 + <44>, <45>, <46>,
4986 + <47>, <49>, <50>,
4987 + <52>;
4988 clock-output-names = "ahb_usb0", "ahb_ehci0",
4989 "ahb_ohci0", "ahb_ehci1", "ahb_ohci1",
4990 "ahb_ss", "ahb_dma", "ahb_bist", "ahb_mmc0",
4991 @@ -295,6 +319,10 @@
4992 compatible = "allwinner,sun7i-a20-apb0-gates-clk";
4993 reg = <0x01c20068 0x4>;
4994 clocks = <&apb0>;
4995 + clock-indices = <0>, <1>,
4996 + <2>, <3>, <4>,
4997 + <5>, <6>, <7>,
4998 + <8>, <10>;
4999 clock-output-names = "apb0_codec", "apb0_spdif",
5000 "apb0_ac97", "apb0_iis0", "apb0_iis1",
5001 "apb0_pio", "apb0_ir0", "apb0_ir1",
5002 @@ -314,6 +342,12 @@
5003 compatible = "allwinner,sun7i-a20-apb1-gates-clk";
5004 reg = <0x01c2006c 0x4>;
5005 clocks = <&apb1>;
5006 + clock-indices = <0>, <1>,
5007 + <2>, <3>, <4>,
5008 + <5>, <6>, <7>,
5009 + <15>, <16>, <17>,
5010 + <18>, <19>, <20>,
5011 + <21>, <22>, <23>;
5012 clock-output-names = "apb1_i2c0", "apb1_i2c1",
5013 "apb1_i2c2", "apb1_i2c3", "apb1_can",
5014 "apb1_scr", "apb1_ps20", "apb1_ps21",
5015 @@ -442,6 +476,14 @@
5016 clock-output-names = "ir1";
5017 };
5018
5019 + keypad_clk: clk@01c200c4 {
5020 + #clock-cells = <0>;
5021 + compatible = "allwinner,sun4i-a10-mod0-clk";
5022 + reg = <0x01c200c4 0x4>;
5023 + clocks = <&osc24M>;
5024 + clock-output-names = "keypad";
5025 + };
5026 +
5027 usb_clk: clk@01c200cc {
5028 #clock-cells = <1>;
5029 #reset-cells = <1>;
5030 @@ -460,6 +502,48 @@
5031 clock-output-names = "spi3";
5032 };
5033
5034 + dram_gates: clk@01c20100 {
5035 + #clock-cells = <1>;
5036 + compatible = "allwinner,sun4i-a10-dram-gates-clk";
5037 + reg = <0x01c20100 0x4>;
5038 + clocks = <&pll5 0>;
5039 + clock-indices = <0>,
5040 + <1>, <2>,
5041 + <3>,
5042 + <4>,
5043 + <5>, <6>,
5044 + <15>,
5045 + <24>, <25>,
5046 + <26>, <27>,
5047 + <28>, <29>;
5048 + clock-output-names = "dram_ve",
5049 + "dram_csi0", "dram_csi1",
5050 + "dram_ts",
5051 + "dram_tvd",
5052 + "dram_tve0", "dram_tve1",
5053 + "dram_output",
5054 + "dram_de_fe1", "dram_de_fe0",
5055 + "dram_de_be0", "dram_de_be1",
5056 + "dram_de_mp", "dram_ace";
5057 + };
5058 +
5059 + ve_clk: clk@01c2013c {
5060 + #clock-cells = <0>;
5061 + #reset-cells = <0>;
5062 + compatible = "allwinner,sun4i-a10-ve-clk";
5063 + reg = <0x01c2013c 0x4>;
5064 + clocks = <&pll4>;
5065 + clock-output-names = "ve";
5066 + };
5067 +
5068 + codec_clk: clk@01c20140 {
5069 + #clock-cells = <0>;
5070 + compatible = "allwinner,sun4i-a10-codec-clk";
5071 + reg = <0x01c20140 0x4>;
5072 + clocks = <&pll2 SUN4I_A10_PLL2_1X>;
5073 + clock-output-names = "codec";
5074 + };
5075 +
5076 mbus_clk: clk@01c2015c {
5077 #clock-cells = <0>;
5078 compatible = "allwinner,sun5i-a13-mbus-clk";
5079 @@ -744,6 +828,14 @@
5080 status = "disabled";
5081 };
5082
5083 + crypto: crypto-engine@01c15000 {
5084 + compatible = "allwinner,sun4i-a10-crypto";
5085 + reg = <0x01c15000 0x1000>;
5086 + interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
5087 + clocks = <&ahb_gates 5>, <&ss_clk>;
5088 + clock-names = "ahb", "mod";
5089 + };
5090 +
5091 spi2: spi@01c17000 {
5092 compatible = "allwinner,sun4i-a10-spi";
5093 reg = <0x01c17000 0x1000>;
5094 @@ -1159,6 +1251,19 @@
5095 status = "disabled";
5096 };
5097
5098 + codec: codec@01c22c00 {
5099 + #sound-dai-cells = <0>;
5100 + compatible = "allwinner,sun7i-a20-codec";
5101 + reg = <0x01c22c00 0x40>;
5102 + interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
5103 + clocks = <&apb0_gates 0>, <&codec_clk>;
5104 + clock-names = "apb", "codec";
5105 + dmas = <&dma SUN4I_DMA_NORMAL 19>,
5106 + <&dma SUN4I_DMA_NORMAL 19>;
5107 + dma-names = "rx", "tx";
5108 + status = "disabled";
5109 + };
5110 +
5111 sid: eeprom@01c23800 {
5112 compatible = "allwinner,sun7i-a20-sid";
5113 reg = <0x01c23800 0x200>;
5114 --- a/arch/arm/dts/sun8i-a23-a33.dtsi
5115 +++ b/arch/arm/dts/sun8i-a23-a33.dtsi
5116 @@ -56,7 +56,7 @@
5117 #size-cells = <1>;
5118 ranges;
5119
5120 - framebuffer@0 {
5121 + simplefb_lcd: framebuffer@0 {
5122 compatible = "allwinner,simple-framebuffer",
5123 "simple-framebuffer";
5124 allwinner,pipeline = "de_be0-lcd0";
5125 @@ -175,27 +175,13 @@
5126 clock-output-names = "apb1";
5127 };
5128
5129 - ahb1_gates: clk@01c20060 {
5130 - #clock-cells = <1>;
5131 - compatible = "allwinner,sun8i-a23-ahb1-gates-clk";
5132 - reg = <0x01c20060 0x8>;
5133 - clocks = <&ahb1>;
5134 - clock-output-names = "ahb1_mipidsi", "ahb1_dma",
5135 - "ahb1_mmc0", "ahb1_mmc1", "ahb1_mmc2",
5136 - "ahb1_nand", "ahb1_sdram",
5137 - "ahb1_hstimer", "ahb1_spi0",
5138 - "ahb1_spi1", "ahb1_otg", "ahb1_ehci",
5139 - "ahb1_ohci", "ahb1_ve", "ahb1_lcd",
5140 - "ahb1_csi", "ahb1_be", "ahb1_fe",
5141 - "ahb1_gpu", "ahb1_spinlock",
5142 - "ahb1_drc";
5143 - };
5144 -
5145 apb1_gates: clk@01c20068 {
5146 #clock-cells = <1>;
5147 compatible = "allwinner,sun8i-a23-apb1-gates-clk";
5148 reg = <0x01c20068 0x4>;
5149 clocks = <&apb1>;
5150 + clock-indices = <0>, <5>,
5151 + <12>, <13>;
5152 clock-output-names = "apb1_codec", "apb1_pio",
5153 "apb1_daudio0", "apb1_daudio1";
5154 };
5155 @@ -213,6 +199,10 @@
5156 compatible = "allwinner,sun8i-a23-apb2-gates-clk";
5157 reg = <0x01c2006c 0x4>;
5158 clocks = <&apb2>;
5159 + clock-indices = <0>, <1>,
5160 + <2>, <16>,
5161 + <17>, <18>,
5162 + <19>, <20>;
5163 clock-output-names = "apb2_i2c0", "apb2_i2c1",
5164 "apb2_i2c2", "apb2_uart0",
5165 "apb2_uart1", "apb2_uart2",
5166 @@ -391,12 +381,19 @@
5167 allwinner,pins = "PC5", "PC6", "PC8",
5168 "PC9", "PC10", "PC11",
5169 "PC12", "PC13", "PC14",
5170 - "PC15";
5171 + "PC15", "PC16";
5172 allwinner,function = "mmc2";
5173 allwinner,drive = <SUN4I_PINCTRL_30_MA>;
5174 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
5175 };
5176
5177 + pwm0_pins: pwm0 {
5178 + allwinner,pins = "PH0";
5179 + allwinner,function = "pwm0";
5180 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
5181 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
5182 + };
5183 +
5184 i2c0_pins_a: i2c0@0 {
5185 allwinner,pins = "PH2", "PH3";
5186 allwinner,function = "i2c0";
5187 @@ -451,6 +448,14 @@
5188 interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
5189 };
5190
5191 + pwm: pwm@01c21400 {
5192 + compatible = "allwinner,sun7i-a20-pwm";
5193 + reg = <0x01c21400 0xc>;
5194 + clocks = <&osc24M>;
5195 + #pwm-cells = <3>;
5196 + status = "disabled";
5197 + };
5198 +
5199 lradc: lradc@01c22800 {
5200 compatible = "allwinner,sun4i-a10-lradc-keys";
5201 reg = <0x01c22800 0x100>;
5202 @@ -574,6 +579,14 @@
5203 <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
5204 };
5205
5206 + nmi_intc: interrupt-controller@01f00c0c {
5207 + compatible = "allwinner,sun6i-a31-sc-nmi";
5208 + interrupt-controller;
5209 + #interrupt-cells = <2>;
5210 + reg = <0x01f00c0c 0x38>;
5211 + interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
5212 + };
5213 +
5214 prcm@01f01400 {
5215 compatible = "allwinner,sun8i-a23-prcm";
5216 reg = <0x01f01400 0x200>;
5217 @@ -642,10 +655,18 @@
5218 resets = <&apb0_rst 0>;
5219 gpio-controller;
5220 interrupt-controller;
5221 + #interrupt-cells = <3>;
5222 #address-cells = <1>;
5223 #size-cells = <0>;
5224 #gpio-cells = <3>;
5225
5226 + r_rsb_pins: r_rsb {
5227 + allwinner,pins = "PL0", "PL1";
5228 + allwinner,function = "s_rsb";
5229 + allwinner,drive = <SUN4I_PINCTRL_20_MA>;
5230 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
5231 + };
5232 +
5233 r_uart_pins_a: r_uart@0 {
5234 allwinner,pins = "PL2", "PL3";
5235 allwinner,function = "s_uart";
5236 @@ -653,5 +674,19 @@
5237 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
5238 };
5239 };
5240 +
5241 + r_rsb: rsb@01f03400 {
5242 + compatible = "allwinner,sun8i-a23-rsb";
5243 + reg = <0x01f03400 0x400>;
5244 + interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>;
5245 + clocks = <&apb0_gates 3>;
5246 + clock-frequency = <3000000>;
5247 + resets = <&apb0_rst 3>;
5248 + pinctrl-names = "default";
5249 + pinctrl-0 = <&r_rsb_pins>;
5250 + status = "disabled";
5251 + #address-cells = <1>;
5252 + #size-cells = <0>;
5253 + };
5254 };
5255 };
5256 --- a/arch/arm/dts/sun8i-a23-gt90h-v4.dts
5257 +++ b/arch/arm/dts/sun8i-a23-gt90h-v4.dts
5258 @@ -47,15 +47,26 @@
5259 #include <dt-bindings/gpio/gpio.h>
5260 #include <dt-bindings/input/input.h>
5261 #include <dt-bindings/pinctrl/sun4i-a10.h>
5262 +#include <dt-bindings/pwm/pwm.h>
5263
5264 / {
5265 - model = "Allwinner GT90H Quad Core Tablet (v4)";
5266 - compatible = "allwinner,gt90h-v4", "allwinner,sun8i-a33";
5267 + model = "Allwinner GT90H Dual Core Tablet (v4)";
5268 + compatible = "allwinner,gt90h-v4", "allwinner,sun8i-a23";
5269
5270 aliases {
5271 serial0 = &r_uart;
5272 };
5273
5274 + backlight: backlight {
5275 + compatible = "pwm-backlight";
5276 + pinctrl-names = "default";
5277 + pinctrl-0 = <&bl_en_pin_gt90h>;
5278 + pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
5279 + brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
5280 + default-brightness-level = <8>;
5281 + enable-gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
5282 + };
5283 +
5284 chosen {
5285 stdout-path = "serial0:115200n8";
5286 };
5287 @@ -106,8 +117,7 @@
5288 &mmc0 {
5289 pinctrl-names = "default";
5290 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_gt90h>;
5291 - /* FIXME this really is aldo1, correct once we've pmic support */
5292 - vmmc-supply = <&reg_vcc3v0>;
5293 + vmmc-supply = <&reg_aldo1>;
5294 bus-width = <4>;
5295 cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */
5296 cd-inverted;
5297 @@ -115,6 +125,13 @@
5298 };
5299
5300 &pio {
5301 + bl_en_pin_gt90h: bl_en_pin@0 {
5302 + allwinner,pins = "PH6";
5303 + allwinner,function = "gpio_in";
5304 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
5305 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
5306 + };
5307 +
5308 mmc0_cd_pin_gt90h: mmc0_cd_pin@0 {
5309 allwinner,pins = "PB4";
5310 allwinner,function = "gpio_in";
5311 @@ -123,12 +140,106 @@
5312 };
5313 };
5314
5315 +&pwm {
5316 + pinctrl-names = "default";
5317 + pinctrl-0 = <&pwm0_pins>;
5318 + status = "okay";
5319 +};
5320 +
5321 +&r_rsb {
5322 + status = "okay";
5323 +
5324 + axp22x: pmic@3a3 {
5325 + compatible = "x-powers,axp223";
5326 + reg = <0x3a3>;
5327 + interrupt-parent = <&nmi_intc>;
5328 + interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
5329 + eldoin-supply = <&reg_dcdc1>;
5330 + };
5331 +};
5332 +
5333 &r_uart {
5334 pinctrl-names = "default";
5335 pinctrl-0 = <&r_uart_pins_a>;
5336 status = "okay";
5337 };
5338
5339 +#include "axp22x.dtsi"
5340 +
5341 +&reg_aldo1 {
5342 + regulator-always-on;
5343 + regulator-min-microvolt = <3000000>;
5344 + regulator-max-microvolt = <3000000>;
5345 + regulator-name = "vcc-io";
5346 +};
5347 +
5348 +&reg_aldo2 {
5349 + regulator-always-on;
5350 + regulator-min-microvolt = <2350000>;
5351 + regulator-max-microvolt = <2650000>;
5352 + regulator-name = "vdd-dll";
5353 +};
5354 +
5355 +&reg_aldo3 {
5356 + regulator-always-on;
5357 + regulator-min-microvolt = <2700000>;
5358 + regulator-max-microvolt = <3300000>;
5359 + regulator-name = "vcc-pll-avcc";
5360 +};
5361 +
5362 +&reg_dc1sw {
5363 + regulator-name = "vcc-lcd";
5364 +};
5365 +
5366 +&reg_dc5ldo {
5367 + regulator-always-on;
5368 + regulator-min-microvolt = <900000>;
5369 + regulator-max-microvolt = <1400000>;
5370 + regulator-name = "vdd-cpus";
5371 +};
5372 +
5373 +&reg_dcdc1 {
5374 + regulator-always-on;
5375 + regulator-min-microvolt = <3000000>;
5376 + regulator-max-microvolt = <3000000>;
5377 + regulator-name = "vcc-3v0";
5378 +};
5379 +
5380 +&reg_dcdc2 {
5381 + regulator-always-on;
5382 + regulator-min-microvolt = <900000>;
5383 + regulator-max-microvolt = <1400000>;
5384 + regulator-name = "vdd-sys";
5385 +};
5386 +
5387 +&reg_dcdc3 {
5388 + regulator-always-on;
5389 + regulator-min-microvolt = <900000>;
5390 + regulator-max-microvolt = <1400000>;
5391 + regulator-name = "vdd-cpu";
5392 +};
5393 +
5394 +&reg_dcdc5 {
5395 + regulator-always-on;
5396 + regulator-min-microvolt = <1500000>;
5397 + regulator-max-microvolt = <1500000>;
5398 + regulator-name = "vcc-dram";
5399 +};
5400 +
5401 +&reg_dldo1 {
5402 + regulator-min-microvolt = <3300000>;
5403 + regulator-max-microvolt = <3300000>;
5404 + regulator-name = "vcc-wifi";
5405 +};
5406 +
5407 +&reg_rtc_ldo {
5408 + regulator-name = "vcc-rtc";
5409 +};
5410 +
5411 +&simplefb_lcd {
5412 + vcc-lcd-supply = <&reg_dc1sw>;
5413 +};
5414 +
5415 /*
5416 * FIXME for now we only support host mode and rely on u-boot to have
5417 * turned on Vbus which is controlled by the axp223 pmic on the board.
5418 @@ -141,5 +252,6 @@
5419 };
5420
5421 &usbphy {
5422 + usb1_vbus-supply = <&reg_dldo1>;
5423 status = "okay";
5424 };
5425 --- a/arch/arm/dts/sun8i-a23.dtsi
5426 +++ b/arch/arm/dts/sun8i-a23.dtsi
5427 @@ -50,6 +50,31 @@
5428 };
5429
5430 clocks {
5431 + ahb1_gates: clk@01c20060 {
5432 + #clock-cells = <1>;
5433 + compatible = "allwinner,sun8i-a23-ahb1-gates-clk";
5434 + reg = <0x01c20060 0x8>;
5435 + clocks = <&ahb1>;
5436 + clock-indices = <1>, <6>,
5437 + <8>, <9>, <10>,
5438 + <13>, <14>,
5439 + <19>, <20>,
5440 + <21>, <24>, <26>,
5441 + <29>, <32>, <36>,
5442 + <40>, <44>, <46>,
5443 + <52>, <53>,
5444 + <54>, <57>;
5445 + clock-output-names = "ahb1_mipidsi", "ahb1_dma",
5446 + "ahb1_mmc0", "ahb1_mmc1", "ahb1_mmc2",
5447 + "ahb1_nand", "ahb1_sdram",
5448 + "ahb1_hstimer", "ahb1_spi0",
5449 + "ahb1_spi1", "ahb1_otg", "ahb1_ehci",
5450 + "ahb1_ohci", "ahb1_ve", "ahb1_lcd",
5451 + "ahb1_csi", "ahb1_be", "ahb1_fe",
5452 + "ahb1_gpu", "ahb1_msgbox",
5453 + "ahb1_spinlock", "ahb1_drc";
5454 + };
5455 +
5456 mbus_clk: clk@01c2015c {
5457 #clock-cells = <0>;
5458 compatible = "allwinner,sun8i-a23-mbus-clk";
5459 --- a/arch/arm/dts/sun8i-a33-sinlinx-sina33.dts
5460 +++ b/arch/arm/dts/sun8i-a33-sinlinx-sina33.dts
5461 @@ -68,7 +68,7 @@
5462 };
5463
5464 &lradc {
5465 - vref-supply = <&reg_vcc3v0>;
5466 + vref-supply = <&reg_dcdc1>;
5467 status = "okay";
5468
5469 button@200 {
5470 @@ -96,7 +96,7 @@
5471 &mmc0 {
5472 pinctrl-names = "default";
5473 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_sina33>;
5474 - vmmc-supply = <&reg_vcc3v0>;
5475 + vmmc-supply = <&reg_dcdc1>;
5476 bus-width = <4>;
5477 cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */
5478 cd-inverted;
5479 @@ -106,13 +106,16 @@
5480 &mmc2 {
5481 pinctrl-names = "default";
5482 pinctrl-0 = <&mmc2_8bit_pins>;
5483 - vmmc-supply = <&reg_vcc3v0>;
5484 + vmmc-supply = <&reg_dcdc1>;
5485 bus-width = <8>;
5486 non-removable;
5487 + cap-mmc-hw-reset;
5488 status = "okay";
5489 };
5490
5491 &mmc2_8bit_pins {
5492 + /* Increase drive strength for DDR modes */
5493 + allwinner,drive = <SUN4I_PINCTRL_40_MA>;
5494 /* eMMC is missing pull-ups */
5495 allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
5496 };
5497 @@ -130,6 +133,80 @@
5498 };
5499 };
5500
5501 +&r_rsb {
5502 + status = "okay";
5503 +
5504 + axp22x: pmic@3a3 {
5505 + compatible = "x-powers,axp223";
5506 + reg = <0x3a3>;
5507 + interrupt-parent = <&nmi_intc>;
5508 + interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
5509 + eldoin-supply = <&reg_dcdc1>;
5510 + };
5511 +};
5512 +
5513 +#include "axp22x.dtsi"
5514 +
5515 +&reg_aldo1 {
5516 + regulator-always-on;
5517 + regulator-min-microvolt = <3000000>;
5518 + regulator-max-microvolt = <3000000>;
5519 + regulator-name = "vcc-io";
5520 +};
5521 +
5522 +&reg_aldo2 {
5523 + regulator-always-on;
5524 + regulator-min-microvolt = <2350000>;
5525 + regulator-max-microvolt = <2650000>;
5526 + regulator-name = "vdd-dll";
5527 +};
5528 +
5529 +&reg_aldo3 {
5530 + regulator-always-on;
5531 + regulator-min-microvolt = <2700000>;
5532 + regulator-max-microvolt = <3300000>;
5533 + regulator-name = "vcc-pll-avcc";
5534 +};
5535 +
5536 +&reg_dc5ldo {
5537 + regulator-always-on;
5538 + regulator-min-microvolt = <900000>;
5539 + regulator-max-microvolt = <1400000>;
5540 + regulator-name = "vdd-cpus";
5541 +};
5542 +
5543 +&reg_dcdc1 {
5544 + regulator-always-on;
5545 + regulator-min-microvolt = <3000000>;
5546 + regulator-max-microvolt = <3000000>;
5547 + regulator-name = "vcc-3v0";
5548 +};
5549 +
5550 +&reg_dcdc2 {
5551 + regulator-always-on;
5552 + regulator-min-microvolt = <900000>;
5553 + regulator-max-microvolt = <1400000>;
5554 + regulator-name = "vdd-sys";
5555 +};
5556 +
5557 +&reg_dcdc3 {
5558 + regulator-always-on;
5559 + regulator-min-microvolt = <900000>;
5560 + regulator-max-microvolt = <1400000>;
5561 + regulator-name = "vdd-cpu";
5562 +};
5563 +
5564 +&reg_dcdc5 {
5565 + regulator-always-on;
5566 + regulator-min-microvolt = <1500000>;
5567 + regulator-max-microvolt = <1500000>;
5568 + regulator-name = "vcc-dram";
5569 +};
5570 +
5571 +&reg_rtc_ldo {
5572 + regulator-name = "vcc-rtc";
5573 +};
5574 +
5575 &uart0 {
5576 pinctrl-names = "default";
5577 pinctrl-0 = <&uart0_pins_b>;
5578 --- a/arch/arm/dts/sun8i-a33.dtsi
5579 +++ b/arch/arm/dts/sun8i-a33.dtsi
5580 @@ -72,6 +72,41 @@
5581 clock-output-names = "pll11";
5582 };
5583
5584 + ahb1_gates: clk@01c20060 {
5585 + #clock-cells = <1>;
5586 + compatible = "allwinner,sun8i-a33-ahb1-gates-clk";
5587 + reg = <0x01c20060 0x8>;
5588 + clocks = <&ahb1>;
5589 + clock-indices = <1>, <5>,
5590 + <6>, <8>, <9>,
5591 + <10>, <13>, <14>,
5592 + <19>, <20>,
5593 + <21>, <24>, <26>,
5594 + <29>, <32>, <36>,
5595 + <40>, <44>, <46>,
5596 + <52>, <53>,
5597 + <54>, <57>,
5598 + <58>;
5599 + clock-output-names = "ahb1_mipidsi", "ahb1_ss",
5600 + "ahb1_dma","ahb1_mmc0", "ahb1_mmc1",
5601 + "ahb1_mmc2", "ahb1_nand", "ahb1_sdram",
5602 + "ahb1_hstimer", "ahb1_spi0",
5603 + "ahb1_spi1", "ahb1_otg", "ahb1_ehci",
5604 + "ahb1_ohci", "ahb1_ve", "ahb1_lcd",
5605 + "ahb1_csi", "ahb1_be", "ahb1_fe",
5606 + "ahb1_gpu", "ahb1_msgbox",
5607 + "ahb1_spinlock", "ahb1_drc",
5608 + "ahb1_sat";
5609 + };
5610 +
5611 + ss_clk: clk@01c2009c {
5612 + #clock-cells = <0>;
5613 + compatible = "allwinner,sun4i-a10-mod0-clk";
5614 + reg = <0x01c2009c 0x4>;
5615 + clocks = <&osc24M>, <&pll6 0>;
5616 + clock-output-names = "ss";
5617 + };
5618 +
5619 mbus_clk: clk@01c2015c {
5620 #clock-cells = <0>;
5621 compatible = "allwinner,sun8i-a23-mbus-clk";
5622 @@ -82,6 +117,16 @@
5623 };
5624
5625 soc@01c00000 {
5626 + crypto: crypto-engine@01c15000 {
5627 + compatible = "allwinner,sun4i-a10-crypto";
5628 + reg = <0x01c15000 0x1000>;
5629 + interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>;
5630 + clocks = <&ahb1_gates 5>, <&ss_clk>;
5631 + clock-names = "ahb", "mod";
5632 + resets = <&ahb1_rst 5>;
5633 + reset-names = "ahb";
5634 + };
5635 +
5636 usb_otg: usb@01c19000 {
5637 compatible = "allwinner,sun8i-a33-musb";
5638 reg = <0x01c19000 0x0400>;
5639 --- /dev/null
5640 +++ b/arch/arm/dts/sun8i-a83t-cubietruck-plus.dts
5641 @@ -0,0 +1,65 @@
5642 +/*
5643 + * Copyright 2015 Chen-Yu Tsai
5644 + *
5645 + * Chen-Yu Tsai <wens@csie.org>
5646 + *
5647 + * This file is dual-licensed: you can use it either under the terms
5648 + * of the GPL or the X11 license, at your option. Note that this dual
5649 + * licensing only applies to this file, and not this project as a
5650 + * whole.
5651 + *
5652 + * a) This file is free software; you can redistribute it and/or
5653 + * modify it under the terms of the GNU General Public License as
5654 + * published by the Free Software Foundation; either version 2 of the
5655 + * License, or (at your option) any later version.
5656 + *
5657 + * This file is distributed in the hope that it will be useful,
5658 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
5659 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5660 + * GNU General Public License for more details.
5661 + *
5662 + * Or, alternatively,
5663 + *
5664 + * b) Permission is hereby granted, free of charge, to any person
5665 + * obtaining a copy of this software and associated documentation
5666 + * files (the "Software"), to deal in the Software without
5667 + * restriction, including without limitation the rights to use,
5668 + * copy, modify, merge, publish, distribute, sublicense, and/or
5669 + * sell copies of the Software, and to permit persons to whom the
5670 + * Software is furnished to do so, subject to the following
5671 + * conditions:
5672 + *
5673 + * The above copyright notice and this permission notice shall be
5674 + * included in all copies or substantial portions of the Software.
5675 + *
5676 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
5677 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
5678 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
5679 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
5680 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
5681 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
5682 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
5683 + * OTHER DEALINGS IN THE SOFTWARE.
5684 + */
5685 +
5686 +/dts-v1/;
5687 +#include "sun8i-a83t.dtsi"
5688 +
5689 +/ {
5690 + model = "Cubietech Cubietruck Plus";
5691 + compatible = "cubietech,cubietruck-plus", "allwinner,sun8i-a83t";
5692 +
5693 + aliases {
5694 + serial0 = &uart0;
5695 + };
5696 +
5697 + chosen {
5698 + stdout-path = "serial0:115200n8";
5699 + };
5700 +};
5701 +
5702 +&uart0 {
5703 + pinctrl-names = "default";
5704 + pinctrl-0 = <&uart0_pins_b>;
5705 + status = "okay";
5706 +};
5707 --- a/arch/arm/dts/sun8i-a83t.dtsi
5708 +++ b/arch/arm/dts/sun8i-a83t.dtsi
5709 @@ -52,12 +52,6 @@
5710 / {
5711 interrupt-parent = <&gic>;
5712
5713 - chosen {
5714 - #address-cells = <1>;
5715 - #size-cells = <1>;
5716 - ranges;
5717 - };
5718 -
5719 cpus {
5720 #address-cells = <1>;
5721 #size-cells = <0>;
5722 @@ -85,6 +79,7 @@
5723 device_type = "cpu";
5724 reg = <3>;
5725 };
5726 +
5727 cpu@100 {
5728 compatible = "arm,cortex-a7";
5729 device_type = "cpu";
5730 @@ -96,6 +91,7 @@
5731 device_type = "cpu";
5732 reg = <0x101>;
5733 };
5734 +
5735 cpu@102 {
5736 compatible = "arm,cortex-a7";
5737 device_type = "cpu";
5738 @@ -109,18 +105,12 @@
5739 };
5740 };
5741
5742 - memory {
5743 - reg = <0x40000000 0x80000000>;
5744 - };
5745 -
5746 timer {
5747 compatible = "arm,armv7-timer";
5748 - interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
5749 - <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
5750 - <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
5751 - <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
5752 - clock-frequency = <24000000>;
5753 - arm,cpu-registers-not-fw-configured;
5754 + interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
5755 + <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
5756 + <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
5757 + <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>;
5758 };
5759
5760 clocks {
5761 @@ -128,6 +118,7 @@
5762 #size-cells = <1>;
5763 ranges;
5764
5765 + /* TODO: PRCM block has a mux for this. */
5766 osc24M: osc24M_clk {
5767 #clock-cells = <0>;
5768 compatible = "fixed-clock";
5769 @@ -135,36 +126,39 @@
5770 clock-output-names = "osc24M";
5771 };
5772
5773 - osc32k: osc32k_clk {
5774 + /*
5775 + * This is called "internal OSC" in some places.
5776 + * It is an internal RC-based oscillator.
5777 + * TODO: Its controls are in the PRCM block.
5778 + */
5779 + osc16M: osc16M_clk {
5780 #clock-cells = <0>;
5781 compatible = "fixed-clock";
5782 - clock-frequency = <32768>;
5783 - clock-output-names = "osc32k";
5784 + clock-frequency = <16000000>;
5785 + clock-output-names = "osc16M";
5786 + };
5787 +
5788 + osc16Md512: osc16Md512_clk {
5789 + #clock-cells = <0>;
5790 + compatible = "fixed-factor-clock";
5791 + clock-div = <512>;
5792 + clock-mult = <1>;
5793 + clocks = <&osc16M>;
5794 + clock-output-names = "osc16M-d512";
5795 };
5796 };
5797
5798 - soc@01c00000 {
5799 + soc {
5800 compatible = "simple-bus";
5801 #address-cells = <1>;
5802 #size-cells = <1>;
5803 ranges;
5804
5805 - gic: interrupt-controller@01c81000 {
5806 - compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic";
5807 - reg = <0x01c81000 0x1000>,
5808 - <0x01c82000 0x1000>,
5809 - <0x01c84000 0x2000>,
5810 - <0x01c86000 0x2000>;
5811 - interrupt-controller;
5812 - #interrupt-cells = <3>;
5813 - interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
5814 - };
5815 -
5816 pio: pinctrl@01c20800 {
5817 compatible = "allwinner,sun8i-a83t-pinctrl";
5818 interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
5819 - <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>,
5820 - <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
5821 + <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>,
5822 + <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>;
5823 reg = <0x01c20800 0x400>;
5824 clocks = <&osc24M>;
5825 gpio-controller;
5826 @@ -172,27 +166,6 @@
5827 #interrupt-cells = <3>;
5828 #gpio-cells = <3>;
5829
5830 - i2c0_pins_a: i2c0@0 {
5831 - allwinner,pins = "PH0", "PH1";
5832 - allwinner,function = "i2c0";
5833 - allwinner,drive = <SUN4I_PINCTRL_10_MA>;
5834 - allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
5835 - };
5836 -
5837 - i2c1_pins_a: i2c1@0 {
5838 - allwinner,pins = "PH2", "PH3";
5839 - allwinner,function = "i2c1";
5840 - allwinner,drive = <SUN4I_PINCTRL_10_MA>;
5841 - allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
5842 - };
5843 -
5844 - i2c2_pins_a: i2c2@0 {
5845 - allwinner,pins = "PH4", "PH5";
5846 - allwinner,function = "i2c2";
5847 - allwinner,drive = <SUN4I_PINCTRL_10_MA>;
5848 - allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
5849 - };
5850 -
5851 mmc0_pins_a: mmc0@0 {
5852 allwinner,pins = "PF0", "PF1", "PF2",
5853 "PF3", "PF4", "PF5";
5854 @@ -201,24 +174,6 @@
5855 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
5856 };
5857
5858 - mmc1_pins_a: mmc1@0 {
5859 - allwinner,pins = "PG0", "PG1", "PG2",
5860 - "PG3", "PG4", "PG5";
5861 - allwinner,function = "mmc1";
5862 - allwinner,drive = <SUN4I_PINCTRL_30_MA>;
5863 - allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
5864 - };
5865 -
5866 - mmc2_8bit_pins: mmc2_8bit {
5867 - allwinner,pins = "PC5", "PC6", "PC8",
5868 - "PC9", "PC10", "PC11",
5869 - "PC12", "PC13", "PC14",
5870 - "PC15";
5871 - allwinner,function = "mmc2";
5872 - allwinner,drive = <SUN4I_PINCTRL_30_MA>;
5873 - allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
5874 - };
5875 -
5876 uart0_pins_a: uart0@0 {
5877 allwinner,pins = "PF2", "PF4";
5878 allwinner,function = "uart0";
5879 @@ -234,6 +189,21 @@
5880 };
5881 };
5882
5883 + timer@01c20c00 {
5884 + compatible = "allwinner,sun4i-a10-timer";
5885 + reg = <0x01c20c00 0xa0>;
5886 + interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>,
5887 + <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
5888 + clocks = <&osc24M>;
5889 + };
5890 +
5891 + watchdog@01c20ca0 {
5892 + compatible = "allwinner,sun6i-a31-wdt";
5893 + reg = <0x01c20ca0 0x20>;
5894 + interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
5895 + clocks = <&osc24M>;
5896 + };
5897 +
5898 uart0: serial@01c28000 {
5899 compatible = "snps,dw-apb-uart";
5900 reg = <0x01c28000 0x400>;
5901 @@ -243,5 +213,16 @@
5902 clocks = <&osc24M>;
5903 status = "disabled";
5904 };
5905 +
5906 + gic: interrupt-controller@01c81000 {
5907 + compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic";
5908 + reg = <0x01c81000 0x1000>,
5909 + <0x01c82000 0x1000>,
5910 + <0x01c84000 0x2000>,
5911 + <0x01c86000 0x2000>;
5912 + interrupt-controller;
5913 + #interrupt-cells = <3>;
5914 + interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_HIGH)>;
5915 + };
5916 };
5917 };
5918 --- a/arch/arm/dts/sun8i-h3-orangepi-pc.dts
5919 +++ b/arch/arm/dts/sun8i-h3-orangepi-pc.dts
5920 @@ -45,6 +45,7 @@
5921 #include "sunxi-common-regulators.dtsi"
5922
5923 #include <dt-bindings/gpio/gpio.h>
5924 +#include <dt-bindings/input/input.h>
5925 #include <dt-bindings/pinctrl/sun4i-a10.h>
5926
5927 / {
5928 @@ -58,6 +59,43 @@
5929 chosen {
5930 stdout-path = "serial0:115200n8";
5931 };
5932 +
5933 + leds {
5934 + compatible = "gpio-leds";
5935 + pinctrl-names = "default";
5936 + pinctrl-0 = <&leds_opc>;
5937 +
5938 + status_led {
5939 + label = "status:red:user";
5940 + gpios = <&pio 0 15 GPIO_ACTIVE_HIGH>;
5941 + };
5942 + };
5943 +
5944 + r_leds {
5945 + compatible = "gpio-leds";
5946 + pinctrl-names = "default";
5947 + pinctrl-0 = <&leds_r_opc>;
5948 +
5949 + tx {
5950 + label = "pwr:green:user";
5951 + gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
5952 + default-state = "on";
5953 + };
5954 + };
5955 +
5956 + r_gpio_keys {
5957 + compatible = "gpio-keys";
5958 + input-name = "sw4";
5959 +
5960 + pinctrl-names = "default";
5961 + pinctrl-0 = <&sw_r_opc>;
5962 +
5963 + sw4@0 {
5964 + label = "sw4";
5965 + linux,code = <BTN_0>;
5966 + gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
5967 + };
5968 + };
5969 };
5970
5971 &ehci1 {
5972 @@ -72,6 +110,12 @@
5973 status = "okay";
5974 };
5975
5976 +&ir {
5977 + pinctrl-names = "default";
5978 + pinctrl-0 = <&ir_pins_a>;
5979 + status = "okay";
5980 +};
5981 +
5982 &mmc0 {
5983 pinctrl-names = "default";
5984 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
5985 @@ -94,6 +138,31 @@
5986 status = "okay";
5987 };
5988
5989 +&pio {
5990 + leds_opc: led_pins@0 {
5991 + allwinner,pins = "PA15";
5992 + allwinner,function = "gpio_out";
5993 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
5994 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
5995 + };
5996 +};
5997 +
5998 +&r_pio {
5999 + leds_r_opc: led_pins@0 {
6000 + allwinner,pins = "PL10";
6001 + allwinner,function = "gpio_out";
6002 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
6003 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
6004 + };
6005 +
6006 + sw_r_opc: key_pins@0 {
6007 + allwinner,pins = "PL03";
6008 + allwinner,function = "gpio_in";
6009 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
6010 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
6011 + };
6012 +};
6013 +
6014 &uart0 {
6015 pinctrl-names = "default";
6016 pinctrl-0 = <&uart0_pins_a>;
6017 --- a/arch/arm/dts/sun8i-h3-orangepi-plus.dts
6018 +++ b/arch/arm/dts/sun8i-h3-orangepi-plus.dts
6019 @@ -45,6 +45,7 @@
6020 #include "sunxi-common-regulators.dtsi"
6021
6022 #include <dt-bindings/gpio/gpio.h>
6023 +#include <dt-bindings/input/input.h>
6024 #include <dt-bindings/pinctrl/sun4i-a10.h>
6025
6026 / {
6027 @@ -70,6 +71,68 @@
6028 enable-active-high;
6029 gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>;
6030 };
6031 +
6032 + leds {
6033 + compatible = "gpio-leds";
6034 + pinctrl-names = "default";
6035 + pinctrl-0 = <&leds_opc>;
6036 +
6037 + status_led {
6038 + label = "status:red:user";
6039 + gpios = <&pio 0 15 GPIO_ACTIVE_HIGH>;
6040 + };
6041 + };
6042 +
6043 + r_leds {
6044 + compatible = "gpio-leds";
6045 + pinctrl-names = "default";
6046 + pinctrl-0 = <&leds_r_opc>;
6047 +
6048 + tx {
6049 + label = "pwr:green:user";
6050 + gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
6051 + default-state = "on";
6052 + };
6053 + };
6054 +
6055 + r_gpio_keys {
6056 + compatible = "gpio-keys";
6057 + input-name = "sw4";
6058 +
6059 + pinctrl-names = "default";
6060 + pinctrl-0 = <&sw_r_opc>;
6061 +
6062 + sw4@0 {
6063 + label = "sw4";
6064 + linux,code = <BTN_0>;
6065 + gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
6066 + };
6067 + };
6068 +};
6069 +
6070 +&pio {
6071 + leds_opc: led_pins@0 {
6072 + allwinner,pins = "PA15";
6073 + allwinner,function = "gpio_out";
6074 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
6075 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
6076 + };
6077 +};
6078 +
6079 +&r_pio {
6080 + leds_r_opc: led_pins@0 {
6081 + allwinner,pins = "PL10";
6082 + allwinner,function = "gpio_out";
6083 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
6084 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
6085 + };
6086 +
6087 + sw_r_opc: key_pins@0 {
6088 + allwinner,pins = "PL03";
6089 + allwinner,function = "gpio_in";
6090 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
6091 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
6092 + };
6093 };
6094
6095 &ehci1 {
6096 --- a/arch/arm/dts/sun8i-h3.dtsi
6097 +++ b/arch/arm/dts/sun8i-h3.dtsi
6098 @@ -83,12 +83,6 @@
6099 <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
6100 <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
6101 <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
6102 - clock-frequency = <24000000>;
6103 - arm,cpu-registers-not-fw-configured;
6104 - };
6105 -
6106 - memory {
6107 - reg = <0x40000000 0x80000000>;
6108 };
6109
6110 clocks {
6111 @@ -131,15 +125,24 @@
6112 compatible = "allwinner,sun6i-a31-pll6-clk";
6113 reg = <0x01c20028 0x4>;
6114 clocks = <&osc24M>;
6115 - clock-output-names = "pll6", "pll6x2", "pll6d2";
6116 + clock-output-names = "pll6", "pll6x2";
6117 };
6118
6119 - pll8: clk@01c20044 {
6120 - #clock-cells = <1>;
6121 - compatible = "allwinner,sun6i-a31-pll6-clk";
6122 - reg = <0x01c20044 0x4>;
6123 - clocks = <&osc24M>;
6124 - clock-output-names = "pll8", "pll8x2";
6125 + pll6d2: pll6d2_clk {
6126 + #clock-cells = <0>;
6127 + compatible = "fixed-factor-clock";
6128 + clock-div = <2>;
6129 + clock-mult = <1>;
6130 + clocks = <&pll6 0>;
6131 + clock-output-names = "pll6d2";
6132 + };
6133 +
6134 + /* dummy clock until pll6 can be reused */
6135 + pll8: pll8_clk {
6136 + #clock-cells = <0>;
6137 + compatible = "fixed-clock";
6138 + clock-frequency = <1>;
6139 + clock-output-names = "pll8";
6140 };
6141
6142 cpu: cpu_clk@01c20050 {
6143 @@ -170,7 +173,7 @@
6144 #clock-cells = <0>;
6145 compatible = "allwinner,sun8i-h3-ahb2-clk";
6146 reg = <0x01c2005c 0x4>;
6147 - clocks = <&ahb1>, <&pll6 2>;
6148 + clocks = <&ahb1>, <&pll6d2>;
6149 clock-output-names = "ahb2";
6150 };
6151
6152 @@ -213,34 +216,34 @@
6153 <76>, <77>, <78>,
6154 <96>, <97>, <98>,
6155 <112>, <113>,
6156 - <114>, <115>, <116>,
6157 - <128>, <135>;
6158 - clock-output-names = "ahb1_ce", "ahb1_dma", "ahb1_mmc0",
6159 - "ahb1_mmc1", "ahb1_mmc2", "ahb1_nand",
6160 - "ahb1_sdram", "ahb2_gmac", "ahb1_ts",
6161 - "ahb1_hstimer", "ahb1_spi0",
6162 - "ahb1_spi1", "ahb1_otg",
6163 - "ahb1_otg_ehci0", "ahb1_ehic1",
6164 - "ahb1_ehic2", "ahb1_ehic3",
6165 - "ahb1_otg_ohci0", "ahb2_ohic1",
6166 - "ahb2_ohic2", "ahb2_ohic3", "ahb1_ve",
6167 - "ahb1_lcd0", "ahb1_lcd1", "ahb1_deint",
6168 - "ahb1_csi", "ahb1_tve", "ahb1_hdmi",
6169 - "ahb1_de", "ahb1_gpu", "ahb1_msgbox",
6170 - "ahb1_spinlock", "apb1_codec",
6171 - "apb1_spdif", "apb1_pio", "apb1_ths",
6172 - "apb1_i2s0", "apb1_i2s1", "apb1_i2s2",
6173 - "apb2_i2c0", "apb2_i2c1", "apb2_i2c2",
6174 - "apb2_uart0", "apb2_uart1",
6175 - "apb2_uart2", "apb2_uart3", "apb2_scr",
6176 - "ahb1_ephy", "ahb1_dbg";
6177 + <114>, <115>,
6178 + <116>, <128>, <135>;
6179 + clock-output-names = "bus_ce", "bus_dma", "bus_mmc0",
6180 + "bus_mmc1", "bus_mmc2", "bus_nand",
6181 + "bus_sdram", "bus_gmac", "bus_ts",
6182 + "bus_hstimer", "bus_spi0",
6183 + "bus_spi1", "bus_otg",
6184 + "bus_otg_ehci0", "bus_ehci1",
6185 + "bus_ehci2", "bus_ehci3",
6186 + "bus_otg_ohci0", "bus_ohci1",
6187 + "bus_ohci2", "bus_ohci3", "bus_ve",
6188 + "bus_lcd0", "bus_lcd1", "bus_deint",
6189 + "bus_csi", "bus_tve", "bus_hdmi",
6190 + "bus_de", "bus_gpu", "bus_msgbox",
6191 + "bus_spinlock", "bus_codec",
6192 + "bus_spdif", "bus_pio", "bus_ths",
6193 + "bus_i2s0", "bus_i2s1", "bus_i2s2",
6194 + "bus_i2c0", "bus_i2c1", "bus_i2c2",
6195 + "bus_uart0", "bus_uart1",
6196 + "bus_uart2", "bus_uart3",
6197 + "bus_scr", "bus_ephy", "bus_dbg";
6198 };
6199
6200 mmc0_clk: clk@01c20088 {
6201 #clock-cells = <1>;
6202 compatible = "allwinner,sun4i-a10-mmc-clk";
6203 reg = <0x01c20088 0x4>;
6204 - clocks = <&osc24M>, <&pll6 0>, <&pll8 0>;
6205 + clocks = <&osc24M>, <&pll6 0>, <&pll8>;
6206 clock-output-names = "mmc0",
6207 "mmc0_output",
6208 "mmc0_sample";
6209 @@ -250,7 +253,7 @@
6210 #clock-cells = <1>;
6211 compatible = "allwinner,sun4i-a10-mmc-clk";
6212 reg = <0x01c2008c 0x4>;
6213 - clocks = <&osc24M>, <&pll6 0>, <&pll8 0>;
6214 + clocks = <&osc24M>, <&pll6 0>, <&pll8>;
6215 clock-output-names = "mmc1",
6216 "mmc1_output",
6217 "mmc1_sample";
6218 @@ -260,7 +263,7 @@
6219 #clock-cells = <1>;
6220 compatible = "allwinner,sun4i-a10-mmc-clk";
6221 reg = <0x01c20090 0x4>;
6222 - clocks = <&osc24M>, <&pll6 0>, <&pll8 0>;
6223 + clocks = <&osc24M>, <&pll6 0>, <&pll8>;
6224 clock-output-names = "mmc2",
6225 "mmc2_output",
6226 "mmc2_sample";
6227 @@ -285,6 +288,33 @@
6228 clocks = <&osc24M>, <&pll6 1>, <&pll5>;
6229 clock-output-names = "mbus";
6230 };
6231 +
6232 + apb0: apb0_clk {
6233 + compatible = "fixed-factor-clock";
6234 + #clock-cells = <0>;
6235 + clock-div = <1>;
6236 + clock-mult = <1>;
6237 + clocks = <&osc24M>;
6238 + clock-output-names = "apb0";
6239 + };
6240 +
6241 + apb0_gates: clk@01f01428 {
6242 + compatible = "allwinner,sun8i-h3-apb0-gates-clk",
6243 + "allwinner,sun4i-a10-gates-clk";
6244 + reg = <0x01f01428 0x4>;
6245 + #clock-cells = <1>;
6246 + clocks = <&apb0>;
6247 + clock-indices = <0>, <1>;
6248 + clock-output-names = "apb0_pio", "apb0_ir";
6249 + };
6250 +
6251 + ir_clk: ir_clk@01f01454 {
6252 + compatible = "allwinner,sun4i-a10-mod0-clk";
6253 + reg = <0x01f01454 0x4>;
6254 + #clock-cells = <0>;
6255 + clocks = <&osc32k>, <&osc24M>;
6256 + clock-output-names = "ir";
6257 + };
6258 };
6259
6260 soc {
6261 @@ -298,7 +328,7 @@
6262 reg = <0x01c02000 0x1000>;
6263 interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
6264 clocks = <&bus_gates 6>;
6265 - resets = <&bus_rst 6>;
6266 + resets = <&ahb_rst 6>;
6267 #dma-cells = <1>;
6268 };
6269
6270 @@ -313,7 +343,7 @@
6271 "mmc",
6272 "output",
6273 "sample";
6274 - resets = <&bus_rst 8>;
6275 + resets = <&ahb_rst 8>;
6276 reset-names = "ahb";
6277 interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
6278 status = "disabled";
6279 @@ -332,7 +362,7 @@
6280 "mmc",
6281 "output",
6282 "sample";
6283 - resets = <&bus_rst 9>;
6284 + resets = <&ahb_rst 9>;
6285 reset-names = "ahb";
6286 interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
6287 status = "disabled";
6288 @@ -351,7 +381,7 @@
6289 "mmc",
6290 "output",
6291 "sample";
6292 - resets = <&bus_rst 10>;
6293 + resets = <&ahb_rst 10>;
6294 reset-names = "ahb";
6295 interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
6296 status = "disabled";
6297 @@ -396,7 +426,7 @@
6298 reg = <0x01c1b000 0x100>;
6299 interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
6300 clocks = <&bus_gates 25>, <&bus_gates 29>;
6301 - resets = <&bus_rst 25>, <&bus_rst 29>;
6302 + resets = <&ahb_rst 25>, <&ahb_rst 29>;
6303 phys = <&usbphy 1>;
6304 phy-names = "usb";
6305 status = "disabled";
6306 @@ -408,7 +438,7 @@
6307 interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>;
6308 clocks = <&bus_gates 29>, <&bus_gates 25>,
6309 <&usb_clk 17>;
6310 - resets = <&bus_rst 29>, <&bus_rst 25>;
6311 + resets = <&ahb_rst 29>, <&ahb_rst 25>;
6312 phys = <&usbphy 1>;
6313 phy-names = "usb";
6314 status = "disabled";
6315 @@ -419,7 +449,7 @@
6316 reg = <0x01c1c000 0x100>;
6317 interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
6318 clocks = <&bus_gates 26>, <&bus_gates 30>;
6319 - resets = <&bus_rst 26>, <&bus_rst 30>;
6320 + resets = <&ahb_rst 26>, <&ahb_rst 30>;
6321 phys = <&usbphy 2>;
6322 phy-names = "usb";
6323 status = "disabled";
6324 @@ -431,7 +461,7 @@
6325 interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
6326 clocks = <&bus_gates 30>, <&bus_gates 26>,
6327 <&usb_clk 18>;
6328 - resets = <&bus_rst 30>, <&bus_rst 26>;
6329 + resets = <&ahb_rst 30>, <&ahb_rst 26>;
6330 phys = <&usbphy 2>;
6331 phy-names = "usb";
6332 status = "disabled";
6333 @@ -442,7 +472,7 @@
6334 reg = <0x01c1d000 0x100>;
6335 interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>;
6336 clocks = <&bus_gates 27>, <&bus_gates 31>;
6337 - resets = <&bus_rst 27>, <&bus_rst 31>;
6338 + resets = <&ahb_rst 27>, <&ahb_rst 31>;
6339 phys = <&usbphy 3>;
6340 phy-names = "usb";
6341 status = "disabled";
6342 @@ -454,7 +484,7 @@
6343 interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>;
6344 clocks = <&bus_gates 31>, <&bus_gates 27>,
6345 <&usb_clk 19>;
6346 - resets = <&bus_rst 31>, <&bus_rst 27>;
6347 + resets = <&ahb_rst 31>, <&ahb_rst 27>;
6348 phys = <&usbphy 3>;
6349 phy-names = "usb";
6350 status = "disabled";
6351 @@ -469,7 +499,7 @@
6352 gpio-controller;
6353 #gpio-cells = <3>;
6354 interrupt-controller;
6355 - #interrupt-cells = <2>;
6356 + #interrupt-cells = <3>;
6357
6358 uart0_pins_a: uart0@0 {
6359 allwinner,pins = "PA4", "PA5";
6360 @@ -502,10 +532,22 @@
6361 };
6362 };
6363
6364 - bus_rst: reset@01c202c0 {
6365 + ahb_rst: reset@01c202c0 {
6366 #reset-cells = <1>;
6367 - compatible = "allwinner,sun8i-h3-bus-reset";
6368 - reg = <0x01c202c0 0x1c>;
6369 + compatible = "allwinner,sun6i-a31-ahb1-reset";
6370 + reg = <0x01c202c0 0xc>;
6371 + };
6372 +
6373 + apb1_rst: reset@01c202d0 {
6374 + #reset-cells = <1>;
6375 + compatible = "allwinner,sun6i-a31-clock-reset";
6376 + reg = <0x01c202d0 0x4>;
6377 + };
6378 +
6379 + apb2_rst: reset@01c202d8 {
6380 + #reset-cells = <1>;
6381 + compatible = "allwinner,sun6i-a31-clock-reset";
6382 + reg = <0x01c202d8 0x4>;
6383 };
6384
6385 timer@01c20c00 {
6386 @@ -529,7 +571,7 @@
6387 reg-shift = <2>;
6388 reg-io-width = <4>;
6389 clocks = <&bus_gates 112>;
6390 - resets = <&bus_rst 144>;
6391 + resets = <&apb2_rst 16>;
6392 dmas = <&dma 6>, <&dma 6>;
6393 dma-names = "rx", "tx";
6394 status = "disabled";
6395 @@ -542,7 +584,7 @@
6396 reg-shift = <2>;
6397 reg-io-width = <4>;
6398 clocks = <&bus_gates 113>;
6399 - resets = <&bus_rst 145>;
6400 + resets = <&apb2_rst 17>;
6401 dmas = <&dma 7>, <&dma 7>;
6402 dma-names = "rx", "tx";
6403 status = "disabled";
6404 @@ -555,7 +597,7 @@
6405 reg-shift = <2>;
6406 reg-io-width = <4>;
6407 clocks = <&bus_gates 114>;
6408 - resets = <&bus_rst 146>;
6409 + resets = <&apb2_rst 18>;
6410 dmas = <&dma 8>, <&dma 8>;
6411 dma-names = "rx", "tx";
6412 status = "disabled";
6413 @@ -568,7 +610,7 @@
6414 reg-shift = <2>;
6415 reg-io-width = <4>;
6416 clocks = <&bus_gates 115>;
6417 - resets = <&bus_rst 147>;
6418 + resets = <&apb2_rst 19>;
6419 dmas = <&dma 9>, <&dma 9>;
6420 dma-names = "rx", "tx";
6421 status = "disabled";
6422 @@ -591,5 +633,40 @@
6423 interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
6424 <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
6425 };
6426 +
6427 + apb0_reset: reset@01f014b0 {
6428 + reg = <0x01f014b0 0x4>;
6429 + compatible = "allwinner,sun6i-a31-clock-reset";
6430 + #reset-cells = <1>;
6431 + };
6432 +
6433 + ir: ir@01f02000 {
6434 + compatible = "allwinner,sun5i-a13-ir";
6435 + clocks = <&apb0_gates 1>, <&ir_clk>;
6436 + clock-names = "apb", "ir";
6437 + resets = <&apb0_reset 1>;
6438 + interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
6439 + reg = <0x01f02000 0x40>;
6440 + status = "disabled";
6441 + };
6442 +
6443 + r_pio: pinctrl@01f02c00 {
6444 + compatible = "allwinner,sun8i-h3-r-pinctrl";
6445 + reg = <0x01f02c00 0x400>;
6446 + interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
6447 + clocks = <&apb0_gates 0>;
6448 + resets = <&apb0_reset 0>;
6449 + gpio-controller;
6450 + #gpio-cells = <3>;
6451 + interrupt-controller;
6452 + #interrupt-cells = <3>;
6453 +
6454 + ir_pins_a: ir@0 {
6455 + allwinner,pins = "PL11";
6456 + allwinner,function = "s_cir_rx";
6457 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
6458 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
6459 + };
6460 + };
6461 };
6462 };
6463 --- a/arch/arm/dts/sun8i-q8-common.dtsi
6464 +++ b/arch/arm/dts/sun8i-q8-common.dtsi
6465 @@ -41,11 +41,23 @@
6466 */
6467 #include "sunxi-q8-common.dtsi"
6468
6469 +#include <dt-bindings/pwm/pwm.h>
6470 +
6471 / {
6472 aliases {
6473 serial0 = &r_uart;
6474 };
6475
6476 + backlight: backlight {
6477 + compatible = "pwm-backlight";
6478 + pinctrl-names = "default";
6479 + pinctrl-0 = <&bl_en_pin_q8>;
6480 + pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
6481 + brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
6482 + default-brightness-level = <8>;
6483 + enable-gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
6484 + };
6485 +
6486 chosen {
6487 stdout-path = "serial0:115200n8";
6488 };
6489 @@ -54,7 +66,7 @@
6490 &mmc0 {
6491 pinctrl-names = "default";
6492 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_q8>;
6493 - vmmc-supply = <&reg_vcc3v0>;
6494 + vmmc-supply = <&reg_dcdc1>;
6495 bus-width = <4>;
6496 cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */
6497 cd-inverted;
6498 @@ -77,8 +89,90 @@
6499 };
6500 };
6501
6502 +&r_rsb {
6503 + status = "okay";
6504 +
6505 + axp22x: pmic@3a3 {
6506 + compatible = "x-powers,axp223";
6507 + reg = <0x3a3>;
6508 + interrupt-parent = <&nmi_intc>;
6509 + interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
6510 + eldoin-supply = <&reg_dcdc1>;
6511 + };
6512 +};
6513 +
6514 +#include "axp22x.dtsi"
6515 +
6516 +&reg_aldo1 {
6517 + regulator-always-on;
6518 + regulator-min-microvolt = <3000000>;
6519 + regulator-max-microvolt = <3000000>;
6520 + regulator-name = "vcc-io";
6521 +};
6522 +
6523 +&reg_aldo2 {
6524 + regulator-always-on;
6525 + regulator-min-microvolt = <2350000>;
6526 + regulator-max-microvolt = <2650000>;
6527 + regulator-name = "vdd-dll";
6528 +};
6529 +
6530 +&reg_aldo3 {
6531 + regulator-always-on;
6532 + regulator-min-microvolt = <2700000>;
6533 + regulator-max-microvolt = <3300000>;
6534 + regulator-name = "vcc-pll-avcc";
6535 +};
6536 +
6537 +&reg_dc1sw {
6538 + regulator-name = "vcc-lcd";
6539 +};
6540 +
6541 +&reg_dc5ldo {
6542 + regulator-always-on;
6543 + regulator-min-microvolt = <900000>;
6544 + regulator-max-microvolt = <1400000>;
6545 + regulator-name = "vdd-cpus";
6546 +};
6547 +
6548 +&reg_dcdc1 {
6549 + regulator-always-on;
6550 + regulator-min-microvolt = <3000000>;
6551 + regulator-max-microvolt = <3000000>;
6552 + regulator-name = "vcc-3v0";
6553 +};
6554 +
6555 +&reg_dcdc2 {
6556 + regulator-always-on;
6557 + regulator-min-microvolt = <900000>;
6558 + regulator-max-microvolt = <1400000>;
6559 + regulator-name = "vdd-sys";
6560 +};
6561 +
6562 +&reg_dcdc3 {
6563 + regulator-always-on;
6564 + regulator-min-microvolt = <900000>;
6565 + regulator-max-microvolt = <1400000>;
6566 + regulator-name = "vdd-cpu";
6567 +};
6568 +
6569 +&reg_dcdc5 {
6570 + regulator-always-on;
6571 + regulator-min-microvolt = <1500000>;
6572 + regulator-max-microvolt = <1500000>;
6573 + regulator-name = "vcc-dram";
6574 +};
6575 +
6576 +&reg_rtc_ldo {
6577 + regulator-name = "vcc-rtc";
6578 +};
6579 +
6580 &r_uart {
6581 pinctrl-names = "default";
6582 pinctrl-0 = <&r_uart_pins_a>;
6583 status = "okay";
6584 };
6585 +
6586 +&simplefb_lcd {
6587 + vcc-lcd-supply = <&reg_dc1sw>;
6588 +};
6589 --- a/arch/arm/dts/sun9i-a80-cubieboard4.dts
6590 +++ b/arch/arm/dts/sun9i-a80-cubieboard4.dts
6591 @@ -62,9 +62,31 @@
6592 stdout-path = "serial0:115200n8";
6593 };
6594
6595 + leds {
6596 + compatible = "gpio-leds";
6597 + pinctrl-names = "default";
6598 + pinctrl-0 = <&led_pins_cubieboard4>;
6599 +
6600 + green {
6601 + label = "cubieboard4:green:usr";
6602 + gpios = <&pio 7 17 GPIO_ACTIVE_HIGH>; /* PH17 */
6603 + };
6604 +
6605 + red {
6606 + label = "cubieboard4:red:usr";
6607 + gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
6608 + };
6609 + };
6610 };
6611
6612 &pio {
6613 + led_pins_cubieboard4: led-pins@0 {
6614 + allwinner,pins = "PH6", "PH17";
6615 + allwinner,function = "gpio_out";
6616 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
6617 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
6618 + };
6619 +
6620 mmc0_cd_pin_cubieboard4: mmc0_cd_pin@0 {
6621 allwinner,pins = "PH18";
6622 allwinner,function = "gpio_in";
6623 @@ -89,6 +111,20 @@
6624 vmmc-supply = <&reg_vcc3v0>;
6625 bus-width = <8>;
6626 non-removable;
6627 + cap-mmc-hw-reset;
6628 + status = "okay";
6629 +};
6630 +
6631 +&mmc2_8bit_pins {
6632 + /* Increase drive strength for DDR modes */
6633 + allwinner,drive = <SUN4I_PINCTRL_40_MA>;
6634 +};
6635 +
6636 +&r_ir {
6637 + status = "okay";
6638 +};
6639 +
6640 +&r_rsb {
6641 status = "okay";
6642 };
6643
6644 --- a/arch/arm/dts/sun9i-a80-optimus.dts
6645 +++ b/arch/arm/dts/sun9i-a80-optimus.dts
6646 @@ -65,7 +65,7 @@
6647 leds {
6648 compatible = "gpio-leds";
6649 pinctrl-names = "default";
6650 - pinctrl-0 = <&led_pins_optimus>;
6651 + pinctrl-0 = <&led_pins_optimus>, <&led_r_pins_optimus>;
6652
6653 /* The LED names match those found on the board */
6654
6655 @@ -74,7 +74,10 @@
6656 gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>;
6657 };
6658
6659 - /* led3 is on PM15, in R_PIO */
6660 + led3 {
6661 + label = "optimus:led3:usr";
6662 + gpios = <&r_pio 1 15 GPIO_ACTIVE_HIGH>; /* PM15 */
6663 + };
6664
6665 led4 {
6666 label = "optimus:led4:usr";
6667 @@ -106,17 +109,6 @@
6668 status = "okay";
6669 };
6670
6671 -&i2c3 {
6672 - pinctrl-names = "default";
6673 - pinctrl-0 = <&i2c3_pins_a>;
6674 - status = "okay";
6675 -};
6676 -
6677 -&i2c3_pins_a {
6678 - /* Enable internal pull-up */
6679 - allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
6680 -};
6681 -
6682 &ohci0 {
6683 status = "okay";
6684 };
6685 @@ -171,30 +163,42 @@
6686 vmmc-supply = <&reg_vcc3v0>;
6687 bus-width = <8>;
6688 non-removable;
6689 + cap-mmc-hw-reset;
6690 status = "okay";
6691 };
6692
6693 +&mmc2_8bit_pins {
6694 + /* Increase drive strength for DDR modes */
6695 + allwinner,drive = <SUN4I_PINCTRL_40_MA>;
6696 +};
6697 +
6698 &reg_usb1_vbus {
6699 pinctrl-0 = <&usb1_vbus_pin_optimus>;
6700 gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
6701 status = "okay";
6702 };
6703
6704 -&uart0 {
6705 - pinctrl-names = "default";
6706 - pinctrl-0 = <&uart0_pins_a>;
6707 +&r_ir {
6708 status = "okay";
6709 };
6710
6711 -&uart4 {
6712 - pinctrl-names = "default";
6713 - pinctrl-0 = <&uart4_pins_a>;
6714 +&r_pio {
6715 + led_r_pins_optimus: led-pins@1 {
6716 + allwinner,pins = "PM15";
6717 + allwinner,function = "gpio_out";
6718 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
6719 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
6720 + };
6721 +};
6722 +
6723 +&r_rsb {
6724 status = "okay";
6725 };
6726
6727 -&uart4_pins_a {
6728 - /* Enable internal pull-up */
6729 - allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
6730 +&uart0 {
6731 + pinctrl-names = "default";
6732 + pinctrl-0 = <&uart0_pins_a>;
6733 + status = "okay";
6734 };
6735
6736 &usbphy1 {
6737 --- a/arch/arm/dts/sun9i-a80.dtsi
6738 +++ b/arch/arm/dts/sun9i-a80.dtsi
6739 @@ -128,6 +128,17 @@
6740 */
6741 ranges = <0 0 0 0x20000000>;
6742
6743 + /*
6744 + * This clock is actually configurable from the PRCM address
6745 + * space. The external 24M oscillator can be turned off, and
6746 + * the clock switched to an internal 16M RC oscillator. Under
6747 + * normal operation there's no reason to do this, and the
6748 + * default is to use the external good one, so just model this
6749 + * as a fixed clock. Also it is not entirely clear if the
6750 + * osc24M mux in the PRCM affects the entire clock tree, which
6751 + * would also throw all the PLL clock rates off, or just the
6752 + * downstream clocks in the PRCM.
6753 + */
6754 osc24M: osc24M_clk {
6755 #clock-cells = <0>;
6756 compatible = "fixed-clock";
6757 @@ -135,6 +146,13 @@
6758 clock-output-names = "osc24M";
6759 };
6760
6761 + /*
6762 + * The 32k clock is from an external source, normally the
6763 + * AC100 codec/RTC chip. This clock is by default enabled
6764 + * and clocked at 32768 Hz, from the oscillator connected
6765 + * to the AC100. It is configurable, but no such driver or
6766 + * bindings exist yet.
6767 + */
6768 osc32k: osc32k_clk {
6769 #clock-cells = <0>;
6770 compatible = "fixed-clock";
6771 @@ -164,6 +182,14 @@
6772 "usb_phy2", "usb_hsic_12M";
6773 };
6774
6775 + pll3: clk@06000008 {
6776 + /* placeholder until implemented */
6777 + #clock-cells = <0>;
6778 + compatible = "fixed-clock";
6779 + clock-rate = <0>;
6780 + clock-output-names = "pll3";
6781 + };
6782 +
6783 pll4: clk@0600000c {
6784 #clock-cells = <0>;
6785 compatible = "allwinner,sun9i-a80-pll4-clk";
6786 @@ -277,9 +303,12 @@
6787 compatible = "allwinner,sun9i-a80-ahb0-gates-clk";
6788 reg = <0x06000580 0x4>;
6789 clocks = <&ahb0>;
6790 - clock-indices = <0>, <1>, <3>, <5>, <8>, <12>, <13>,
6791 - <14>, <15>, <16>, <18>, <20>, <21>,
6792 - <22>, <23>;
6793 + clock-indices = <0>, <1>, <3>,
6794 + <5>, <8>, <12>,
6795 + <13>, <14>,
6796 + <15>, <16>, <18>,
6797 + <20>, <21>, <22>,
6798 + <23>;
6799 clock-output-names = "ahb0_fd", "ahb0_ve", "ahb0_gpu",
6800 "ahb0_ss", "ahb0_sd", "ahb0_nand1",
6801 "ahb0_nand0", "ahb0_sdram",
6802 @@ -293,7 +322,10 @@
6803 compatible = "allwinner,sun9i-a80-ahb1-gates-clk";
6804 reg = <0x06000584 0x4>;
6805 clocks = <&ahb1>;
6806 - clock-indices = <0>, <1>, <17>, <21>, <22>, <23>, <24>;
6807 + clock-indices = <0>, <1>,
6808 + <17>, <21>,
6809 + <22>, <23>,
6810 + <24>;
6811 clock-output-names = "ahb1_usbotg", "ahb1_usbhci",
6812 "ahb1_gmac", "ahb1_msgbox",
6813 "ahb1_spinlock", "ahb1_hstimer",
6814 @@ -305,8 +337,9 @@
6815 compatible = "allwinner,sun9i-a80-ahb2-gates-clk";
6816 reg = <0x06000588 0x4>;
6817 clocks = <&ahb2>;
6818 - clock-indices = <0>, <1>, <2>, <4>, <5>, <7>, <8>,
6819 - <11>;
6820 + clock-indices = <0>, <1>,
6821 + <2>, <4>, <5>,
6822 + <7>, <8>, <11>;
6823 clock-output-names = "ahb2_lcd0", "ahb2_lcd1",
6824 "ahb2_edp", "ahb2_csi", "ahb2_hdmi",
6825 "ahb2_de", "ahb2_mp", "ahb2_mipi_dsi";
6826 @@ -317,8 +350,10 @@
6827 compatible = "allwinner,sun9i-a80-apb0-gates-clk";
6828 reg = <0x06000590 0x4>;
6829 clocks = <&apb0>;
6830 - clock-indices = <1>, <5>, <11>, <12>, <13>, <15>,
6831 - <17>, <18>, <19>;
6832 + clock-indices = <1>, <5>,
6833 + <11>, <12>, <13>,
6834 + <15>, <17>, <18>,
6835 + <19>;
6836 clock-output-names = "apb0_spdif", "apb0_pio",
6837 "apb0_ac97", "apb0_i2s0", "apb0_i2s1",
6838 "apb0_lradc", "apb0_gpadc", "apb0_twd",
6839 @@ -330,14 +365,79 @@
6840 compatible = "allwinner,sun9i-a80-apb1-gates-clk";
6841 reg = <0x06000594 0x4>;
6842 clocks = <&apb1>;
6843 - clock-indices = <0>, <1>, <2>, <3>, <4>,
6844 - <16>, <17>, <18>, <19>, <20>, <21>;
6845 + clock-indices = <0>, <1>,
6846 + <2>, <3>, <4>,
6847 + <16>, <17>,
6848 + <18>, <19>,
6849 + <20>, <21>;
6850 clock-output-names = "apb1_i2c0", "apb1_i2c1",
6851 "apb1_i2c2", "apb1_i2c3", "apb1_i2c4",
6852 "apb1_uart0", "apb1_uart1",
6853 "apb1_uart2", "apb1_uart3",
6854 "apb1_uart4", "apb1_uart5";
6855 };
6856 +
6857 + cpus_clk: clk@08001410 {
6858 + compatible = "allwinner,sun9i-a80-cpus-clk";
6859 + reg = <0x08001410 0x4>;
6860 + #clock-cells = <0>;
6861 + clocks = <&osc32k>, <&osc24M>, <&pll4>, <&pll3>;
6862 + clock-output-names = "cpus";
6863 + };
6864 +
6865 + ahbs: ahbs_clk {
6866 + compatible = "fixed-factor-clock";
6867 + #clock-cells = <0>;
6868 + clock-div = <1>;
6869 + clock-mult = <1>;
6870 + clocks = <&cpus_clk>;
6871 + clock-output-names = "ahbs";
6872 + };
6873 +
6874 + apbs: clk@0800141c {
6875 + compatible = "allwinner,sun8i-a23-apb0-clk";
6876 + reg = <0x0800141c 0x4>;
6877 + #clock-cells = <0>;
6878 + clocks = <&ahbs>;
6879 + clock-output-names = "apbs";
6880 + };
6881 +
6882 + apbs_gates: clk@08001428 {
6883 + compatible = "allwinner,sun9i-a80-apbs-gates-clk";
6884 + reg = <0x08001428 0x4>;
6885 + #clock-cells = <1>;
6886 + clocks = <&apbs>;
6887 + clock-indices = <0>, <1>,
6888 + <2>, <3>,
6889 + <4>, <5>,
6890 + <6>, <7>,
6891 + <12>, <13>,
6892 + <16>, <17>,
6893 + <18>, <20>;
6894 + clock-output-names = "apbs_pio", "apbs_ir",
6895 + "apbs_timer", "apbs_rsb",
6896 + "apbs_uart", "apbs_1wire",
6897 + "apbs_i2c0", "apbs_i2c1",
6898 + "apbs_ps2_0", "apbs_ps2_1",
6899 + "apbs_dma", "apbs_i2s0",
6900 + "apbs_i2s1", "apbs_twd";
6901 + };
6902 +
6903 + r_1wire_clk: clk@08001450 {
6904 + reg = <0x08001450 0x4>;
6905 + #clock-cells = <0>;
6906 + compatible = "allwinner,sun4i-a10-mod0-clk";
6907 + clocks = <&osc32k>, <&osc24M>;
6908 + clock-output-names = "r_1wire";
6909 + };
6910 +
6911 + r_ir_clk: clk@08001454 {
6912 + reg = <0x08001454 0x4>;
6913 + #clock-cells = <0>;
6914 + compatible = "allwinner,sun4i-a10-mod0-clk";
6915 + clocks = <&osc32k>, <&osc24M>;
6916 + clock-output-names = "r_ir";
6917 + };
6918 };
6919
6920 soc {
6921 @@ -443,7 +543,7 @@
6922 };
6923
6924 mmc0: mmc@01c0f000 {
6925 - compatible = "allwinner,sun5i-a13-mmc";
6926 + compatible = "allwinner,sun9i-a80-mmc";
6927 reg = <0x01c0f000 0x1000>;
6928 clocks = <&mmc_config_clk 0>, <&mmc0_clk 0>,
6929 <&mmc0_clk 1>, <&mmc0_clk 2>;
6930 @@ -457,7 +557,7 @@
6931 };
6932
6933 mmc1: mmc@01c10000 {
6934 - compatible = "allwinner,sun5i-a13-mmc";
6935 + compatible = "allwinner,sun9i-a80-mmc";
6936 reg = <0x01c10000 0x1000>;
6937 clocks = <&mmc_config_clk 1>, <&mmc1_clk 0>,
6938 <&mmc1_clk 1>, <&mmc1_clk 2>;
6939 @@ -471,7 +571,7 @@
6940 };
6941
6942 mmc2: mmc@01c11000 {
6943 - compatible = "allwinner,sun5i-a13-mmc";
6944 + compatible = "allwinner,sun9i-a80-mmc";
6945 reg = <0x01c11000 0x1000>;
6946 clocks = <&mmc_config_clk 2>, <&mmc2_clk 0>,
6947 <&mmc2_clk 1>, <&mmc2_clk 2>;
6948 @@ -485,7 +585,7 @@
6949 };
6950
6951 mmc3: mmc@01c12000 {
6952 - compatible = "allwinner,sun5i-a13-mmc";
6953 + compatible = "allwinner,sun9i-a80-mmc";
6954 reg = <0x01c12000 0x1000>;
6955 clocks = <&mmc_config_clk 3>, <&mmc3_clk 0>,
6956 <&mmc3_clk 1>, <&mmc3_clk 2>;
6957 @@ -582,7 +682,7 @@
6958 clocks = <&apb0_gates 5>;
6959 gpio-controller;
6960 interrupt-controller;
6961 - #interrupt-cells = <2>;
6962 + #interrupt-cells = <3>;
6963 #size-cells = <0>;
6964 #gpio-cells = <3>;
6965
6966 @@ -604,7 +704,8 @@
6967 mmc2_8bit_pins: mmc2_8bit {
6968 allwinner,pins = "PC6", "PC7", "PC8", "PC9",
6969 "PC10", "PC11", "PC12",
6970 - "PC13", "PC14", "PC15";
6971 + "PC13", "PC14", "PC15",
6972 + "PC16";
6973 allwinner,function = "mmc2";
6974 allwinner,drive = <SUN4I_PINCTRL_30_MA>;
6975 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
6976 @@ -752,14 +853,83 @@
6977 interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
6978 };
6979
6980 + apbs_rst: reset@080014b0 {
6981 + reg = <0x080014b0 0x4>;
6982 + compatible = "allwinner,sun6i-a31-clock-reset";
6983 + #reset-cells = <1>;
6984 + };
6985 +
6986 + nmi_intc: interrupt-controller@080015a0 {
6987 + compatible = "allwinner,sun9i-a80-nmi";
6988 + interrupt-controller;
6989 + #interrupt-cells = <2>;
6990 + reg = <0x080015a0 0xc>;
6991 + interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
6992 + };
6993 +
6994 + r_ir: ir@08002000 {
6995 + compatible = "allwinner,sun5i-a13-ir";
6996 + interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
6997 + pinctrl-names = "default";
6998 + pinctrl-0 = <&r_ir_pins>;
6999 + clocks = <&apbs_gates 1>, <&r_ir_clk>;
7000 + clock-names = "apb", "ir";
7001 + resets = <&apbs_rst 1>;
7002 + reg = <0x08002000 0x40>;
7003 + status = "disabled";
7004 + };
7005 +
7006 r_uart: serial@08002800 {
7007 compatible = "snps,dw-apb-uart";
7008 reg = <0x08002800 0x400>;
7009 interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>;
7010 reg-shift = <2>;
7011 reg-io-width = <4>;
7012 - clocks = <&osc24M>;
7013 + clocks = <&apbs_gates 4>;
7014 + resets = <&apbs_rst 4>;
7015 status = "disabled";
7016 };
7017 +
7018 + r_pio: pinctrl@08002c00 {
7019 + compatible = "allwinner,sun9i-a80-r-pinctrl";
7020 + reg = <0x08002c00 0x400>;
7021 + interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>,
7022 + <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
7023 + clocks = <&apbs_gates 0>;
7024 + resets = <&apbs_rst 0>;
7025 + gpio-controller;
7026 + interrupt-controller;
7027 + #address-cells = <1>;
7028 + #size-cells = <0>;
7029 + #gpio-cells = <3>;
7030 +
7031 + r_ir_pins: r_ir {
7032 + allwinner,pins = "PL6";
7033 + allwinner,function = "s_cir_rx";
7034 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
7035 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
7036 + };
7037 +
7038 + r_rsb_pins: r_rsb {
7039 + allwinner,pins = "PN0", "PN1";
7040 + allwinner,function = "s_rsb";
7041 + allwinner,drive = <SUN4I_PINCTRL_20_MA>;
7042 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
7043 + };
7044 + };
7045 +
7046 + r_rsb: i2c@08003400 {
7047 + compatible = "allwinner,sun8i-a23-rsb";
7048 + reg = <0x08003400 0x400>;
7049 + interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>;
7050 + clocks = <&apbs_gates 3>;
7051 + clock-frequency = <3000000>;
7052 + resets = <&apbs_rst 3>;
7053 + pinctrl-names = "default";
7054 + pinctrl-0 = <&r_rsb_pins>;
7055 + status = "disabled";
7056 + #address-cells = <1>;
7057 + #size-cells = <0>;
7058 + };
7059 };
7060 };
7061 --- /dev/null
7062 +++ b/arch/arm/dts/sunxi-itead-core-common.dtsi
7063 @@ -0,0 +1,136 @@
7064 +/*
7065 + * Copyright 2015 - Marcus Cooper <codekipper@gmail.com>
7066 + *
7067 + * This file is dual-licensed: you can use it either under the terms
7068 + * of the GPL or the X11 license, at your option. Note that this dual
7069 + * licensing only applies to this file, and not this project as a
7070 + * whole.
7071 + *
7072 + * a) This file is free software; you can redistribute it and/or
7073 + * modify it under the terms of the GNU General Public License as
7074 + * published by the Free Software Foundation; either version 2 of the
7075 + * License, or (at your option) any later version.
7076 + *
7077 + * This file is distributed in the hope that it will be useful,
7078 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
7079 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7080 + * GNU General Public License for more details.
7081 + *
7082 + * Or, alternatively,
7083 + *
7084 + * b) Permission is hereby granted, free of charge, to any person
7085 + * obtaining a copy of this software and associated documentation
7086 + * files (the "Software"), to deal in the Software without
7087 + * restriction, including without limitation the rights to use,
7088 + * copy, modify, merge, publish, distribute, sublicense, and/or
7089 + * sell copies of the Software, and to permit persons to whom the
7090 + * Software is furnished to do so, subject to the following
7091 + * conditions:
7092 + *
7093 + * The above copyright notice and this permission notice shall be
7094 + * included in all copies or substantial portions of the Software.
7095 + *
7096 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
7097 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
7098 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
7099 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
7100 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
7101 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
7102 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
7103 + * OTHER DEALINGS IN THE SOFTWARE.
7104 + */
7105 +
7106 +#include "sunxi-common-regulators.dtsi"
7107 +
7108 +/ {
7109 + aliases {
7110 + serial0 = &uart0;
7111 + };
7112 +
7113 + chosen {
7114 + stdout-path = "serial0:115200n8";
7115 + };
7116 +};
7117 +
7118 +&cpu0 {
7119 + cpu-supply = <&reg_dcdc2>;
7120 +};
7121 +
7122 +&ehci0 {
7123 + status = "okay";
7124 +};
7125 +
7126 +&ehci1 {
7127 + status = "okay";
7128 +};
7129 +
7130 +&i2c0 {
7131 + pinctrl-names = "default";
7132 + pinctrl-0 = <&i2c0_pins_a>;
7133 + status = "okay";
7134 +
7135 + axp209: pmic@34 {
7136 + reg = <0x34>;
7137 + };
7138 +};
7139 +
7140 +&i2c1 {
7141 + pinctrl-names = "default";
7142 + pinctrl-0 = <&i2c1_pins_a>;
7143 + status = "okay";
7144 +};
7145 +
7146 +&ohci0 {
7147 + status = "okay";
7148 +};
7149 +
7150 +&ohci1 {
7151 + status = "okay";
7152 +};
7153 +
7154 +#include "axp209.dtsi"
7155 +
7156 +&reg_dcdc2 {
7157 + regulator-always-on;
7158 + regulator-min-microvolt = <1000000>;
7159 + regulator-max-microvolt = <1400000>;
7160 + regulator-name = "vdd-cpu";
7161 +};
7162 +
7163 +&reg_dcdc3 {
7164 + regulator-always-on;
7165 + regulator-min-microvolt = <1000000>;
7166 + regulator-max-microvolt = <1400000>;
7167 + regulator-name = "vdd-int-dll";
7168 +};
7169 +
7170 +&reg_ldo1 {
7171 + regulator-name = "vdd-rtc";
7172 +};
7173 +
7174 +&reg_ldo2 {
7175 + regulator-always-on;
7176 + regulator-min-microvolt = <3000000>;
7177 + regulator-max-microvolt = <3000000>;
7178 + regulator-name = "avcc";
7179 +};
7180 +
7181 +&reg_usb1_vbus {
7182 + status = "okay";
7183 +};
7184 +
7185 +&reg_usb2_vbus {
7186 + status = "okay";
7187 +};
7188 +
7189 +&uart0 {
7190 + pinctrl-names = "default";
7191 + pinctrl-0 = <&uart0_pins_a>;
7192 + status = "okay";
7193 +};
7194 +
7195 +&usbphy {
7196 + usb1_vbus-supply = <&reg_usb1_vbus>;
7197 + usb2_vbus-supply = <&reg_usb2_vbus>;
7198 + status = "okay";
7199 +};
7200 --- a/arch/arm/dts/sunxi-q8-common.dtsi
7201 +++ b/arch/arm/dts/sunxi-q8-common.dtsi
7202 @@ -75,3 +75,9 @@
7203 voltage = <400000>;
7204 };
7205 };
7206 +
7207 +&pwm {
7208 + pinctrl-names = "default";
7209 + pinctrl-0 = <&pwm0_pins>;
7210 + status = "okay";
7211 +};