1b7a059311c1410939628ffab37970fce1dc202c
[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 diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
97 index 578038b..0cea4b4 100644
98 --- a/arch/arm/dts/Makefile
99 +++ b/arch/arm/dts/Makefile
100 @@ -126,6 +126,7 @@ dtb-$(CONFIG_MACH_SUN4I) += \
101 sun4i-a10-mk802ii.dtb \
102 sun4i-a10-olinuxino-lime.dtb \
103 sun4i-a10-pcduino.dtb \
104 + sun4i-a10-pcduino2.dtb \
105 sun4i-a10-pov-protab2-ips9.dtb
106 dtb-$(CONFIG_MACH_SUN5I) += \
107 sun5i-a10s-auxtek-t003.dtb \
108 @@ -154,7 +155,9 @@ dtb-$(CONFIG_MACH_SUN6I) += \
109 sun6i-a31-mixtile-loftq.dtb \
110 sun6i-a31s-cs908.dtb \
111 sun6i-a31s-primo81.dtb \
112 - sun6i-a31s-sinovoip-bpi-m2.dtb
113 + sun6i-a31s-sina31s.dtb \
114 + sun6i-a31s-sinovoip-bpi-m2.dtb \
115 + sun6i-a31s-yones-toptech-bs1078-v2.dtb
116 dtb-$(CONFIG_MACH_SUN7I) += \
117 sun7i-a20-ainol-aw1.dtb \
118 sun7i-a20-bananapi.dtb \
119 @@ -163,6 +166,8 @@ dtb-$(CONFIG_MACH_SUN7I) += \
120 sun7i-a20-cubietruck.dtb \
121 sun7i-a20-hummingbird.dtb \
122 sun7i-a20-i12-tvbox.dtb \
123 + sun7i-a20-icnova-swac.dtb \
124 + sun7i-a20-itead-ibox.dtb \
125 sun7i-a20-lamobo-r1.dtb \
126 sun7i-a20-m3.dtb \
127 sun7i-a20-m5.dtb \
128 @@ -189,6 +194,7 @@ dtb-$(CONFIG_MACH_SUN8I_A33) += \
129 sun8i-a33-sinlinx-sina33.dtb
130 dtb-$(CONFIG_MACH_SUN8I_A83T) += \
131 sun8i-a83t-allwinner-h8homlet-v2.dtb \
132 + sun8i-a83t-cubietruck-plus.dtb \
133 sun8i-a83t-sinovoip-bpi-m3.dtb
134 dtb-$(CONFIG_MACH_SUN8I_H3) += \
135 sun8i-h3-orangepi-pc.dtb \
136 diff --git a/arch/arm/dts/axp22x.dtsi b/arch/arm/dts/axp22x.dtsi
137 new file mode 100644
138 index 0000000..0cfec50
139 --- /dev/null
140 +++ b/arch/arm/dts/axp22x.dtsi
141 @@ -0,0 +1,145 @@
142 +/*
143 + * Copyright 2015 Chen-Yu Tsai
144 + *
145 + * Chen-Yu Tsai <wens@csie.org>
146 + *
147 + * This file is dual-licensed: you can use it either under the terms
148 + * of the GPL or the X11 license, at your option. Note that this dual
149 + * licensing only applies to this file, and not this project as a
150 + * whole.
151 + *
152 + * a) This file is free software; you can redistribute it and/or
153 + * modify it under the terms of the GNU General Public License as
154 + * published by the Free Software Foundation; either version 2 of the
155 + * License, or (at your option) any later version.
156 + *
157 + * This file is distributed in the hope that it will be useful,
158 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
159 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
160 + * GNU General Public License for more details.
161 + *
162 + * Or, alternatively,
163 + *
164 + * b) Permission is hereby granted, free of charge, to any person
165 + * obtaining a copy of this software and associated documentation
166 + * files (the "Software"), to deal in the Software without
167 + * restriction, including without limitation the rights to use,
168 + * copy, modify, merge, publish, distribute, sublicense, and/or
169 + * sell copies of the Software, and to permit persons to whom the
170 + * Software is furnished to do so, subject to the following
171 + * conditions:
172 + *
173 + * The above copyright notice and this permission notice shall be
174 + * included in all copies or substantial portions of the Software.
175 + *
176 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
177 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
178 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
179 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
180 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
181 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
182 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
183 + * OTHER DEALINGS IN THE SOFTWARE.
184 + */
185 +
186 +/*
187 + * AXP221/221s/223 Integrated Power Management Chip
188 + * http://www.x-powers.com/product/AXP22X.php
189 + * http://dl.linux-sunxi.org/AXP/AXP221%20Datasheet%20V1.2%2020130326%20.pdf
190 + */
191 +
192 +&axp22x {
193 + interrupt-controller;
194 + #interrupt-cells = <1>;
195 +
196 + regulators {
197 + /* Default work frequency for buck regulators */
198 + x-powers,dcdc-freq = <3000>;
199 +
200 + reg_dcdc1: dcdc1 {
201 + regulator-name = "dcdc1";
202 + };
203 +
204 + reg_dcdc2: dcdc2 {
205 + regulator-name = "dcdc2";
206 + };
207 +
208 + reg_dcdc3: dcdc3 {
209 + regulator-name = "dcdc3";
210 + };
211 +
212 + reg_dcdc4: dcdc4 {
213 + regulator-name = "dcdc4";
214 + };
215 +
216 + reg_dcdc5: dcdc5 {
217 + regulator-name = "dcdc5";
218 + };
219 +
220 + reg_dc1sw: dc1sw {
221 + regulator-name = "dc1sw";
222 + };
223 +
224 + reg_dc5ldo: dc5ldo {
225 + regulator-name = "dc5ldo";
226 + };
227 +
228 + reg_aldo1: aldo1 {
229 + regulator-name = "aldo1";
230 + };
231 +
232 + reg_aldo2: aldo2 {
233 + regulator-name = "aldo2";
234 + };
235 +
236 + reg_aldo3: aldo3 {
237 + regulator-name = "aldo3";
238 + };
239 +
240 + reg_dldo1: dldo1 {
241 + regulator-name = "dldo1";
242 + };
243 +
244 + reg_dldo2: dldo2 {
245 + regulator-name = "dldo2";
246 + };
247 +
248 + reg_dldo3: dldo3 {
249 + regulator-name = "dldo3";
250 + };
251 +
252 + reg_dldo4: dldo4 {
253 + regulator-name = "dldo4";
254 + };
255 +
256 + reg_eldo1: eldo1 {
257 + regulator-name = "eldo1";
258 + };
259 +
260 + reg_eldo2: eldo2 {
261 + regulator-name = "eldo2";
262 + };
263 +
264 + reg_eldo3: eldo3 {
265 + regulator-name = "eldo3";
266 + };
267 +
268 + reg_ldo_io0: ldo_io0 {
269 + regulator-name = "ldo_io0";
270 + status = "disabled";
271 + };
272 +
273 + reg_ldo_io1: ldo_io1 {
274 + regulator-name = "ldo_io1";
275 + status = "disabled";
276 + };
277 +
278 + reg_rtc_ldo: rtc_ldo {
279 + /* RTC_LDO is a fixed, always-on regulator */
280 + regulator-always-on;
281 + regulator-min-microvolt = <3000000>;
282 + regulator-max-microvolt = <3000000>;
283 + regulator-name = "rtc_ldo";
284 + };
285 + };
286 +};
287 diff --git a/arch/arm/dts/sun4i-a10-a1000.dts b/arch/arm/dts/sun4i-a10-a1000.dts
288 index 2630d78..97570cb 100644
289 --- a/arch/arm/dts/sun4i-a10-a1000.dts
290 +++ b/arch/arm/dts/sun4i-a10-a1000.dts
291 @@ -93,6 +93,10 @@
292 status = "okay";
293 };
294
295 +&codec {
296 + status = "okay";
297 +};
298 +
299 &ehci0 {
300 status = "okay";
301 };
302 diff --git a/arch/arm/dts/sun4i-a10-chuwi-v7-cw0825.dts b/arch/arm/dts/sun4i-a10-chuwi-v7-cw0825.dts
303 index 1430568..023b03e 100644
304 --- a/arch/arm/dts/sun4i-a10-chuwi-v7-cw0825.dts
305 +++ b/arch/arm/dts/sun4i-a10-chuwi-v7-cw0825.dts
306 @@ -45,6 +45,7 @@
307 #include "sunxi-common-regulators.dtsi"
308 #include <dt-bindings/gpio/gpio.h>
309 #include <dt-bindings/input/input.h>
310 +#include <dt-bindings/interrupt-controller/irq.h>
311
312 / {
313 model = "Chuwi V7 CW0825";
314 @@ -78,6 +79,27 @@
315 };
316 };
317
318 +&i2c1 {
319 + pinctrl-names = "default";
320 + pinctrl-0 = <&i2c1_pins_a>;
321 + status = "okay";
322 +};
323 +
324 +&i2c2 {
325 + pinctrl-names = "default";
326 + pinctrl-0 = <&i2c2_pins_a>;
327 + status = "okay";
328 +
329 + ft5306de4: touchscreen@38 {
330 + compatible = "edt,edt-ft5406";
331 + reg = <0x38>;
332 + interrupt-parent = <&pio>;
333 + interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>;
334 + touchscreen-size-x = <1024>;
335 + touchscreen-size-y = <768>;
336 + };
337 +};
338 +
339 &lradc {
340 vref-supply = <&reg_vcc3v0>;
341 status = "okay";
342 diff --git a/arch/arm/dts/sun4i-a10-cubieboard.dts b/arch/arm/dts/sun4i-a10-cubieboard.dts
343 index 046a84d..710e2ef 100644
344 --- a/arch/arm/dts/sun4i-a10-cubieboard.dts
345 +++ b/arch/arm/dts/sun4i-a10-cubieboard.dts
346 @@ -83,6 +83,10 @@
347 status = "okay";
348 };
349
350 +&codec {
351 + status = "okay";
352 +};
353 +
354 &cpu0 {
355 cpu-supply = <&reg_dcdc2>;
356 };
357 diff --git a/arch/arm/dts/sun4i-a10-gemei-g9.dts b/arch/arm/dts/sun4i-a10-gemei-g9.dts
358 index 570754d..ac64781 100644
359 --- a/arch/arm/dts/sun4i-a10-gemei-g9.dts
360 +++ b/arch/arm/dts/sun4i-a10-gemei-g9.dts
361 @@ -47,6 +47,7 @@
362 #include "sunxi-common-regulators.dtsi"
363 #include <dt-bindings/gpio/gpio.h>
364 #include <dt-bindings/input/input.h>
365 +#include <dt-bindings/interrupt-controller/irq.h>
366
367 / {
368 model = "Gemei G9 Tablet";
369 @@ -64,12 +65,22 @@
370 /*
371 * TODO:
372 * 2x cameras via CSI
373 - * bma250 IRQs
374 * AXP battery management
375 * NAND
376 * OTG
377 * Touchscreen - gt801_2plus1 @ i2c adapter 2 @ 0x48
378 */
379 +&codec {
380 + /* PH15 controls power to external amplifier (ft2012q) */
381 + pinctrl-names = "default";
382 + pinctrl-0 = <&codec_pa_pin>;
383 + allwinner,pa-gpios = <&pio 7 15 GPIO_ACTIVE_HIGH>;
384 + status = "okay";
385 +};
386 +
387 +&cpu0 {
388 + cpu-supply = <&reg_dcdc2>;
389 +};
390
391 &ehci0 {
392 status = "okay";
393 @@ -85,15 +96,13 @@
394 status = "okay";
395
396 axp209: pmic@34 {
397 - compatible = "x-powers,axp209";
398 reg = <0x34>;
399 interrupts = <0>;
400 -
401 - interrupt-controller;
402 - #interrupt-cells = <1>;
403 };
404 };
405
406 +#include "axp209.dtsi"
407 +
408 &i2c1 {
409 pinctrl-names = "default";
410 pinctrl-0 = <&i2c1_pins_a>;
411 @@ -103,17 +112,13 @@
412 bma250@18 {
413 compatible = "bosch,bma250";
414 reg = <0x18>;
415 -
416 - /*
417 - * TODO: interrupt pins:
418 - * int1 - PH00
419 - * int2 - PI10
420 - */
421 + interrupt-parent = <&pio>;
422 + interrupts = <7 0 IRQ_TYPE_EDGE_RISING>; /* PH00 / EINT0 */
423 };
424 };
425
426 &lradc {
427 - vref-supply = <&reg_vcc3v0>;
428 + vref-supply = <&reg_ldo2>;
429
430 status = "okay";
431
432 @@ -149,6 +154,40 @@
433 status = "okay";
434 };
435
436 +&pio {
437 + codec_pa_pin: codec_pa_pin@0 {
438 + allwinner,pins = "PH15";
439 + allwinner,function = "gpio_out";
440 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
441 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
442 + };
443 +};
444 +
445 +&reg_dcdc2 {
446 + regulator-always-on;
447 + regulator-min-microvolt = <1000000>;
448 + regulator-max-microvolt = <1400000>;
449 + regulator-name = "vdd-cpu";
450 +};
451 +
452 +&reg_dcdc3 {
453 + regulator-always-on;
454 + regulator-min-microvolt = <1250000>;
455 + regulator-max-microvolt = <1250000>;
456 + regulator-name = "vdd-int-dll";
457 +};
458 +
459 +&reg_ldo1 {
460 + regulator-name = "vdd-rtc";
461 +};
462 +
463 +&reg_ldo2 {
464 + regulator-always-on;
465 + regulator-min-microvolt = <3000000>;
466 + regulator-max-microvolt = <3000000>;
467 + regulator-name = "avcc";
468 +};
469 +
470 &reg_usb1_vbus {
471 status = "okay";
472 };
473 diff --git a/arch/arm/dts/sun4i-a10-inet1.dts b/arch/arm/dts/sun4i-a10-inet1.dts
474 index 487ce63..e09053b 100644
475 --- a/arch/arm/dts/sun4i-a10-inet1.dts
476 +++ b/arch/arm/dts/sun4i-a10-inet1.dts
477 @@ -47,6 +47,7 @@
478 #include <dt-bindings/input/input.h>
479 #include <dt-bindings/interrupt-controller/irq.h>
480 #include <dt-bindings/pinctrl/sun4i-a10.h>
481 +#include <dt-bindings/pwm/pwm.h>
482
483 / {
484 model = "iNet-1";
485 @@ -56,11 +57,25 @@
486 serial0 = &uart0;
487 };
488
489 + backlight: backlight {
490 + compatible = "pwm-backlight";
491 + pinctrl-names = "default";
492 + pinctrl-0 = <&bl_en_pin_inet>;
493 + pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
494 + brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
495 + default-brightness-level = <8>;
496 + enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */
497 + };
498 +
499 chosen {
500 stdout-path = "serial0:115200n8";
501 };
502 };
503
504 +&codec {
505 + status = "okay";
506 +};
507 +
508 &cpu0 {
509 cpu-supply = <&reg_dcdc2>;
510 };
511 @@ -104,6 +119,19 @@
512 pinctrl-names = "default";
513 pinctrl-0 = <&i2c2_pins_a>;
514 status = "okay";
515 +
516 + ft5x: touchscreen@38 {
517 + compatible = "edt,edt-ft5406";
518 + reg = <0x38>;
519 + interrupt-parent = <&pio>;
520 + interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>;
521 + pinctrl-names = "default";
522 + pinctrl-0 = <&touchscreen_wake_pin>;
523 + wake-gpios = <&pio 1 13 GPIO_ACTIVE_HIGH>; /* PB13 */
524 + touchscreen-size-x = <600>;
525 + touchscreen-size-y = <1024>;
526 + touchscreen-swapped-x-y;
527 + };
528 };
529
530 &lradc {
531 @@ -151,6 +179,20 @@
532 };
533
534 &pio {
535 + bl_en_pin_inet: bl_en_pin@0 {
536 + allwinner,pins = "PH7";
537 + allwinner,function = "gpio_out";
538 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
539 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
540 + };
541 +
542 + touchscreen_wake_pin: touchscreen_wake_pin@0 {
543 + allwinner,pins = "PB13";
544 + allwinner,function = "gpio_out";
545 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
546 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
547 + };
548 +
549 usb0_id_detect_pin: usb0_id_detect_pin@0 {
550 allwinner,pins = "PH4";
551 allwinner,function = "gpio_in";
552 @@ -166,6 +208,12 @@
553 };
554 };
555
556 +&pwm {
557 + pinctrl-names = "default";
558 + pinctrl-0 = <&pwm0_pins_a>;
559 + status = "okay";
560 +};
561 +
562 &reg_dcdc2 {
563 regulator-always-on;
564 regulator-min-microvolt = <1000000>;
565 diff --git a/arch/arm/dts/sun4i-a10-inet97fv2.dts b/arch/arm/dts/sun4i-a10-inet97fv2.dts
566 index 6c927a8..04b0d2d 100644
567 --- a/arch/arm/dts/sun4i-a10-inet97fv2.dts
568 +++ b/arch/arm/dts/sun4i-a10-inet97fv2.dts
569 @@ -47,6 +47,8 @@
570 #include "sunxi-common-regulators.dtsi"
571
572 #include <dt-bindings/gpio/gpio.h>
573 +#include <dt-bindings/input/input.h>
574 +#include <dt-bindings/interrupt-controller/irq.h>
575
576 / {
577 model = "INet-97F Rev 02";
578 @@ -61,8 +63,8 @@
579 };
580 };
581
582 -&ehci0 {
583 - status = "okay";
584 +&cpu0 {
585 + cpu-supply = <&reg_dcdc2>;
586 };
587
588 &ehci1 {
589 @@ -75,12 +77,71 @@
590 status = "okay";
591
592 axp209: pmic@34 {
593 - compatible = "x-powers,axp209";
594 reg = <0x34>;
595 interrupts = <0>;
596 + };
597 +};
598 +
599 +#include "axp209.dtsi"
600 +
601 +&i2c1 {
602 + pinctrl-names = "default";
603 + pinctrl-0 = <&i2c1_pins_a>;
604 + status = "okay";
605 +};
606 +
607 +&i2c2 {
608 + pinctrl-names = "default";
609 + pinctrl-0 = <&i2c2_pins_a>;
610 + status = "okay";
611 +
612 + ft5406ee8: touchscreen@38 {
613 + compatible = "edt,edt-ft5406";
614 + reg = <0x38>;
615 + interrupt-parent = <&pio>;
616 + interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>;
617 + touchscreen-size-x = <800>;
618 + touchscreen-size-y = <480>;
619 + };
620 +};
621 +
622 +&lradc {
623 + vref-supply = <&reg_ldo2>;
624 + status = "okay";
625 +
626 + button@200 {
627 + label = "Menu";
628 + linux,code = <KEY_MENU>;
629 + channel = <0>;
630 + voltage = <200000>;
631 + };
632 +
633 + button@600 {
634 + label = "Volume Up";
635 + linux,code = <KEY_VOLUMEUP>;
636 + channel = <0>;
637 + voltage = <600000>;
638 + };
639
640 - interrupt-controller;
641 - #interrupt-cells = <1>;
642 + button@800 {
643 + label = "Volume Down";
644 + linux,code = <KEY_VOLUMEDOWN>;
645 + channel = <0>;
646 + voltage = <800000>;
647 + };
648 +
649 + button@1000 {
650 + label = "Home";
651 + linux,code = <KEY_HOMEPAGE>;
652 + channel = <0>;
653 + voltage = <1000000>;
654 + };
655 +
656 + button@1200 {
657 + label = "Esc";
658 + linux,code = <KEY_ESC>;
659 + channel = <0>;
660 + voltage = <1200000>;
661 };
662 };
663
664 @@ -94,15 +155,52 @@
665 status = "okay";
666 };
667
668 -&ohci0 {
669 +&otg_sram {
670 status = "okay";
671 };
672
673 -&ohci1 {
674 - status = "okay";
675 +&pio {
676 + usb0_id_detect_pin: usb0_id_detect_pin@0 {
677 + allwinner,pins = "PH4";
678 + allwinner,function = "gpio_in";
679 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
680 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
681 + };
682 +
683 + usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
684 + allwinner,pins = "PH5";
685 + allwinner,function = "gpio_in";
686 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
687 + allwinner,pull = <SUN4I_PINCTRL_PULL_DOWN>;
688 + };
689 +};
690 +
691 +&reg_dcdc2 {
692 + regulator-always-on;
693 + regulator-min-microvolt = <1000000>;
694 + regulator-max-microvolt = <1400000>;
695 + regulator-name = "vdd-cpu";
696 };
697
698 -&reg_usb1_vbus {
699 +&reg_dcdc3 {
700 + regulator-always-on;
701 + regulator-min-microvolt = <1250000>;
702 + regulator-max-microvolt = <1250000>;
703 + regulator-name = "vdd-int-dll";
704 +};
705 +
706 +&reg_ldo1 {
707 + regulator-name = "vdd-rtc";
708 +};
709 +
710 +&reg_ldo2 {
711 + regulator-always-on;
712 + regulator-min-microvolt = <3000000>;
713 + regulator-max-microvolt = <3000000>;
714 + regulator-name = "avcc";
715 +};
716 +
717 +&reg_usb0_vbus {
718 status = "okay";
719 };
720
721 @@ -116,8 +214,17 @@
722 status = "okay";
723 };
724
725 +&usb_otg {
726 + dr_mode = "otg";
727 + status = "okay";
728 +};
729 +
730 &usbphy {
731 - usb1_vbus-supply = <&reg_usb1_vbus>;
732 + pinctrl-names = "default";
733 + pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
734 + usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
735 + usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
736 + usb0_vbus-supply = <&reg_usb0_vbus>;
737 usb2_vbus-supply = <&reg_usb2_vbus>;
738 status = "okay";
739 };
740 diff --git a/arch/arm/dts/sun4i-a10-inet9f-rev03.dts b/arch/arm/dts/sun4i-a10-inet9f-rev03.dts
741 index 8446465..bba4f9c 100644
742 --- a/arch/arm/dts/sun4i-a10-inet9f-rev03.dts
743 +++ b/arch/arm/dts/sun4i-a10-inet9f-rev03.dts
744 @@ -59,6 +59,159 @@
745 chosen {
746 stdout-path = "serial0:115200n8";
747 };
748 +
749 + gpio_keys {
750 + compatible = "gpio-keys-polled";
751 + pinctrl-names = "default";
752 + pinctrl-0 = <&key_pins_inet9f>;
753 + #address-cells = <1>;
754 + #size-cells = <0>;
755 + poll-interval = <20>;
756 +
757 + button@0 {
758 + label = "Left Joystick Left";
759 + linux,code = <ABS_X>;
760 + linux,input-type = <EV_ABS>;
761 + linux,input-value = <0xffffffff>; /* -1 */
762 + gpios = <&pio 0 6 GPIO_ACTIVE_LOW>; /* PA6 */
763 + };
764 +
765 + button@1 {
766 + label = "Left Joystick Right";
767 + linux,code = <ABS_X>;
768 + linux,input-type = <EV_ABS>;
769 + linux,input-value = <1>;
770 + gpios = <&pio 0 5 GPIO_ACTIVE_LOW>; /* PA5 */
771 + };
772 +
773 + button@2 {
774 + label = "Left Joystick Up";
775 + linux,code = <ABS_Y>;
776 + linux,input-type = <EV_ABS>;
777 + linux,input-value = <0xffffffff>; /* -1 */
778 + gpios = <&pio 0 8 GPIO_ACTIVE_LOW>; /* PA8 */
779 + };
780 +
781 + button@3 {
782 + label = "Left Joystick Down";
783 + linux,code = <ABS_Y>;
784 + linux,input-type = <EV_ABS>;
785 + linux,input-value = <1>;
786 + gpios = <&pio 0 9 GPIO_ACTIVE_LOW>; /* PA9 */
787 + };
788 +
789 + button@4 {
790 + label = "Right Joystick Left";
791 + linux,code = <ABS_Z>;
792 + linux,input-type = <EV_ABS>;
793 + linux,input-value = <0xffffffff>; /* -1 */
794 + gpios = <&pio 0 1 GPIO_ACTIVE_LOW>; /* PA1 */
795 + };
796 +
797 + button@5 {
798 + label = "Right Joystick Right";
799 + linux,code = <ABS_Z>;
800 + linux,input-type = <EV_ABS>;
801 + linux,input-value = <1>;
802 + gpios = <&pio 0 0 GPIO_ACTIVE_LOW>; /* PA0 */
803 + };
804 +
805 + button@6 {
806 + label = "Right Joystick Up";
807 + linux,code = <ABS_RZ>;
808 + linux,input-type = <EV_ABS>;
809 + linux,input-value = <0xffffffff>; /* -1 */
810 + gpios = <&pio 0 3 GPIO_ACTIVE_LOW>; /* PA3 */
811 + };
812 +
813 + button@7 {
814 + label = "Right Joystick Down";
815 + linux,code = <ABS_RZ>;
816 + linux,input-type = <EV_ABS>;
817 + linux,input-value = <1>;
818 + gpios = <&pio 0 4 GPIO_ACTIVE_LOW>; /* PA4 */
819 + };
820 +
821 + button@8 {
822 + label = "DPad Left";
823 + linux,code = <ABS_HAT0X>;
824 + linux,input-type = <EV_ABS>;
825 + linux,input-value = <0xffffffff>; /* -1 */
826 + gpios = <&pio 7 23 GPIO_ACTIVE_LOW>; /* PH23 */
827 + };
828 +
829 + button@9 {
830 + label = "DPad Right";
831 + linux,code = <ABS_HAT0X>;
832 + linux,input-type = <EV_ABS>;
833 + linux,input-value = <1>;
834 + gpios = <&pio 7 24 GPIO_ACTIVE_LOW>; /* PH24 */
835 + };
836 +
837 + button@10 {
838 + label = "DPad Up";
839 + linux,code = <ABS_HAT0Y>;
840 + linux,input-type = <EV_ABS>;
841 + linux,input-value = <0xffffffff>; /* -1 */
842 + gpios = <&pio 7 25 GPIO_ACTIVE_LOW>; /* PH25 */
843 + };
844 +
845 + button@11 {
846 + label = "DPad Down";
847 + linux,code = <ABS_HAT0Y>;
848 + linux,input-type = <EV_ABS>;
849 + linux,input-value = <1>;
850 + gpios = <&pio 7 26 GPIO_ACTIVE_LOW>; /* PH26 */
851 + };
852 +
853 + button@12 {
854 + label = "Button X";
855 + linux,code = <BTN_X>;
856 + gpios = <&pio 0 16 GPIO_ACTIVE_LOW>; /* PA16 */
857 + };
858 +
859 + button@13 {
860 + label = "Button Y";
861 + linux,code = <BTN_Y>;
862 + gpios = <&pio 0 14 GPIO_ACTIVE_LOW>; /* PA14 */
863 + };
864 +
865 + button@14 {
866 + label = "Button A";
867 + linux,code = <BTN_A>;
868 + gpios = <&pio 0 17 GPIO_ACTIVE_LOW>; /* PA17 */
869 + };
870 +
871 + button@15 {
872 + label = "Button B";
873 + linux,code = <BTN_B>;
874 + gpios = <&pio 0 15 GPIO_ACTIVE_LOW>; /* PA15 */
875 + };
876 +
877 + button@16 {
878 + label = "Select Button";
879 + linux,code = <BTN_SELECT>;
880 + gpios = <&pio 0 11 GPIO_ACTIVE_LOW>; /* PA11 */
881 + };
882 +
883 + button@17 {
884 + label = "Start Button";
885 + linux,code = <BTN_START>;
886 + gpios = <&pio 0 12 GPIO_ACTIVE_LOW>; /* PA12 */
887 + };
888 +
889 + button@18 {
890 + label = "Top Left Button";
891 + linux,code = <BTN_TL>;
892 + gpios = <&pio 7 22 GPIO_ACTIVE_LOW>; /* PH22 */
893 + };
894 +
895 + button@19 {
896 + label = "Top Right Button";
897 + linux,code = <BTN_TR>;
898 + gpios = <&pio 0 13 GPIO_ACTIVE_LOW>; /* PA13 */
899 + };
900 + };
901 };
902
903 &cpu0 {
904 @@ -86,12 +239,29 @@
905 pinctrl-names = "default";
906 pinctrl-0 = <&i2c1_pins_a>;
907 status = "okay";
908 +
909 + /* Accelerometer */
910 + bma250@18 {
911 + compatible = "bosch,bma250";
912 + reg = <0x18>;
913 + interrupt-parent = <&pio>;
914 + interrupts = <7 0 IRQ_TYPE_EDGE_RISING>; /* PH0 / EINT0 */
915 + };
916 };
917
918 &i2c2 {
919 pinctrl-names = "default";
920 pinctrl-0 = <&i2c2_pins_a>;
921 status = "okay";
922 +
923 + ft5406ee8: touchscreen@38 {
924 + compatible = "edt,edt-ft5406";
925 + reg = <0x38>;
926 + interrupt-parent = <&pio>;
927 + interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>;
928 + touchscreen-size-x = <800>;
929 + touchscreen-size-y = <480>;
930 + };
931 };
932
933 &lradc {
934 @@ -149,6 +319,17 @@
935 };
936
937 &pio {
938 + key_pins_inet9f: key_pins@0 {
939 + allwinner,pins = "PA0", "PA1", "PA3", "PA4",
940 + "PA5", "PA6", "PA8", "PA9",
941 + "PA11", "PA12", "PA13",
942 + "PA14", "PA15", "PA16", "PA17",
943 + "PH22", "PH23", "PH24", "PH25", "PH26";
944 + allwinner,function = "gpio_in";
945 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
946 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
947 + };
948 +
949 usb0_id_detect_pin: usb0_id_detect_pin@0 {
950 allwinner,pins = "PH4";
951 allwinner,function = "gpio_in";
952 diff --git a/arch/arm/dts/sun4i-a10-itead-iteaduino-plus.dts b/arch/arm/dts/sun4i-a10-itead-iteaduino-plus.dts
953 index 985e155..4e798f0 100644
954 --- a/arch/arm/dts/sun4i-a10-itead-iteaduino-plus.dts
955 +++ b/arch/arm/dts/sun4i-a10-itead-iteaduino-plus.dts
956 @@ -1,5 +1,6 @@
957 /*
958 * Copyright 2015 Josef Gajdusek <atx@atx.name>
959 + * Copyright 2015 - Marcus Cooper <codekipper@gmail.com>
960 *
961 * This file is dual-licensed: you can use it either under the terms
962 * of the GPL or the X11 license, at your option. Note that this dual
963 @@ -42,22 +43,11 @@
964
965 /dts-v1/;
966 #include "sun4i-a10.dtsi"
967 -#include "sunxi-common-regulators.dtsi"
968 -
969 -#include <dt-bindings/gpio/gpio.h>
970 -#include <dt-bindings/pinctrl/sun4i-a10.h>
971 +#include "sunxi-itead-core-common.dtsi"
972
973 / {
974 model = "Iteaduino Plus A10";
975 compatible = "itead,iteaduino-plus-a10", "allwinner,sun4i-a10";
976 -
977 - aliases {
978 - serial0 = &uart0;
979 - };
980 -
981 - chosen {
982 - stdout-path = "serial0:115200n8";
983 - };
984 };
985
986 &ahci {
987 @@ -65,18 +55,6 @@
988 status = "okay";
989 };
990
991 -&cpu0 {
992 - cpu-supply = <&reg_dcdc2>;
993 -};
994 -
995 -&ehci0 {
996 - status = "okay";
997 -};
998 -
999 -&ehci1 {
1000 - status = "okay";
1001 -};
1002 -
1003 &emac {
1004 pinctrl-names = "default";
1005 pinctrl-0 = <&emac_pins_a>;
1006 @@ -89,12 +67,7 @@
1007 };
1008
1009 &i2c0 {
1010 - pinctrl-names = "default";
1011 - pinctrl-0 = <&i2c0_pins_a>;
1012 - status = "okay";
1013 -
1014 axp209: pmic@34 {
1015 - reg = <0x34>;
1016 interrupts = <0>;
1017 };
1018 };
1019 @@ -135,68 +108,13 @@
1020 status = "okay";
1021 };
1022
1023 -&ohci0 {
1024 - status = "okay";
1025 -};
1026 -
1027 -&ohci1 {
1028 - status = "okay";
1029 -};
1030 -
1031 &reg_ahci_5v {
1032 status = "okay";
1033 };
1034
1035 -#include "axp209.dtsi"
1036 -
1037 -&reg_dcdc2 {
1038 - regulator-always-on;
1039 - regulator-min-microvolt = <1000000>;
1040 - regulator-max-microvolt = <1450000>;
1041 - regulator-name = "vdd-cpu";
1042 -};
1043 -
1044 -&reg_dcdc3 {
1045 - regulator-always-on;
1046 - regulator-min-microvolt = <1000000>;
1047 - regulator-max-microvolt = <1400000>;
1048 - regulator-name = "vdd-int-dll";
1049 -};
1050 -
1051 -&reg_ldo1 {
1052 - regulator-name = "vdd-rtc";
1053 -};
1054 -
1055 -&reg_ldo2 {
1056 - regulator-always-on;
1057 - regulator-min-microvolt = <3000000>;
1058 - regulator-max-microvolt = <3000000>;
1059 - regulator-name = "avcc";
1060 -};
1061 -
1062 -&reg_usb1_vbus {
1063 - status = "okay";
1064 -};
1065 -
1066 -&reg_usb2_vbus {
1067 - status = "okay";
1068 -};
1069 -
1070 &spi0 {
1071 pinctrl-names = "default";
1072 pinctrl-0 = <&spi0_pins_a>,
1073 <&spi0_cs0_pins_a>;
1074 status = "okay";
1075 };
1076 -
1077 -&uart0 {
1078 - pinctrl-names = "default";
1079 - pinctrl-0 = <&uart0_pins_a>;
1080 - status = "okay";
1081 -};
1082 -
1083 -&usbphy {
1084 - usb1_vbus-supply = <&reg_usb1_vbus>;
1085 - usb2_vbus-supply = <&reg_usb2_vbus>;
1086 - status = "okay";
1087 -};
1088 diff --git a/arch/arm/dts/sun4i-a10-jesurun-q5.dts b/arch/arm/dts/sun4i-a10-jesurun-q5.dts
1089 index dc2f2ae..7afc7a6 100644
1090 --- a/arch/arm/dts/sun4i-a10-jesurun-q5.dts
1091 +++ b/arch/arm/dts/sun4i-a10-jesurun-q5.dts
1092 @@ -156,6 +156,10 @@
1093 status = "okay";
1094 };
1095
1096 +&otg_sram {
1097 + status = "okay";
1098 +};
1099 +
1100 &pio {
1101 emac_power_pin_q5: emac_power_pin@0 {
1102 allwinner,pins = "PH19";
1103 @@ -172,6 +176,11 @@
1104 };
1105 };
1106
1107 +&reg_usb0_vbus {
1108 + regulator-boot-on;
1109 + status = "okay";
1110 +};
1111 +
1112 &reg_usb1_vbus {
1113 status = "okay";
1114 };
1115 @@ -186,7 +195,13 @@
1116 status = "okay";
1117 };
1118
1119 +&usb_otg {
1120 + dr_mode = "host";
1121 + status = "okay";
1122 +};
1123 +
1124 &usbphy {
1125 + usb0_vbus-supply = <&reg_usb0_vbus>;
1126 usb1_vbus-supply = <&reg_usb1_vbus>;
1127 usb2_vbus-supply = <&reg_usb2_vbus>;
1128 status = "okay";
1129 diff --git a/arch/arm/dts/sun4i-a10-marsboard.dts b/arch/arm/dts/sun4i-a10-marsboard.dts
1130 index 02158bc..8e50723 100644
1131 --- a/arch/arm/dts/sun4i-a10-marsboard.dts
1132 +++ b/arch/arm/dts/sun4i-a10-marsboard.dts
1133 @@ -91,6 +91,10 @@
1134 status = "okay";
1135 };
1136
1137 +&codec {
1138 + status = "okay";
1139 +};
1140 +
1141 &ehci0 {
1142 status = "okay";
1143 };
1144 @@ -154,6 +158,10 @@
1145 status = "okay";
1146 };
1147
1148 +&otg_sram {
1149 + status = "okay";
1150 +};
1151 +
1152 &pio {
1153 led_pins_marsboard: led_pins@0 {
1154 allwinner,pins = "PB5", "PB6", "PB7", "PB8";
1155 @@ -161,6 +169,13 @@
1156 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
1157 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
1158 };
1159 +
1160 + usb0_id_detect_pin: usb0_id_detect_pin@0 {
1161 + allwinner,pins = "PH4";
1162 + allwinner,function = "gpio_in";
1163 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
1164 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
1165 + };
1166 };
1167
1168 &reg_usb1_vbus {
1169 @@ -184,7 +199,15 @@
1170 status = "okay";
1171 };
1172
1173 +&usb_otg {
1174 + dr_mode = "otg";
1175 + status = "okay";
1176 +};
1177 +
1178 &usbphy {
1179 + pinctrl-names = "default";
1180 + pinctrl-0 = <&usb0_id_detect_pin>;
1181 + usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
1182 usb1_vbus-supply = <&reg_usb1_vbus>;
1183 usb2_vbus-supply = <&reg_usb2_vbus>;
1184 status = "okay";
1185 diff --git a/arch/arm/dts/sun4i-a10-mk802.dts b/arch/arm/dts/sun4i-a10-mk802.dts
1186 index 3c7eebe..ee46ea8 100644
1187 --- a/arch/arm/dts/sun4i-a10-mk802.dts
1188 +++ b/arch/arm/dts/sun4i-a10-mk802.dts
1189 @@ -44,6 +44,7 @@
1190 #include "sun4i-a10.dtsi"
1191 #include "sunxi-common-regulators.dtsi"
1192 #include <dt-bindings/gpio/gpio.h>
1193 +#include <dt-bindings/pinctrl/sun4i-a10.h>
1194
1195 / {
1196 model = "MK802";
1197 @@ -58,6 +59,10 @@
1198 };
1199 };
1200
1201 +&codec {
1202 + status = "okay";
1203 +};
1204 +
1205 &ehci0 {
1206 status = "okay";
1207 };
1208 @@ -80,7 +85,25 @@
1209 status = "okay";
1210 };
1211
1212 +&otg_sram {
1213 + status = "okay";
1214 +};
1215 +
1216 &pio {
1217 + usb0_id_detect_pin: usb0_id_detect_pin@0 {
1218 + allwinner,pins = "PH4";
1219 + allwinner,function = "gpio_in";
1220 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
1221 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
1222 + };
1223 +
1224 + usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
1225 + allwinner,pins = "PH5";
1226 + allwinner,function = "gpio_in";
1227 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
1228 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
1229 + };
1230 +
1231 usb2_vbus_pin_mk802: usb2_vbus_pin@0 {
1232 allwinner,pins = "PH12";
1233 allwinner,function = "gpio_out";
1234 @@ -89,6 +112,10 @@
1235 };
1236 };
1237
1238 +&reg_usb0_vbus {
1239 + status = "okay";
1240 +};
1241 +
1242 &reg_usb1_vbus {
1243 status = "okay";
1244 };
1245 @@ -105,7 +132,17 @@
1246 status = "okay";
1247 };
1248
1249 +&usb_otg {
1250 + dr_mode = "otg";
1251 + status = "okay";
1252 +};
1253 +
1254 &usbphy {
1255 + pinctrl-names = "default";
1256 + pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
1257 + usb0_id_det-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
1258 + usb0_vbus_det-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
1259 + usb0_vbus-supply = <&reg_usb0_vbus>;
1260 usb1_vbus-supply = <&reg_usb1_vbus>;
1261 usb2_vbus-supply = <&reg_usb2_vbus>;
1262 status = "okay";
1263 diff --git a/arch/arm/dts/sun4i-a10-olinuxino-lime.dts b/arch/arm/dts/sun4i-a10-olinuxino-lime.dts
1264 index 28e32ad..b350448 100644
1265 --- a/arch/arm/dts/sun4i-a10-olinuxino-lime.dts
1266 +++ b/arch/arm/dts/sun4i-a10-olinuxino-lime.dts
1267 @@ -124,6 +124,18 @@
1268 };
1269 };
1270
1271 +&i2c1 {
1272 + pinctrl-names = "default";
1273 + pinctrl-0 = <&i2c1_pins_a>;
1274 + status = "okay";
1275 +
1276 + eeprom: eeprom@50 {
1277 + compatible = "atmel,24c16";
1278 + reg = <0x50>;
1279 + pagesize = <16>;
1280 + };
1281 +};
1282 +
1283 &mdio {
1284 status = "okay";
1285
1286 diff --git a/arch/arm/dts/sun4i-a10-pcduino.dts b/arch/arm/dts/sun4i-a10-pcduino.dts
1287 index 4e3e1b9..39034aa 100644
1288 --- a/arch/arm/dts/sun4i-a10-pcduino.dts
1289 +++ b/arch/arm/dts/sun4i-a10-pcduino.dts
1290 @@ -104,6 +104,10 @@
1291 };
1292 };
1293
1294 +&cpu0 {
1295 + cpu-supply = <&reg_dcdc2>;
1296 +};
1297 +
1298 &ehci0 {
1299 status = "okay";
1300 };
1301 @@ -129,12 +133,8 @@
1302 status = "okay";
1303
1304 axp209: pmic@34 {
1305 - compatible = "x-powers,axp209";
1306 reg = <0x34>;
1307 interrupts = <0>;
1308 -
1309 - interrupt-controller;
1310 - #interrupt-cells = <1>;
1311 };
1312 };
1313
1314 @@ -164,6 +164,10 @@
1315 status = "okay";
1316 };
1317
1318 +&otg_sram {
1319 + status = "okay";
1320 +};
1321 +
1322 &pio {
1323 led_pins_pcduino: led_pins@0 {
1324 allwinner,pins = "PH15", "PH16";
1325 @@ -178,14 +182,40 @@
1326 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
1327 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
1328 };
1329 +
1330 + usb0_id_detect_pin: usb0_id_detect_pin@0 {
1331 + allwinner,pins = "PH4";
1332 + allwinner,function = "gpio_in";
1333 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
1334 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
1335 + };
1336 };
1337
1338 -&reg_usb1_vbus {
1339 - status = "okay";
1340 +#include "axp209.dtsi"
1341 +
1342 +&reg_dcdc2 {
1343 + regulator-always-on;
1344 + regulator-min-microvolt = <1000000>;
1345 + regulator-max-microvolt = <1400000>;
1346 + regulator-name = "vdd-cpu";
1347 };
1348
1349 -&reg_usb2_vbus {
1350 - status = "okay";
1351 +&reg_dcdc3 {
1352 + regulator-always-on;
1353 + regulator-min-microvolt = <1000000>;
1354 + regulator-max-microvolt = <1400000>;
1355 + regulator-name = "vdd-int-dll";
1356 +};
1357 +
1358 +&reg_ldo1 {
1359 + regulator-name = "vdd-rtc";
1360 +};
1361 +
1362 +&reg_ldo2 {
1363 + regulator-always-on;
1364 + regulator-min-microvolt = <3000000>;
1365 + regulator-max-microvolt = <3000000>;
1366 + regulator-name = "avcc";
1367 };
1368
1369 &uart0 {
1370 @@ -194,8 +224,16 @@
1371 status = "okay";
1372 };
1373
1374 +&usb_otg {
1375 + dr_mode = "otg";
1376 + status = "okay";
1377 +};
1378 +
1379 &usbphy {
1380 - usb1_vbus-supply = <&reg_usb1_vbus>;
1381 - usb2_vbus-supply = <&reg_usb2_vbus>;
1382 + pinctrl-names = "default";
1383 + pinctrl-0 = <&usb0_id_detect_pin>;
1384 + usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
1385 + usb1_vbus-supply = <&reg_vcc5v0>; /* USB1 VBUS is always on */
1386 + usb2_vbus-supply = <&reg_vcc5v0>; /* USB2 VBUS is always on */
1387 status = "okay";
1388 };
1389 diff --git a/arch/arm/dts/sun4i-a10-pcduino2.dts b/arch/arm/dts/sun4i-a10-pcduino2.dts
1390 new file mode 100644
1391 index 0000000..de483a1
1392 --- /dev/null
1393 +++ b/arch/arm/dts/sun4i-a10-pcduino2.dts
1394 @@ -0,0 +1,78 @@
1395 +/*
1396 + * Copyright 2015 Siarhei Siamashka <siarhei.siamashka@gmail.com>
1397 + *
1398 + * This file is dual-licensed: you can use it either under the terms
1399 + * of the GPL or the X11 license, at your option. Note that this dual
1400 + * licensing only applies to this file, and not this project as a
1401 + * whole.
1402 + *
1403 + * a) This file is free software; you can redistribute it and/or
1404 + * modify it under the terms of the GNU General Public License as
1405 + * published by the Free Software Foundation; either version 2 of the
1406 + * License, or (at your option) any later version.
1407 + *
1408 + * This file is distributed in the hope that it will be useful,
1409 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1410 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1411 + * GNU General Public License for more details.
1412 + *
1413 + * Or, alternatively,
1414 + *
1415 + * b) Permission is hereby granted, free of charge, to any person
1416 + * obtaining a copy of this software and associated documentation
1417 + * files (the "Software"), to deal in the Software without
1418 + * restriction, including without limitation the rights to use,
1419 + * copy, modify, merge, publish, distribute, sublicense, and/or
1420 + * sell copies of the Software, and to permit persons to whom the
1421 + * Software is furnished to do so, subject to the following
1422 + * conditions:
1423 + *
1424 + * The above copyright notice and this permission notice shall be
1425 + * included in all copies or substantial portions of the Software.
1426 + *
1427 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1428 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
1429 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
1430 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
1431 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
1432 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1433 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1434 + * OTHER DEALINGS IN THE SOFTWARE.
1435 + */
1436 +
1437 +/*
1438 + * The LinkSprite pcDuino2 board is almost identical to the older
1439 + * LinkSprite pcDuino1 board. The only software visible difference
1440 + * is that the pcDuino2 board got a USB VBUS voltage regulator, which
1441 + * is controlled by the PD2 pin (pulled-up by default). Also one of
1442 + * the USB host ports has been replaced with a USB WIFI chip.
1443 + */
1444 +
1445 +#include "sun4i-a10-pcduino.dts"
1446 +
1447 +/ {
1448 + model = "LinkSprite pcDuino2";
1449 + compatible = "linksprite,a10-pcduino2", "allwinner,sun4i-a10";
1450 +};
1451 +
1452 +&pio {
1453 + usb2_vbus_pin_pcduino2: usb2_vbus_pin@0 {
1454 + allwinner,pins = "PD2";
1455 + allwinner,function = "gpio_out";
1456 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
1457 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
1458 + };
1459 +};
1460 +
1461 +&reg_usb2_vbus {
1462 + pinctrl-names = "default";
1463 + pinctrl-0 = <&usb2_vbus_pin_pcduino2>;
1464 + gpio = <&pio 3 2 GPIO_ACTIVE_HIGH>;
1465 + status = "okay";
1466 +};
1467 +
1468 +&usbphy {
1469 + usb1_vbus-supply = <&reg_vcc3v3>; /* USB WIFI is always on */
1470 + usb2_vbus-supply = <&reg_usb2_vbus>;
1471 + status = "okay";
1472 +};
1473 diff --git a/arch/arm/dts/sun4i-a10-pov-protab2-ips9.dts b/arch/arm/dts/sun4i-a10-pov-protab2-ips9.dts
1474 index 223515e..ea90634 100644
1475 --- a/arch/arm/dts/sun4i-a10-pov-protab2-ips9.dts
1476 +++ b/arch/arm/dts/sun4i-a10-pov-protab2-ips9.dts
1477 @@ -47,6 +47,7 @@
1478 #include <dt-bindings/input/input.h>
1479 #include <dt-bindings/interrupt-controller/irq.h>
1480 #include <dt-bindings/pinctrl/sun4i-a10.h>
1481 +#include <dt-bindings/pwm/pwm.h>
1482
1483 / {
1484 model = "Point of View Protab2-IPS9";
1485 @@ -56,11 +57,28 @@
1486 serial0 = &uart0;
1487 };
1488
1489 + backlight: backlight {
1490 + compatible = "pwm-backlight";
1491 + pinctrl-names = "default";
1492 + pinctrl-0 = <&bl_en_pin_protab>;
1493 + pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
1494 + brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
1495 + default-brightness-level = <8>;
1496 + enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */
1497 + };
1498 +
1499 chosen {
1500 stdout-path = "serial0:115200n8";
1501 };
1502 };
1503
1504 +&codec {
1505 + pinctrl-names = "default";
1506 + pinctrl-0 = <&codec_pa_pin>;
1507 + allwinner,pa-gpios = <&pio 7 15 GPIO_ACTIVE_HIGH>; /* PH15 */
1508 + status = "okay";
1509 +};
1510 +
1511 &cpu0 {
1512 cpu-supply = <&reg_dcdc2>;
1513 };
1514 @@ -86,12 +104,36 @@
1515 pinctrl-names = "default";
1516 pinctrl-0 = <&i2c1_pins_a>;
1517 status = "okay";
1518 +
1519 + /* Accelerometer */
1520 + bma250@18 {
1521 + compatible = "bosch,bma250";
1522 + reg = <0x18>;
1523 + interrupt-parent = <&pio>;
1524 + interrupts = <7 0 IRQ_TYPE_EDGE_RISING>; /* PH0 / EINT0 */
1525 + };
1526 };
1527
1528 &i2c2 {
1529 pinctrl-names = "default";
1530 pinctrl-0 = <&i2c2_pins_a>;
1531 status = "okay";
1532 +
1533 + pixcir_ts@5c {
1534 + pinctrl-names = "default";
1535 + pinctrl-0 = <&touchscreen_pins>;
1536 + compatible = "pixcir,pixcir_tangoc";
1537 + reg = <0x5c>;
1538 + interrupt-parent = <&pio>;
1539 + interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; /* EINT21 (PH21) */
1540 + attb-gpio = <&pio 7 21 GPIO_ACTIVE_HIGH>; /* PH21 */
1541 + enable-gpios = <&pio 0 5 GPIO_ACTIVE_LOW>;
1542 + wake-gpios = <&pio 1 13 GPIO_ACTIVE_LOW>;
1543 + touchscreen-size-x = <1024>;
1544 + touchscreen-size-y = <768>;
1545 + touchscreen-inverted-x;
1546 + touchscreen-inverted-y;
1547 + };
1548 };
1549
1550 &lradc {
1551 @@ -128,6 +170,27 @@
1552 };
1553
1554 &pio {
1555 + bl_en_pin_protab: bl_en_pin@0 {
1556 + allwinner,pins = "PH7";
1557 + allwinner,function = "gpio_out";
1558 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
1559 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
1560 + };
1561 +
1562 + codec_pa_pin: codec_pa_pin@0 {
1563 + allwinner,pins = "PH15";
1564 + allwinner,function = "gpio_out";
1565 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
1566 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
1567 + };
1568 +
1569 + touchscreen_pins: touchscreen_pins@0 {
1570 + allwinner,pins = "PA5", "PB13";
1571 + allwinner,function = "gpio_out";
1572 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
1573 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
1574 + };
1575 +
1576 usb0_id_detect_pin: usb0_id_detect_pin@0 {
1577 allwinner,pins = "PH4";
1578 allwinner,function = "gpio_in";
1579 @@ -143,6 +206,12 @@
1580 };
1581 };
1582
1583 +&pwm {
1584 + pinctrl-names = "default";
1585 + pinctrl-0 = <&pwm0_pins_a>;
1586 + status = "okay";
1587 +};
1588 +
1589 &reg_dcdc2 {
1590 regulator-always-on;
1591 regulator-min-microvolt = <1000000>;
1592 diff --git a/arch/arm/dts/sun4i-a10.dtsi b/arch/arm/dts/sun4i-a10.dtsi
1593 index 463bacd..2c8f5e6 100644
1594 --- a/arch/arm/dts/sun4i-a10.dtsi
1595 +++ b/arch/arm/dts/sun4i-a10.dtsi
1596 @@ -45,6 +45,7 @@
1597
1598 #include <dt-bindings/thermal/thermal.h>
1599
1600 +#include <dt-bindings/clock/sun4i-a10-pll2.h>
1601 #include <dt-bindings/dma/sun4i-a10.h>
1602 #include <dt-bindings/pinctrl/sun4i-a10.h>
1603
1604 @@ -65,7 +66,7 @@
1605 "simple-framebuffer";
1606 allwinner,pipeline = "de_be0-lcd0-hdmi";
1607 clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>,
1608 - <&ahb_gates 44>;
1609 + <&ahb_gates 44>, <&dram_gates 26>;
1610 status = "disabled";
1611 };
1612
1613 @@ -74,7 +75,8 @@
1614 "simple-framebuffer";
1615 allwinner,pipeline = "de_fe0-de_be0-lcd0-hdmi";
1616 clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>,
1617 - <&ahb_gates 44>, <&ahb_gates 46>;
1618 + <&ahb_gates 44>, <&ahb_gates 46>,
1619 + <&dram_gates 25>, <&dram_gates 26>;
1620 status = "disabled";
1621 };
1622
1623 @@ -83,7 +85,8 @@
1624 "simple-framebuffer";
1625 allwinner,pipeline = "de_fe0-de_be0-lcd0";
1626 clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>,
1627 - <&ahb_gates 46>;
1628 + <&ahb_gates 46>, <&dram_gates 25>,
1629 + <&dram_gates 26>;
1630 status = "disabled";
1631 };
1632
1633 @@ -92,7 +95,8 @@
1634 "simple-framebuffer";
1635 allwinner,pipeline = "de_fe0-de_be0-lcd0-tve0";
1636 clocks = <&pll5 1>, <&ahb_gates 34>, <&ahb_gates 36>,
1637 - <&ahb_gates 44>, <&ahb_gates 46>;
1638 + <&ahb_gates 44>, <&ahb_gates 46>,
1639 + <&dram_gates 25>, <&dram_gates 26>;
1640 status = "disabled";
1641 };
1642 };
1643 @@ -195,6 +199,15 @@
1644 clock-output-names = "pll1";
1645 };
1646
1647 + pll2: clk@01c20008 {
1648 + #clock-cells = <1>;
1649 + compatible = "allwinner,sun4i-a10-pll2-clk";
1650 + reg = <0x01c20008 0x8>;
1651 + clocks = <&osc24M>;
1652 + clock-output-names = "pll2-1x", "pll2-2x",
1653 + "pll2-4x", "pll2-8x";
1654 + };
1655 +
1656 pll4: clk@01c20018 {
1657 #clock-cells = <0>;
1658 compatible = "allwinner,sun4i-a10-pll1-clk";
1659 @@ -241,6 +254,7 @@
1660 compatible = "allwinner,sun4i-a10-axi-gates-clk";
1661 reg = <0x01c2005c 0x4>;
1662 clocks = <&axi>;
1663 + clock-indices = <0>;
1664 clock-output-names = "axi_dram";
1665 };
1666
1667 @@ -257,17 +271,36 @@
1668 compatible = "allwinner,sun4i-a10-ahb-gates-clk";
1669 reg = <0x01c20060 0x8>;
1670 clocks = <&ahb>;
1671 + clock-indices = <0>, <1>,
1672 + <2>, <3>,
1673 + <4>, <5>, <6>,
1674 + <7>, <8>, <9>,
1675 + <10>, <11>, <12>,
1676 + <13>, <14>, <16>,
1677 + <17>, <18>, <20>,
1678 + <21>, <22>, <23>,
1679 + <24>, <25>, <26>,
1680 + <32>, <33>, <34>,
1681 + <35>, <36>, <37>,
1682 + <40>, <41>, <43>,
1683 + <44>, <45>,
1684 + <46>, <47>,
1685 + <50>, <52>;
1686 clock-output-names = "ahb_usb0", "ahb_ehci0",
1687 - "ahb_ohci0", "ahb_ehci1", "ahb_ohci1", "ahb_ss",
1688 - "ahb_dma", "ahb_bist", "ahb_mmc0", "ahb_mmc1",
1689 - "ahb_mmc2", "ahb_mmc3", "ahb_ms", "ahb_nand",
1690 - "ahb_sdram", "ahb_ace", "ahb_emac", "ahb_ts",
1691 - "ahb_spi0", "ahb_spi1", "ahb_spi2", "ahb_spi3",
1692 - "ahb_pata", "ahb_sata", "ahb_gps", "ahb_ve",
1693 - "ahb_tvd", "ahb_tve0", "ahb_tve1", "ahb_lcd0",
1694 - "ahb_lcd1", "ahb_csi0", "ahb_csi1", "ahb_hdmi",
1695 - "ahb_de_be0", "ahb_de_be1", "ahb_de_fe0",
1696 - "ahb_de_fe1", "ahb_mp", "ahb_mali400";
1697 + "ahb_ohci0", "ahb_ehci1",
1698 + "ahb_ohci1", "ahb_ss", "ahb_dma",
1699 + "ahb_bist", "ahb_mmc0", "ahb_mmc1",
1700 + "ahb_mmc2", "ahb_mmc3", "ahb_ms",
1701 + "ahb_nand", "ahb_sdram", "ahb_ace",
1702 + "ahb_emac", "ahb_ts", "ahb_spi0",
1703 + "ahb_spi1", "ahb_spi2", "ahb_spi3",
1704 + "ahb_pata", "ahb_sata", "ahb_gps",
1705 + "ahb_ve", "ahb_tvd", "ahb_tve0",
1706 + "ahb_tve1", "ahb_lcd0", "ahb_lcd1",
1707 + "ahb_csi0", "ahb_csi1", "ahb_hdmi",
1708 + "ahb_de_be0", "ahb_de_be1",
1709 + "ahb_de_fe0", "ahb_de_fe1",
1710 + "ahb_mp", "ahb_mali400";
1711 };
1712
1713 apb0: apb0@01c20054 {
1714 @@ -283,9 +316,14 @@
1715 compatible = "allwinner,sun4i-a10-apb0-gates-clk";
1716 reg = <0x01c20068 0x4>;
1717 clocks = <&apb0>;
1718 + clock-indices = <0>, <1>,
1719 + <2>, <3>,
1720 + <5>, <6>,
1721 + <7>, <10>;
1722 clock-output-names = "apb0_codec", "apb0_spdif",
1723 - "apb0_ac97", "apb0_iis", "apb0_pio", "apb0_ir0",
1724 - "apb0_ir1", "apb0_keypad";
1725 + "apb0_ac97", "apb0_iis",
1726 + "apb0_pio", "apb0_ir0",
1727 + "apb0_ir1", "apb0_keypad";
1728 };
1729
1730 apb1: clk@01c20058 {
1731 @@ -301,12 +339,22 @@
1732 compatible = "allwinner,sun4i-a10-apb1-gates-clk";
1733 reg = <0x01c2006c 0x4>;
1734 clocks = <&apb1>;
1735 + clock-indices = <0>, <1>,
1736 + <2>, <4>,
1737 + <5>, <6>,
1738 + <7>, <16>,
1739 + <17>, <18>,
1740 + <19>, <20>,
1741 + <21>, <22>,
1742 + <23>;
1743 clock-output-names = "apb1_i2c0", "apb1_i2c1",
1744 - "apb1_i2c2", "apb1_can", "apb1_scr",
1745 - "apb1_ps20", "apb1_ps21", "apb1_uart0",
1746 - "apb1_uart1", "apb1_uart2", "apb1_uart3",
1747 - "apb1_uart4", "apb1_uart5", "apb1_uart6",
1748 - "apb1_uart7";
1749 + "apb1_i2c2", "apb1_can",
1750 + "apb1_scr", "apb1_ps20",
1751 + "apb1_ps21", "apb1_uart0",
1752 + "apb1_uart1", "apb1_uart2",
1753 + "apb1_uart3", "apb1_uart4",
1754 + "apb1_uart5", "apb1_uart6",
1755 + "apb1_uart7";
1756 };
1757
1758 nand_clk: clk@01c20080 {
1759 @@ -446,6 +494,48 @@
1760 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
1761 clock-output-names = "spi3";
1762 };
1763 +
1764 + dram_gates: clk@01c20100 {
1765 + #clock-cells = <1>;
1766 + compatible = "allwinner,sun4i-a10-dram-gates-clk";
1767 + reg = <0x01c20100 0x4>;
1768 + clocks = <&pll5 0>;
1769 + clock-indices = <0>,
1770 + <1>, <2>,
1771 + <3>,
1772 + <4>,
1773 + <5>, <6>,
1774 + <15>,
1775 + <24>, <25>,
1776 + <26>, <27>,
1777 + <28>, <29>;
1778 + clock-output-names = "dram_ve",
1779 + "dram_csi0", "dram_csi1",
1780 + "dram_ts",
1781 + "dram_tvd",
1782 + "dram_tve0", "dram_tve1",
1783 + "dram_output",
1784 + "dram_de_fe1", "dram_de_fe0",
1785 + "dram_de_be0", "dram_de_be1",
1786 + "dram_de_mp", "dram_ace";
1787 + };
1788 +
1789 + ve_clk: clk@01c2013c {
1790 + #clock-cells = <0>;
1791 + #reset-cells = <0>;
1792 + compatible = "allwinner,sun4i-a10-ve-clk";
1793 + reg = <0x01c2013c 0x4>;
1794 + clocks = <&pll4>;
1795 + clock-output-names = "ve";
1796 + };
1797 +
1798 + codec_clk: clk@01c20140 {
1799 + #clock-cells = <0>;
1800 + compatible = "allwinner,sun4i-a10-codec-clk";
1801 + reg = <0x01c20140 0x4>;
1802 + clocks = <&pll2 SUN4I_A10_PLL2_1X>;
1803 + clock-output-names = "codec";
1804 + };
1805 };
1806
1807 soc@01c00000 {
1808 @@ -656,6 +746,14 @@
1809 status = "disabled";
1810 };
1811
1812 + crypto: crypto-engine@01c15000 {
1813 + compatible = "allwinner,sun4i-a10-crypto";
1814 + reg = <0x01c15000 0x1000>;
1815 + interrupts = <86>;
1816 + clocks = <&ahb_gates 5>, <&ss_clk>;
1817 + clock-names = "ahb", "mod";
1818 + };
1819 +
1820 spi2: spi@01c17000 {
1821 compatible = "allwinner,sun4i-a10-spi";
1822 reg = <0x01c17000 0x1000>;
1823 @@ -961,6 +1059,19 @@
1824 status = "disabled";
1825 };
1826
1827 + codec: codec@01c22c00 {
1828 + #sound-dai-cells = <0>;
1829 + compatible = "allwinner,sun4i-a10-codec";
1830 + reg = <0x01c22c00 0x40>;
1831 + interrupts = <30>;
1832 + clocks = <&apb0_gates 0>, <&codec_clk>;
1833 + clock-names = "apb", "codec";
1834 + dmas = <&dma SUN4I_DMA_NORMAL 19>,
1835 + <&dma SUN4I_DMA_NORMAL 19>;
1836 + dma-names = "rx", "tx";
1837 + status = "disabled";
1838 + };
1839 +
1840 sid: eeprom@01c23800 {
1841 compatible = "allwinner,sun4i-a10-sid";
1842 reg = <0x01c23800 0x10>;
1843 diff --git a/arch/arm/dts/sun5i-a10s-auxtek-t004.dts b/arch/arm/dts/sun5i-a10s-auxtek-t004.dts
1844 index 2b3511e..a790ec8 100644
1845 --- a/arch/arm/dts/sun5i-a10s-auxtek-t004.dts
1846 +++ b/arch/arm/dts/sun5i-a10s-auxtek-t004.dts
1847 @@ -86,6 +86,20 @@
1848 status = "okay";
1849 };
1850
1851 +&i2c0 {
1852 + pinctrl-names = "default";
1853 + pinctrl-0 = <&i2c0_pins_a>;
1854 + status = "okay";
1855 +
1856 + axp152: pmic@30 {
1857 + compatible = "x-powers,axp152";
1858 + reg = <0x30>;
1859 + interrupts = <0>;
1860 + interrupt-controller;
1861 + #interrupt-cells = <1>;
1862 + };
1863 +};
1864 +
1865 &mmc0 {
1866 pinctrl-names = "default";
1867 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_t004>;
1868 diff --git a/arch/arm/dts/sun5i-a10s-olinuxino-micro.dts b/arch/arm/dts/sun5i-a10s-olinuxino-micro.dts
1869 index 5a422c1..86d046a 100644
1870 --- a/arch/arm/dts/sun5i-a10s-olinuxino-micro.dts
1871 +++ b/arch/arm/dts/sun5i-a10s-olinuxino-micro.dts
1872 @@ -111,7 +111,7 @@
1873 status = "okay";
1874
1875 at24@50 {
1876 - compatible = "at,24c16";
1877 + compatible = "atmel,24c16";
1878 pagesize = <16>;
1879 reg = <0x50>;
1880 read-only;
1881 diff --git a/arch/arm/dts/sun5i-a13-empire-electronix-d709.dts b/arch/arm/dts/sun5i-a13-empire-electronix-d709.dts
1882 index 7fbb0b0..6efbba6 100644
1883 --- a/arch/arm/dts/sun5i-a13-empire-electronix-d709.dts
1884 +++ b/arch/arm/dts/sun5i-a13-empire-electronix-d709.dts
1885 @@ -123,7 +123,7 @@
1886
1887 &mmc0 {
1888 pinctrl-names = "default";
1889 - pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_inet98fv2>;
1890 + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_d709>;
1891 vmmc-supply = <&reg_vcc3v3>;
1892 bus-width = <4>;
1893 cd-gpios = <&pio 6 0 GPIO_ACTIVE_HIGH>; /* PG0 */
1894 @@ -131,27 +131,12 @@
1895 status = "okay";
1896 };
1897
1898 -&mmc2 {
1899 - pinctrl-names = "default";
1900 - pinctrl-0 = <&mmc2_pins_a>;
1901 - vmmc-supply = <&reg_vcc3v3>;
1902 - bus-width = <8>;
1903 - non-removable;
1904 - status = "okay";
1905 -
1906 - mmccard: mmccard@0 {
1907 - reg = <0>;
1908 - compatible = "mmc-card";
1909 - broken-hpi;
1910 - };
1911 -};
1912 -
1913 &otg_sram {
1914 status = "okay";
1915 };
1916
1917 &pio {
1918 - mmc0_cd_pin_inet98fv2: mmc0_cd_pin@0 {
1919 + mmc0_cd_pin_d709: mmc0_cd_pin@0 {
1920 allwinner,pins = "PG0";
1921 allwinner,function = "gpio_in";
1922 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
1923 diff --git a/arch/arm/dts/sun5i-a13-inet-98v-rev2.dts b/arch/arm/dts/sun5i-a13-inet-98v-rev2.dts
1924 index 6d466a2..1b11ec9 100644
1925 --- a/arch/arm/dts/sun5i-a13-inet-98v-rev2.dts
1926 +++ b/arch/arm/dts/sun5i-a13-inet-98v-rev2.dts
1927 @@ -123,21 +123,6 @@
1928 status = "okay";
1929 };
1930
1931 -&mmc2 {
1932 - pinctrl-names = "default";
1933 - pinctrl-0 = <&mmc2_pins_a>;
1934 - vmmc-supply = <&reg_vcc3v3>;
1935 - bus-width = <8>;
1936 - non-removable;
1937 - status = "okay";
1938 -
1939 - mmccard: mmccard@0 {
1940 - reg = <0>;
1941 - compatible = "mmc-card";
1942 - broken-hpi;
1943 - };
1944 -};
1945 -
1946 &otg_sram {
1947 status = "okay";
1948 };
1949 @@ -201,11 +186,6 @@
1950 status = "okay";
1951 };
1952
1953 -&reg_usb1_vbus {
1954 - gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */
1955 - status = "okay";
1956 -};
1957 -
1958 &uart1 {
1959 pinctrl-names = "default";
1960 pinctrl-0 = <&uart1_pins_b>;
1961 @@ -221,16 +201,12 @@
1962 allwinner,pins = "PG12";
1963 };
1964
1965 -&usb1_vbus_pin_a {
1966 - allwinner,pins = "PG11";
1967 -};
1968 -
1969 &usbphy {
1970 pinctrl-names = "default";
1971 pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
1972 usb0_id_det-gpio = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */
1973 usb0_vbus_det-gpio = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */
1974 usb0_vbus-supply = <&reg_usb0_vbus>;
1975 - usb1_vbus-supply = <&reg_usb1_vbus>;
1976 + usb1_vbus-supply = <&reg_ldo3>;
1977 status = "okay";
1978 };
1979 diff --git a/arch/arm/dts/sun5i-a13-utoo-p66.dts b/arch/arm/dts/sun5i-a13-utoo-p66.dts
1980 index eb793d5..fa9ddfd 100644
1981 --- a/arch/arm/dts/sun5i-a13-utoo-p66.dts
1982 +++ b/arch/arm/dts/sun5i-a13-utoo-p66.dts
1983 @@ -47,11 +47,21 @@
1984 #include <dt-bindings/input/input.h>
1985 #include <dt-bindings/interrupt-controller/irq.h>
1986 #include <dt-bindings/pinctrl/sun4i-a10.h>
1987 +#include <dt-bindings/pwm/pwm.h>
1988
1989 / {
1990 model = "Utoo P66";
1991 compatible = "utoo,p66", "allwinner,sun5i-a13";
1992
1993 + backlight: backlight {
1994 + compatible = "pwm-backlight";
1995 + pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
1996 + /* Note levels of 10 / 20% result in backlight off */
1997 + brightness-levels = <0 30 40 50 60 70 80 90 100>;
1998 + default-brightness-level = <6>;
1999 + /* TODO: backlight uses axp gpio1 as enable pin */
2000 + };
2001 +
2002 i2c_lcd: i2c@0 {
2003 /* The lcd panel i2c interface is hooked up via gpios */
2004 compatible = "i2c-gpio";
2005 @@ -63,6 +73,13 @@
2006 };
2007 };
2008
2009 +&codec {
2010 + pinctrl-names = "default";
2011 + pinctrl-0 = <&codec_pa_pin>;
2012 + allwinner,pa-gpios = <&pio 6 3 GPIO_ACTIVE_HIGH>; /* PG3 */
2013 + status = "okay";
2014 +};
2015 +
2016 &cpu0 {
2017 cpu-supply = <&reg_dcdc2>;
2018 };
2019 @@ -158,6 +175,13 @@
2020 };
2021
2022 &pio {
2023 + codec_pa_pin: codec_pa_pin@0 {
2024 + allwinner,pins = "PG3";
2025 + allwinner,function = "gpio_out";
2026 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
2027 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
2028 + };
2029 +
2030 mmc0_cd_pin_p66: mmc0_cd_pin@0 {
2031 allwinner,pins = "PG0";
2032 allwinner,function = "gpio_in";
2033 @@ -201,6 +225,12 @@
2034 };
2035 };
2036
2037 +&pwm {
2038 + pinctrl-names = "default";
2039 + pinctrl-0 = <&pwm0_pins>;
2040 + status = "okay";
2041 +};
2042 +
2043 &reg_dcdc2 {
2044 regulator-always-on;
2045 regulator-min-microvolt = <1000000>;
2046 diff --git a/arch/arm/dts/sun5i-q8-common.dtsi b/arch/arm/dts/sun5i-q8-common.dtsi
2047 index 0641d68..a78e189 100644
2048 --- a/arch/arm/dts/sun5i-q8-common.dtsi
2049 +++ b/arch/arm/dts/sun5i-q8-common.dtsi
2050 @@ -41,11 +41,21 @@
2051 */
2052 #include "sunxi-q8-common.dtsi"
2053
2054 +#include <dt-bindings/pwm/pwm.h>
2055 +
2056 / {
2057 aliases {
2058 serial0 = &uart1;
2059 };
2060
2061 + backlight: backlight {
2062 + compatible = "pwm-backlight";
2063 + pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
2064 + brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
2065 + default-brightness-level = <8>;
2066 + /* TODO: backlight uses axp gpio1 as enable pin */
2067 + };
2068 +
2069 chosen {
2070 stdout-path = "serial0:115200n8";
2071 };
2072 diff --git a/arch/arm/dts/sun5i-r8-chip.dts b/arch/arm/dts/sun5i-r8-chip.dts
2073 index abf3ccb..6ad19e2 100644
2074 --- a/arch/arm/dts/sun5i-r8-chip.dts
2075 +++ b/arch/arm/dts/sun5i-r8-chip.dts
2076 @@ -64,6 +64,26 @@
2077 chosen {
2078 stdout-path = "serial0:115200n8";
2079 };
2080 +
2081 + wifi_reg_on: wifi_reg_on {
2082 + compatible = "regulator-fixed";
2083 + pinctrl-names = "default";
2084 + pinctrl-0 = <&chip_wifi_reg_on_pin>;
2085 +
2086 + regulator-name = "wifi-reg-on";
2087 + regulator-min-microvolt = <3300000>;
2088 + regulator-max-microvolt = <3300000>;
2089 + gpio = <&pio 2 19 GPIO_ACTIVE_HIGH>; /* PC19 */
2090 + enable-active-high;
2091 + };
2092 +};
2093 +
2094 +&codec {
2095 + status = "okay";
2096 +};
2097 +
2098 +&cpu0 {
2099 + cpu-supply = <&reg_dcdc2>;
2100 };
2101
2102 &ehci0 {
2103 @@ -109,10 +129,14 @@
2104 };
2105 };
2106
2107 +&mmc0_pins_a {
2108 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
2109 +};
2110 +
2111 &mmc0 {
2112 pinctrl-names = "default";
2113 pinctrl-0 = <&mmc0_pins_a>;
2114 - vmmc-supply = <&reg_vcc3v3>;
2115 + vmmc-supply = <&wifi_reg_on>;
2116 bus-width = <4>;
2117 non-removable;
2118 status = "okay";
2119 @@ -134,6 +158,13 @@
2120 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
2121 };
2122
2123 + chip_wifi_reg_on_pin: chip_wifi_reg_on_pin@0 {
2124 + allwinner,pins = "PC19";
2125 + allwinner,function = "gpio_out";
2126 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
2127 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
2128 + };
2129 +
2130 chip_id_det_pin: chip_id_det_pin@0 {
2131 allwinner,pins = "PG2";
2132 allwinner,function = "gpio_in";
2133 @@ -167,6 +198,20 @@
2134 regulator-always-on;
2135 };
2136
2137 +&reg_ldo3 {
2138 + regulator-min-microvolt = <3300000>;
2139 + regulator-max-microvolt = <3300000>;
2140 + regulator-name = "vdd-wifi1";
2141 + regulator-always-on;
2142 +};
2143 +
2144 +&reg_ldo4 {
2145 + regulator-min-microvolt = <3300000>;
2146 + regulator-max-microvolt = <3300000>;
2147 + regulator-name = "vdd-wifi2";
2148 + regulator-always-on;
2149 +};
2150 +
2151 &reg_ldo5 {
2152 regulator-min-microvolt = <1800000>;
2153 regulator-max-microvolt = <1800000>;
2154 diff --git a/arch/arm/dts/sun5i.dtsi b/arch/arm/dts/sun5i.dtsi
2155 index 9ffee9b..59a9426 100644
2156 --- a/arch/arm/dts/sun5i.dtsi
2157 +++ b/arch/arm/dts/sun5i.dtsi
2158 @@ -44,6 +44,7 @@
2159
2160 #include "skeleton.dtsi"
2161
2162 +#include <dt-bindings/clock/sun4i-a10-pll2.h>
2163 #include <dt-bindings/dma/sun4i-a10.h>
2164 #include <dt-bindings/pinctrl/sun4i-a10.h>
2165
2166 @@ -102,6 +103,15 @@
2167 clock-output-names = "pll1";
2168 };
2169
2170 + pll2: clk@01c20008 {
2171 + #clock-cells = <1>;
2172 + compatible = "allwinner,sun5i-a13-pll2-clk";
2173 + reg = <0x01c20008 0x8>;
2174 + clocks = <&osc24M>;
2175 + clock-output-names = "pll2-1x", "pll2-2x",
2176 + "pll2-4x", "pll2-8x";
2177 + };
2178 +
2179 pll4: clk@01c20018 {
2180 #clock-cells = <0>;
2181 compatible = "allwinner,sun4i-a10-pll1-clk";
2182 @@ -285,6 +295,14 @@
2183 clock-output-names = "usb_ohci0", "usb_phy";
2184 };
2185
2186 + codec_clk: clk@01c20140 {
2187 + #clock-cells = <0>;
2188 + compatible = "allwinner,sun4i-a10-codec-clk";
2189 + reg = <0x01c20140 0x4>;
2190 + clocks = <&pll2 SUN4I_A10_PLL2_1X>;
2191 + clock-output-names = "codec";
2192 + };
2193 +
2194 mbus_clk: clk@01c2015c {
2195 #clock-cells = <0>;
2196 compatible = "allwinner,sun5i-a13-mbus-clk";
2197 @@ -571,6 +589,19 @@
2198 status = "disabled";
2199 };
2200
2201 + codec: codec@01c22c00 {
2202 + #sound-dai-cells = <0>;
2203 + compatible = "allwinner,sun4i-a10-codec";
2204 + reg = <0x01c22c00 0x40>;
2205 + interrupts = <30>;
2206 + clocks = <&apb0_gates 0>, <&codec_clk>;
2207 + clock-names = "apb", "codec";
2208 + dmas = <&dma SUN4I_DMA_NORMAL 19>,
2209 + <&dma SUN4I_DMA_NORMAL 19>;
2210 + dma-names = "rx", "tx";
2211 + status = "disabled";
2212 + };
2213 +
2214 sid: eeprom@01c23800 {
2215 compatible = "allwinner,sun4i-a10-sid";
2216 reg = <0x01c23800 0x10>;
2217 diff --git a/arch/arm/dts/sun6i-a31-colombus.dts b/arch/arm/dts/sun6i-a31-colombus.dts
2218 index 0d0b6f2..f9cf368 100644
2219 --- a/arch/arm/dts/sun6i-a31-colombus.dts
2220 +++ b/arch/arm/dts/sun6i-a31-colombus.dts
2221 @@ -60,6 +60,16 @@
2222 chosen {
2223 stdout-path = "serial0:115200n8";
2224 };
2225 +
2226 + i2c_lcd: i2c@0 {
2227 + /* The lcd panel i2c interface is hooked up via gpios */
2228 + compatible = "i2c-gpio";
2229 + pinctrl-names = "default";
2230 + pinctrl-0 = <&i2c_lcd_pins>;
2231 + gpios = <&pio 0 23 GPIO_ACTIVE_HIGH>, /* PA23, sda */
2232 + <&pio 0 24 GPIO_ACTIVE_HIGH>; /* PA24, scl */
2233 + i2c-gpio,delay-us = <5>;
2234 + };
2235 };
2236
2237 &ehci1 {
2238 @@ -94,6 +104,13 @@
2239 pinctrl-names = "default";
2240 pinctrl-0 = <&i2c2_pins_a>;
2241 status = "okay";
2242 +
2243 + mma8452: mma8452@1d {
2244 + compatible = "fsl,mma8452";
2245 + reg = <0x1d>;
2246 + interrupt-parent = <&pio>;
2247 + interrupts = <0 9 IRQ_TYPE_LEVEL_LOW>; /* PA9 */
2248 + };
2249 };
2250
2251 &mmc0 {
2252 @@ -124,6 +141,13 @@
2253 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
2254 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
2255 };
2256 +
2257 + i2c_lcd_pins: i2c_lcd_pin@0 {
2258 + allwinner,pins = "PA23", "PA24";
2259 + allwinner,function = "gpio_out";
2260 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
2261 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
2262 + };
2263 };
2264
2265 &reg_usb2_vbus {
2266 diff --git a/arch/arm/dts/sun6i-a31-hummingbird.dts b/arch/arm/dts/sun6i-a31-hummingbird.dts
2267 index d0cfada..9a74637 100644
2268 --- a/arch/arm/dts/sun6i-a31-hummingbird.dts
2269 +++ b/arch/arm/dts/sun6i-a31-hummingbird.dts
2270 @@ -54,6 +54,8 @@
2271 compatible = "merrii,a31-hummingbird", "allwinner,sun6i-a31";
2272
2273 aliases {
2274 + rtc0 = &pcf8563;
2275 + rtc1 = &rtc;
2276 serial0 = &uart0;
2277 };
2278
2279 @@ -67,13 +69,17 @@
2280 };
2281 };
2282
2283 +&cpu0 {
2284 + cpu-supply = <&reg_dcdc3>;
2285 +};
2286 +
2287 &ehci0 {
2288 status = "okay";
2289 };
2290
2291 &gmac {
2292 pinctrl-names = "default";
2293 - pinctrl-0 = <&gmac_pins_rgmii_a>;
2294 + pinctrl-0 = <&gmac_pins_rgmii_a>, <&gmac_phy_reset_pin_hummingbird>;
2295 phy = <&phy1>;
2296 phy-mode = "rgmii";
2297 snps,reset-gpio = <&pio 0 21 GPIO_ACTIVE_HIGH>;
2298 @@ -119,7 +125,7 @@
2299 &mmc0 {
2300 pinctrl-names = "default";
2301 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_hummingbird>;
2302 - vmmc-supply = <&vcc_3v0>;
2303 + vmmc-supply = <&reg_dcdc1>;
2304 bus-width = <4>;
2305 cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */
2306 cd-inverted;
2307 @@ -134,7 +140,7 @@
2308 &mmc1 {
2309 pinctrl-names = "default";
2310 pinctrl-0 = <&mmc1_pins_a>, <&wifi_reset_pin_hummingbird>;
2311 - vmmc-supply = <&vcc_wifi>;
2312 + vmmc-supply = <&reg_aldo1>;
2313 mmc-pwrseq = <&wifi_pwrseq>;
2314 bus-width = <4>;
2315 non-removable;
2316 @@ -146,6 +152,13 @@
2317 };
2318
2319 &pio {
2320 + gmac_phy_reset_pin_hummingbird: gmac_phy_reset_pin@0 {
2321 + allwinner,pins = "PA21";
2322 + allwinner,function = "gpio_out";
2323 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
2324 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
2325 + };
2326 +
2327 mmc0_cd_pin_hummingbird: mmc0_cd_pin@0 {
2328 allwinner,pins = "PA8";
2329 allwinner,function = "gpio_in";
2330 @@ -164,70 +177,69 @@
2331 &p2wi {
2332 status = "okay";
2333
2334 - axp221: pmic@68 {
2335 + axp22x: pmic@68 {
2336 compatible = "x-powers,axp221";
2337 reg = <0x68>;
2338 interrupt-parent = <&nmi_intc>;
2339 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
2340 - interrupt-controller;
2341 - #interrupt-cells = <1>;
2342 - dcdc1-supply = <&vcc_3v0>;
2343 - dcdc5-supply = <&vcc_dram>;
2344 -
2345 - regulators {
2346 - x-powers,dcdc-freq = <3000>;
2347 -
2348 - vcc_3v0: dcdc1 {
2349 - regulator-always-on;
2350 - regulator-min-microvolt = <3000000>;
2351 - regulator-max-microvolt = <3000000>;
2352 - regulator-name = "vcc-3v0";
2353 - };
2354 -
2355 - vdd_cpu: dcdc2 {
2356 - regulator-always-on;
2357 - regulator-min-microvolt = <700000>;
2358 - regulator-max-microvolt = <1320000>;
2359 - regulator-name = "vdd-cpu";
2360 - };
2361 -
2362 - vdd_gpu: dcdc3 {
2363 - regulator-always-on;
2364 - regulator-min-microvolt = <700000>;
2365 - regulator-max-microvolt = <1320000>;
2366 - regulator-name = "vdd-gpu";
2367 - };
2368 -
2369 - vdd_sys_dll: dcdc4 {
2370 - regulator-always-on;
2371 - regulator-min-microvolt = <1100000>;
2372 - regulator-max-microvolt = <1100000>;
2373 - regulator-name = "vdd-sys-dll";
2374 - };
2375 -
2376 - vcc_dram: dcdc5 {
2377 - regulator-always-on;
2378 - regulator-min-microvolt = <1500000>;
2379 - regulator-max-microvolt = <1500000>;
2380 - regulator-name = "vcc-dram";
2381 - };
2382 -
2383 - vcc_wifi: aldo1 {
2384 - regulator-min-microvolt = <3300000>;
2385 - regulator-max-microvolt = <3300000>;
2386 - regulator-name = "vcc_wifi";
2387 - };
2388 -
2389 - avcc: aldo3 {
2390 - regulator-always-on;
2391 - regulator-min-microvolt = <3000000>;
2392 - regulator-max-microvolt = <3000000>;
2393 - regulator-name = "avcc";
2394 - };
2395 - };
2396 };
2397 };
2398
2399 +#include "axp22x.dtsi"
2400 +
2401 +&reg_aldo1 {
2402 + regulator-min-microvolt = <3300000>;
2403 + regulator-max-microvolt = <3300000>;
2404 + regulator-name = "vcc-wifi";
2405 +};
2406 +
2407 +&reg_aldo3 {
2408 + regulator-always-on;
2409 + regulator-min-microvolt = <2700000>;
2410 + regulator-max-microvolt = <3300000>;
2411 + regulator-name = "avcc";
2412 +};
2413 +
2414 +&reg_dc5ldo {
2415 + regulator-min-microvolt = <700000>;
2416 + regulator-max-microvolt = <1320000>;
2417 + regulator-name = "vdd-cpus";
2418 +};
2419 +
2420 +&reg_dcdc1 {
2421 + regulator-always-on;
2422 + regulator-min-microvolt = <3000000>;
2423 + regulator-max-microvolt = <3000000>;
2424 + regulator-name = "vcc-3v0";
2425 +};
2426 +
2427 +&reg_dcdc2 {
2428 + regulator-min-microvolt = <700000>;
2429 + regulator-max-microvolt = <1320000>;
2430 + regulator-name = "vdd-gpu";
2431 +};
2432 +
2433 +&reg_dcdc3 {
2434 + regulator-always-on;
2435 + regulator-min-microvolt = <700000>;
2436 + regulator-max-microvolt = <1320000>;
2437 + regulator-name = "vdd-cpu";
2438 +};
2439 +
2440 +&reg_dcdc4 {
2441 + regulator-always-on;
2442 + regulator-min-microvolt = <700000>;
2443 + regulator-max-microvolt = <1320000>;
2444 + regulator-name = "vdd-sys-dll";
2445 +};
2446 +
2447 +&reg_dcdc5 {
2448 + regulator-always-on;
2449 + regulator-min-microvolt = <1500000>;
2450 + regulator-max-microvolt = <1500000>;
2451 + regulator-name = "vcc-dram";
2452 +};
2453 +
2454 &reg_usb1_vbus {
2455 gpio = <&pio 7 24 GPIO_ACTIVE_HIGH>; /* PH24 */
2456 status = "okay";
2457 diff --git a/arch/arm/dts/sun6i-a31.dtsi b/arch/arm/dts/sun6i-a31.dtsi
2458 index 44f889f..1867af2 100644
2459 --- a/arch/arm/dts/sun6i-a31.dtsi
2460 +++ b/arch/arm/dts/sun6i-a31.dtsi
2461 @@ -61,7 +61,7 @@
2462 #size-cells = <1>;
2463 ranges;
2464
2465 - framebuffer@0 {
2466 + simplefb_hdmi: framebuffer@0 {
2467 compatible = "allwinner,simple-framebuffer",
2468 "simple-framebuffer";
2469 allwinner,pipeline = "de_be0-lcd0-hdmi";
2470 @@ -69,7 +69,7 @@
2471 status = "disabled";
2472 };
2473
2474 - framebuffer@1 {
2475 + simplefb_lcd: framebuffer@1 {
2476 compatible = "allwinner,simple-framebuffer",
2477 "simple-framebuffer";
2478 allwinner,pipeline = "de_be0-lcd0";
2479 @@ -252,6 +252,20 @@
2480 compatible = "allwinner,sun6i-a31-ahb1-gates-clk";
2481 reg = <0x01c20060 0x8>;
2482 clocks = <&ahb1>;
2483 + clock-indices = <1>, <5>,
2484 + <6>, <8>, <9>,
2485 + <10>, <11>, <12>,
2486 + <13>, <14>,
2487 + <17>, <18>, <19>,
2488 + <20>, <21>, <22>,
2489 + <23>, <24>, <26>,
2490 + <27>, <29>,
2491 + <30>, <31>, <32>,
2492 + <36>, <37>, <40>,
2493 + <43>, <44>, <45>,
2494 + <46>, <47>, <50>,
2495 + <52>, <55>, <56>,
2496 + <57>, <58>;
2497 clock-output-names = "ahb1_mipidsi", "ahb1_ss",
2498 "ahb1_dma", "ahb1_mmc0", "ahb1_mmc1",
2499 "ahb1_mmc2", "ahb1_mmc3", "ahb1_nand1",
2500 @@ -281,6 +295,9 @@
2501 compatible = "allwinner,sun6i-a31-apb1-gates-clk";
2502 reg = <0x01c20068 0x4>;
2503 clocks = <&apb1>;
2504 + clock-indices = <0>, <4>,
2505 + <5>, <12>,
2506 + <13>;
2507 clock-output-names = "apb1_codec", "apb1_digital_mic",
2508 "apb1_pio", "apb1_daudio0",
2509 "apb1_daudio1";
2510 @@ -299,6 +316,10 @@
2511 compatible = "allwinner,sun6i-a31-apb2-gates-clk";
2512 reg = <0x01c2006c 0x4>;
2513 clocks = <&apb2>;
2514 + clock-indices = <0>, <1>,
2515 + <2>, <3>, <16>,
2516 + <17>, <18>, <19>,
2517 + <20>, <21>;
2518 clock-output-names = "apb2_i2c0", "apb2_i2c1",
2519 "apb2_i2c2", "apb2_i2c3",
2520 "apb2_uart0", "apb2_uart1",
2521 @@ -346,6 +367,14 @@
2522 "mmc3_sample";
2523 };
2524
2525 + ss_clk: clk@01c2009c {
2526 + #clock-cells = <0>;
2527 + compatible = "allwinner,sun4i-a10-mod0-clk";
2528 + reg = <0x01c2009c 0x4>;
2529 + clocks = <&osc24M>, <&pll6 0>;
2530 + clock-output-names = "ss";
2531 + };
2532 +
2533 spi0_clk: clk@01c200a0 {
2534 #clock-cells = <0>;
2535 compatible = "allwinner,sun4i-a10-mod0-clk";
2536 @@ -384,6 +413,9 @@
2537 compatible = "allwinner,sun6i-a31-usb-clk";
2538 reg = <0x01c200cc 0x4>;
2539 clocks = <&osc24M>;
2540 + clock-indices = <8>, <9>, <10>,
2541 + <16>, <17>,
2542 + <18>;
2543 clock-output-names = "usb_phy0", "usb_phy1", "usb_phy2",
2544 "usb_ohci0", "usb_ohci1",
2545 "usb_ohci2";
2546 @@ -677,6 +709,16 @@
2547 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
2548 };
2549
2550 + mmc3_8bit_emmc_pins: mmc3@1 {
2551 + allwinner,pins = "PC6", "PC7", "PC8", "PC9",
2552 + "PC10", "PC11", "PC12",
2553 + "PC13", "PC14", "PC15",
2554 + "PC24";
2555 + allwinner,function = "mmc3";
2556 + allwinner,drive = <SUN4I_PINCTRL_40_MA>;
2557 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
2558 + };
2559 +
2560 gmac_pins_mii_a: gmac_mii@0 {
2561 allwinner,pins = "PA0", "PA1", "PA2", "PA3",
2562 "PA8", "PA9", "PA11",
2563 @@ -754,6 +796,13 @@
2564 reg = <0x01c20ca0 0x20>;
2565 };
2566
2567 + lradc: lradc@01c22800 {
2568 + compatible = "allwinner,sun4i-a10-lradc-keys";
2569 + reg = <0x01c22800 0x100>;
2570 + interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
2571 + status = "disabled";
2572 + };
2573 +
2574 rtp: rtp@01c25000 {
2575 compatible = "allwinner,sun6i-a31-ts";
2576 reg = <0x01c25000 0x100>;
2577 @@ -900,6 +949,16 @@
2578 #size-cells = <0>;
2579 };
2580
2581 + crypto: crypto-engine@01c15000 {
2582 + compatible = "allwinner,sun4i-a10-crypto";
2583 + reg = <0x01c15000 0x1000>;
2584 + interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>;
2585 + clocks = <&ahb1_gates 5>, <&ss_clk>;
2586 + clock-names = "ahb", "mod";
2587 + resets = <&ahb1_rst 5>;
2588 + reset-names = "ahb";
2589 + };
2590 +
2591 timer@01c60000 {
2592 compatible = "allwinner,sun6i-a31-hstimer",
2593 "allwinner,sun7i-a20-hstimer";
2594 @@ -1061,7 +1120,7 @@
2595 resets = <&apb0_rst 0>;
2596 gpio-controller;
2597 interrupt-controller;
2598 - #interrupt-cells = <2>;
2599 + #interrupt-cells = <3>;
2600 #size-cells = <0>;
2601 #gpio-cells = <3>;
2602
2603 diff --git a/arch/arm/dts/sun6i-a31s-primo81.dts b/arch/arm/dts/sun6i-a31s-primo81.dts
2604 index cfdc03e..379746a 100644
2605 --- a/arch/arm/dts/sun6i-a31s-primo81.dts
2606 +++ b/arch/arm/dts/sun6i-a31s-primo81.dts
2607 @@ -1,16 +1,57 @@
2608 /*
2609 - * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
2610 + * Copyright 2014 Siarhei Siamashka <siarhei.siamashka@gmail.com>
2611 + * Copyright 2015 Karsten Merker <merker@debian.org>
2612 + * Copyright 2015 Chen-Yu Tsai <wens@csie.org>
2613 *
2614 - * Minimal dts file for the MSI Primo81 for u-boot only
2615 + * This file is dual-licensed: you can use it either under the terms
2616 + * of the GPL or the X11 license, at your option. Note that this dual
2617 + * licensing only applies to this file, and not this project as a
2618 + * whole.
2619 *
2620 - * SPDX-License-Identifier: GPL-2.0+ or X11
2621 + * a) This file is free software; you can redistribute it and/or
2622 + * modify it under the terms of the GNU General Public License as
2623 + * published by the Free Software Foundation; either version 2 of the
2624 + * License, or (at your option) any later version.
2625 + *
2626 + * This file is distributed in the hope that it will be useful,
2627 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2628 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2629 + * GNU General Public License for more details.
2630 + *
2631 + * Or, alternatively,
2632 + *
2633 + * b) Permission is hereby granted, free of charge, to any person
2634 + * obtaining a copy of this software and associated documentation
2635 + * files (the "Software"), to deal in the Software without
2636 + * restriction, including without limitation the rights to use,
2637 + * copy, modify, merge, publish, distribute, sublicense, and/or
2638 + * sell copies of the Software, and to permit persons to whom the
2639 + * Software is furnished to do so, subject to the following
2640 + * conditions:
2641 + *
2642 + * The above copyright notice and this permission notice shall be
2643 + * included in all copies or substantial portions of the Software.
2644 + *
2645 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
2646 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
2647 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
2648 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
2649 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
2650 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2651 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2652 + * OTHER DEALINGS IN THE SOFTWARE.
2653 */
2654
2655 /dts-v1/;
2656 #include "sun6i-a31s.dtsi"
2657 +#include "sunxi-common-regulators.dtsi"
2658 +
2659 +#include <dt-bindings/gpio/gpio.h>
2660 +#include <dt-bindings/input/input.h>
2661 +#include <dt-bindings/pinctrl/sun4i-a10.h>
2662
2663 / {
2664 - model = "MSI Primo81";
2665 + model = "MSI Primo81 tablet";
2666 compatible = "msi,primo81", "allwinner,sun6i-a31s";
2667
2668 aliases {
2669 @@ -22,8 +63,202 @@
2670 };
2671 };
2672
2673 -&uart0 {
2674 +&cpu0 {
2675 + cpu-supply = <&reg_dcdc3>;
2676 +};
2677 +
2678 +&ehci0 {
2679 + /* rtl8188etv wifi is connected here */
2680 + status = "okay";
2681 +};
2682 +
2683 +&i2c0 {
2684 + /* pull-ups and device VDDIO use AXP221 DLDO3 */
2685 + pinctrl-names = "default";
2686 + pinctrl-0 = <&i2c0_pins_a>;
2687 + status = "failed";
2688 +};
2689 +
2690 +&i2c1 {
2691 + pinctrl-names = "default";
2692 + pinctrl-0 = <&i2c1_pins_a>;
2693 + status = "okay";
2694 +
2695 + ctp@5d {
2696 + pinctrl-names = "default";
2697 + pinctrl-0 = <&gt911_int_primo81>;
2698 + compatible = "goodix,gt911";
2699 + reg = <0x5d>;
2700 + interrupt-parent = <&pio>;
2701 + interrupts = <0 3 IRQ_TYPE_LEVEL_HIGH>; /* PA3 */
2702 + touchscreen-swapped-x-y;
2703 + };
2704 +};
2705 +
2706 +&i2c2 {
2707 pinctrl-names = "default";
2708 - pinctrl-0 = <&uart0_pins_a>;
2709 + pinctrl-0 = <&i2c2_pins_a>;
2710 + status = "okay";
2711 +
2712 + accelerometer@1c {
2713 + pinctrl-names = "default";
2714 + pinctrl-0 = <&mma8452_int_primo81>;
2715 + compatible = "fsl,mma8452";
2716 + reg = <0x1c>;
2717 + interrupt-parent = <&pio>;
2718 + interrupts = <0 9 IRQ_TYPE_LEVEL_HIGH>; /* PA9 */
2719 + #io-channel-cells = <1>;
2720 + };
2721 +};
2722 +
2723 +&lradc {
2724 + vref-supply = <&reg_aldo3>;
2725 + status = "okay";
2726 +
2727 + button@158 {
2728 + label = "Volume Up";
2729 + linux,code = <KEY_VOLUMEUP>;
2730 + channel = <0>;
2731 + voltage = <158730>;
2732 + };
2733 +
2734 + button@349 {
2735 + label = "Volume Down";
2736 + linux,code = <KEY_VOLUMEDOWN>;
2737 + channel = <0>;
2738 + voltage = <349206>;
2739 + };
2740 +};
2741 +
2742 +&mmc0 {
2743 + pinctrl-names = "default";
2744 + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_primo81>;
2745 + vmmc-supply = <&reg_dcdc1>;
2746 + bus-width = <4>;
2747 + cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */
2748 + cd-inverted;
2749 + status = "okay";
2750 +};
2751 +
2752 +&pio {
2753 + gt911_int_primo81: gt911_int_pin@0 {
2754 + allwinner,pins = "PA3";
2755 + allwinner,function = "gpio_in";
2756 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
2757 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
2758 + };
2759 +
2760 + mma8452_int_primo81: mma8452_int_pin@0 {
2761 + allwinner,pins = "PA9";
2762 + allwinner,function = "gpio_in";
2763 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
2764 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
2765 + };
2766 +
2767 + mmc0_cd_pin_primo81: mmc0_cd_pin@0 {
2768 + allwinner,pins = "PA8";
2769 + allwinner,function = "gpio_in";
2770 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
2771 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
2772 + };
2773 +};
2774 +
2775 +&p2wi {
2776 + status = "okay";
2777 +
2778 + axp22x: pmic@68 {
2779 + compatible = "x-powers,axp221";
2780 + reg = <0x68>;
2781 + interrupt-parent = <&nmi_intc>;
2782 + interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
2783 + };
2784 +};
2785 +
2786 +#include "axp22x.dtsi"
2787 +
2788 +&reg_aldo3 {
2789 + regulator-always-on;
2790 + regulator-min-microvolt = <2700000>;
2791 + regulator-max-microvolt = <3300000>;
2792 + regulator-name = "avcc";
2793 +};
2794 +
2795 +&reg_dc1sw {
2796 + regulator-min-microvolt = <3000000>;
2797 + regulator-max-microvolt = <3000000>;
2798 + regulator-name = "vcc-lcd";
2799 +};
2800 +
2801 +&reg_dc5ldo {
2802 + regulator-min-microvolt = <700000>;
2803 + regulator-max-microvolt = <1320000>;
2804 + regulator-name = "vdd-cpus"; /* This is an educated guess */
2805 +};
2806 +
2807 +&reg_dcdc1 {
2808 + regulator-always-on;
2809 + regulator-min-microvolt = <3000000>;
2810 + regulator-max-microvolt = <3000000>;
2811 + regulator-name = "vcc-3v0";
2812 +};
2813 +
2814 +&reg_dcdc2 {
2815 + regulator-min-microvolt = <700000>;
2816 + regulator-max-microvolt = <1320000>;
2817 + regulator-name = "vdd-gpu";
2818 +};
2819 +
2820 +&reg_dcdc3 {
2821 + regulator-always-on;
2822 + regulator-min-microvolt = <700000>;
2823 + regulator-max-microvolt = <1320000>;
2824 + regulator-name = "vdd-cpu";
2825 +};
2826 +
2827 +&reg_dcdc4 {
2828 + regulator-always-on;
2829 + regulator-min-microvolt = <700000>;
2830 + regulator-max-microvolt = <1320000>;
2831 + regulator-name = "vdd-sys-dll";
2832 +};
2833 +
2834 +&reg_dcdc5 {
2835 + regulator-always-on;
2836 + regulator-min-microvolt = <1500000>;
2837 + regulator-max-microvolt = <1500000>;
2838 + regulator-name = "vcc-dram";
2839 +};
2840 +
2841 +&reg_dldo1 {
2842 + regulator-min-microvolt = <3300000>;
2843 + regulator-max-microvolt = <3300000>;
2844 + regulator-name = "vcc-wifi";
2845 +};
2846 +
2847 +&reg_dldo3 {
2848 + regulator-min-microvolt = <2800000>;
2849 + regulator-max-microvolt = <2800000>;
2850 + regulator-name = "vddio-csi";
2851 +};
2852 +
2853 +&reg_eldo3 {
2854 + regulator-min-microvolt = <1080000>;
2855 + regulator-max-microvolt = <1320000>;
2856 + regulator-name = "vdd-mipi-bridge";
2857 +};
2858 +
2859 +&simplefb_lcd {
2860 + vcc-lcd-supply = <&reg_dc1sw>;
2861 + vdd-mipi-bridge-supply = <&reg_eldo3>;
2862 +};
2863 +
2864 +&usb_otg {
2865 + /* otg support requires support for AXP221 usb-power-supply and GPIO */
2866 + dr_mode = "host";
2867 + status = "okay";
2868 +};
2869 +
2870 +&usbphy {
2871 + usb1_vbus-supply = <&reg_dldo1>;
2872 status = "okay";
2873 };
2874 diff --git a/arch/arm/dts/sun6i-a31s-sina31s-core.dtsi b/arch/arm/dts/sun6i-a31s-sina31s-core.dtsi
2875 new file mode 100644
2876 index 0000000..4ec0c86
2877 --- /dev/null
2878 +++ b/arch/arm/dts/sun6i-a31s-sina31s-core.dtsi
2879 @@ -0,0 +1,142 @@
2880 +/*
2881 + * Copyright 2015 Chen-Yu Tsai <wens@csie.org>
2882 + *
2883 + * This file is dual-licensed: you can use it either under the terms
2884 + * of the GPL or the X11 license, at your option. Note that this dual
2885 + * licensing only applies to this file, and not this project as a
2886 + * whole.
2887 + *
2888 + * a) This file is free software; you can redistribute it and/or
2889 + * modify it under the terms of the GNU General Public License as
2890 + * published by the Free Software Foundation; either version 2 of the
2891 + * License, or (at your option) any later version.
2892 + *
2893 + * This file is distributed in the hope that it will be useful,
2894 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2895 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2896 + * GNU General Public License for more details.
2897 + *
2898 + * Or, alternatively,
2899 + *
2900 + * b) Permission is hereby granted, free of charge, to any person
2901 + * obtaining a copy of this software and associated documentation
2902 + * files (the "Software"), to deal in the Software without
2903 + * restriction, including without limitation the rights to use,
2904 + * copy, modify, merge, publish, distribute, sublicense, and/or
2905 + * sell copies of the Software, and to permit persons to whom the
2906 + * Software is furnished to do so, subject to the following
2907 + * conditions:
2908 + *
2909 + * The above copyright notice and this permission notice shall be
2910 + * included in all copies or substantial portions of the Software.
2911 + *
2912 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
2913 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
2914 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
2915 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
2916 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
2917 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2918 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2919 + * OTHER DEALINGS IN THE SOFTWARE.
2920 + */
2921 +
2922 +/dts-v1/;
2923 +#include "sun6i-a31s.dtsi"
2924 +#include "sunxi-common-regulators.dtsi"
2925 +
2926 +#include <dt-bindings/gpio/gpio.h>
2927 +#include <dt-bindings/pinctrl/sun4i-a10.h>
2928 +
2929 +/ {
2930 + model = "Sinlinx SinA31s Core Board";
2931 + compatible = "sinlinx,sina31s", "allwinner,sun6i-a31s";
2932 +
2933 + aliases {
2934 + serial0 = &uart0;
2935 + };
2936 +};
2937 +
2938 +&cpu0 {
2939 + cpu-supply = <&reg_dcdc3>;
2940 +};
2941 +
2942 +/* eMMC on core board */
2943 +&mmc3 {
2944 + pinctrl-names = "default";
2945 + pinctrl-0 = <&mmc3_8bit_emmc_pins>;
2946 + vmmc-supply = <&reg_dcdc1>;
2947 + vqmmc-supply = <&reg_dcdc1>;
2948 + bus-width = <8>;
2949 + non-removable;
2950 + cap-mmc-hw-reset;
2951 + status = "okay";
2952 +};
2953 +
2954 +/* AXP221s PMIC on core board */
2955 +&p2wi {
2956 + status = "okay";
2957 +
2958 + axp22x: pmic@68 {
2959 + compatible = "x-powers,axp221";
2960 + reg = <0x68>;
2961 + interrupt-parent = <&nmi_intc>;
2962 + interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
2963 + };
2964 +};
2965 +
2966 +#include "axp22x.dtsi"
2967 +
2968 +&reg_aldo3 {
2969 + regulator-always-on;
2970 + regulator-min-microvolt = <2700000>;
2971 + regulator-max-microvolt = <3300000>;
2972 + regulator-name = "avcc";
2973 +};
2974 +
2975 +&reg_dc5ldo {
2976 + regulator-min-microvolt = <700000>;
2977 + regulator-max-microvolt = <1320000>;
2978 + regulator-name = "vdd-cpus";
2979 +};
2980 +
2981 +&reg_dcdc1 {
2982 + regulator-always-on;
2983 + regulator-min-microvolt = <3000000>;
2984 + regulator-max-microvolt = <3000000>;
2985 + regulator-name = "vcc-3v0";
2986 +};
2987 +
2988 +&reg_dcdc2 {
2989 + regulator-min-microvolt = <700000>;
2990 + regulator-max-microvolt = <1320000>;
2991 + regulator-name = "vdd-gpu";
2992 +};
2993 +
2994 +&reg_dcdc3 {
2995 + regulator-always-on;
2996 + regulator-min-microvolt = <700000>;
2997 + regulator-max-microvolt = <1320000>;
2998 + regulator-name = "vdd-cpu";
2999 +};
3000 +
3001 +&reg_dcdc4 {
3002 + regulator-always-on;
3003 + regulator-min-microvolt = <700000>;
3004 + regulator-max-microvolt = <1320000>;
3005 + regulator-name = "vdd-sys-dll";
3006 +};
3007 +
3008 +&reg_dcdc5 {
3009 + regulator-always-on;
3010 + regulator-min-microvolt = <1500000>;
3011 + regulator-max-microvolt = <1500000>;
3012 + regulator-name = "vcc-dram";
3013 +};
3014 +
3015 +/* UART0 pads available on core board */
3016 +&uart0 {
3017 + pinctrl-names = "default";
3018 + pinctrl-0 = <&uart0_pins_a>;
3019 + status = "okay";
3020 +};
3021 +
3022 diff --git a/arch/arm/dts/sun6i-a31s-sina31s.dts b/arch/arm/dts/sun6i-a31s-sina31s.dts
3023 new file mode 100644
3024 index 0000000..6ead2f5
3025 --- /dev/null
3026 +++ b/arch/arm/dts/sun6i-a31s-sina31s.dts
3027 @@ -0,0 +1,153 @@
3028 +/*
3029 + * Copyright 2015 Chen-Yu Tsai <wens@csie.org>
3030 + *
3031 + * This file is dual-licensed: you can use it either under the terms
3032 + * of the GPL or the X11 license, at your option. Note that this dual
3033 + * licensing only applies to this file, and not this project as a
3034 + * whole.
3035 + *
3036 + * a) This file is free software; you can redistribute it and/or
3037 + * modify it under the terms of the GNU General Public License as
3038 + * published by the Free Software Foundation; either version 2 of the
3039 + * License, or (at your option) any later version.
3040 + *
3041 + * This file is distributed in the hope that it will be useful,
3042 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
3043 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3044 + * GNU General Public License for more details.
3045 + *
3046 + * Or, alternatively,
3047 + *
3048 + * b) Permission is hereby granted, free of charge, to any person
3049 + * obtaining a copy of this software and associated documentation
3050 + * files (the "Software"), to deal in the Software without
3051 + * restriction, including without limitation the rights to use,
3052 + * copy, modify, merge, publish, distribute, sublicense, and/or
3053 + * sell copies of the Software, and to permit persons to whom the
3054 + * Software is furnished to do so, subject to the following
3055 + * conditions:
3056 + *
3057 + * The above copyright notice and this permission notice shall be
3058 + * included in all copies or substantial portions of the Software.
3059 + *
3060 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
3061 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
3062 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
3063 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
3064 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
3065 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
3066 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
3067 + * OTHER DEALINGS IN THE SOFTWARE.
3068 + */
3069 +
3070 +/* The SinA31s development board has the SinA31s core board soldered on */
3071 +#include "sun6i-a31s-sina31s-core.dtsi"
3072 +
3073 +#include <dt-bindings/input/input.h>
3074 +
3075 +/ {
3076 + model = "Sinlinx SinA31s Development Board";
3077 + compatible = "sinlinx,sina31s-sdk", "allwinner,sun6i-a31s";
3078 +
3079 + chosen {
3080 + stdout-path = "serial0:115200n8";
3081 + };
3082 +
3083 + leds {
3084 + compatible = "gpio-leds";
3085 + pinctrl-names = "default";
3086 + pinctrl-0 = <&led_pin_sina31s>;
3087 +
3088 + status {
3089 + label = "sina31s:status:usr";
3090 + gpios = <&pio 7 13 GPIO_ACTIVE_HIGH>; /* PH13 */
3091 + };
3092 + };
3093 +};
3094 +
3095 +&ehci0 {
3096 + /* USB 2.0 4 port hub IC */
3097 + status = "okay";
3098 +};
3099 +
3100 +&ehci1 {
3101 + status = "okay";
3102 +};
3103 +
3104 +&gmac {
3105 + pinctrl-names = "default";
3106 + pinctrl-0 = <&gmac_pins_mii_a>;
3107 + phy = <&phy1>;
3108 + phy-mode = "mii";
3109 + phy-supply = <&reg_dldo1>;
3110 + status = "okay";
3111 +
3112 + phy1: ethernet-phy@1 {
3113 + reg = <1>;
3114 + };
3115 +};
3116 +
3117 +&ir {
3118 + pinctrl-names = "default";
3119 + pinctrl-0 = <&ir_pins_a>;
3120 + status = "okay";
3121 +};
3122 +
3123 +&lradc {
3124 + vref-supply = <&reg_aldo3>;
3125 + status = "okay";
3126 +
3127 + button@158 {
3128 + label = "Volume Up";
3129 + linux,code = <KEY_VOLUMEUP>;
3130 + channel = <0>;
3131 + voltage = <158730>;
3132 + };
3133 +
3134 + button@349 {
3135 + label = "Volume Down";
3136 + linux,code = <KEY_VOLUMEDOWN>;
3137 + channel = <0>;
3138 + voltage = <349206>;
3139 + };
3140 +};
3141 +
3142 +&mmc0 {
3143 + pinctrl-names = "default";
3144 + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_sina31s>;
3145 + vmmc-supply = <&reg_dcdc1>;
3146 + bus-width = <4>;
3147 + cd-gpios = <&pio 0 4 GPIO_ACTIVE_HIGH>; /* PA4 */
3148 + cd-inverted;
3149 + status = "okay";
3150 +};
3151 +
3152 +&ohci1 {
3153 + status = "okay";
3154 +};
3155 +
3156 +&pio {
3157 + led_pin_sina31s: led_pin@0 {
3158 + allwinner,pins = "PH13";
3159 + allwinner,function = "gpio_out";
3160 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
3161 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
3162 + };
3163 +
3164 + mmc0_cd_pin_sina31s: mmc0_cd_pin@0 {
3165 + allwinner,pins = "PA4";
3166 + allwinner,function = "gpio_in";
3167 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
3168 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
3169 + };
3170 +};
3171 +
3172 +&reg_dldo1 {
3173 + regulator-min-microvolt = <3300000>;
3174 + regulator-max-microvolt = <3300000>;
3175 + regulator-name = "vcc-gmac-phy";
3176 +};
3177 +
3178 +&usbphy {
3179 + status = "okay";
3180 +};
3181 diff --git a/arch/arm/dts/sun6i-a31s-yones-toptech-bs1078-v2.dts b/arch/arm/dts/sun6i-a31s-yones-toptech-bs1078-v2.dts
3182 new file mode 100644
3183 index 0000000..360adfb
3184 --- /dev/null
3185 +++ b/arch/arm/dts/sun6i-a31s-yones-toptech-bs1078-v2.dts
3186 @@ -0,0 +1,205 @@
3187 +/*
3188 + * Copyright 2015 Lawrence Yu <lyu@micile.com>
3189 + *
3190 + * This file is dual-licensed: you can use it either under the terms
3191 + * of the GPL or the X11 license, at your option. Note that this dual
3192 + * licensing only applies to this file, and not this project as a
3193 + * whole.
3194 + *
3195 + * a) This file is free software; you can redistribute it and/or
3196 + * modify it under the terms of the GNU General Public License as
3197 + * published by the Free Software Foundation; either version 2 of the
3198 + * License, or (at your option) any later version.
3199 + *
3200 + * This file is distributed in the hope that it will be useful,
3201 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
3202 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3203 + * GNU General Public License for more details.
3204 + *
3205 + * Or, alternatively,
3206 + *
3207 + * b) Permission is hereby granted, free of charge, to any person
3208 + * obtaining a copy of this software and associated documentation
3209 + * files (the "Software"), to deal in the Software without
3210 + * restriction, including without limitation the rights to use,
3211 + * copy, modify, merge, publish, distribute, sublicense, and/or
3212 + * sell copies of the Software, and to permit persons to whom the
3213 + * Software is furnished to do so, subject to the following
3214 + * conditions:
3215 + *
3216 + * The above copyright notice and this permission notice shall be
3217 + * included in all copies or substantial portions of the Software.
3218 + *
3219 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
3220 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
3221 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
3222 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
3223 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
3224 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
3225 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
3226 + * OTHER DEALINGS IN THE SOFTWARE.
3227 + */
3228 +
3229 +/dts-v1/;
3230 +#include "sun6i-a31s.dtsi"
3231 +#include "sunxi-common-regulators.dtsi"
3232 +
3233 +#include <dt-bindings/gpio/gpio.h>
3234 +#include <dt-bindings/pinctrl/sun4i-a10.h>
3235 +
3236 +/ {
3237 + model = "Yones TopTech BS1078 v2 Tablet";
3238 + compatible = "yones-toptech,bs1078-v2", "allwinner,sun6i-a31s";
3239 +
3240 + aliases {
3241 + serial0 = &uart0;
3242 + i2c1 = &i2c1;
3243 + i2c2 = &i2c2;
3244 + };
3245 +
3246 + chosen {
3247 + stdout-path = "serial0:115200n8";
3248 + };
3249 +};
3250 +
3251 +&i2c1 {
3252 + pinctrl-names = "default";
3253 + pinctrl-0 = <&i2c1_pins_a>;
3254 + status = "okay";
3255 +};
3256 +
3257 +&i2c2 {
3258 + pinctrl-names = "default";
3259 + pinctrl-0 = <&i2c2_pins_a>;
3260 + status = "okay";
3261 +};
3262 +
3263 +&ehci0 {
3264 + status = "okay";
3265 +};
3266 +
3267 +&ehci1 {
3268 + status = "okay";
3269 +};
3270 +
3271 +&ohci0 {
3272 + status = "okay";
3273 +};
3274 +
3275 +&ohci1 {
3276 + status = "okay";
3277 +};
3278 +
3279 +&pio {
3280 + mmc0_cd_pin_bs1078v2: mmc0_cd_pin@0 {
3281 + allwinner,pins = "PA8";
3282 + allwinner,function = "gpio_in";
3283 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
3284 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
3285 + };
3286 +};
3287 +
3288 +&mmc0 {
3289 + pinctrl-names = "default";
3290 + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bs1078v2>;
3291 + vmmc-supply = <&reg_vcc3v0>;
3292 + bus-width = <4>;
3293 + cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */
3294 + cd-inverted;
3295 + status = "okay";
3296 +};
3297 +
3298 +&mmc0_pins_a {
3299 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
3300 +};
3301 +
3302 +&p2wi {
3303 + status = "okay";
3304 +
3305 + axp22x: pmic@68 {
3306 + compatible = "x-powers,axp221";
3307 + reg = <0x68>;
3308 + interrupt-parent = <&nmi_intc>;
3309 + interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
3310 + };
3311 +};
3312 +
3313 +#include "axp22x.dtsi"
3314 +
3315 +&reg_aldo3 {
3316 + regulator-always-on;
3317 + regulator-min-microvolt = <2700000>;
3318 + regulator-max-microvolt = <3300000>;
3319 + regulator-name = "avcc";
3320 +};
3321 +
3322 +&reg_dc1sw {
3323 + regulator-name = "vcc-lcd-usb2";
3324 + regulator-min-microvolt = <3000000>;
3325 + regulator-max-microvolt = <3000000>;
3326 +};
3327 +
3328 +&reg_dc5ldo {
3329 + regulator-min-microvolt = <700000>;
3330 + regulator-max-microvolt = <1320000>;
3331 + regulator-name = "vdd-cpus";
3332 +};
3333 +
3334 +&reg_dcdc1 {
3335 + regulator-always-on;
3336 + regulator-min-microvolt = <3000000>;
3337 + regulator-max-microvolt = <3000000>;
3338 + regulator-name = "vcc-3v0";
3339 +};
3340 +
3341 +&reg_dcdc2 {
3342 + regulator-min-microvolt = <700000>;
3343 + regulator-max-microvolt = <1320000>;
3344 + regulator-name = "vdd-gpu";
3345 +};
3346 +
3347 +&reg_dcdc3 {
3348 + regulator-always-on;
3349 + regulator-min-microvolt = <700000>;
3350 + regulator-max-microvolt = <1320000>;
3351 + regulator-name = "vdd-cpu";
3352 +};
3353 +
3354 +&reg_dcdc4 {
3355 + regulator-always-on;
3356 + regulator-min-microvolt = <700000>;
3357 + regulator-max-microvolt = <1320000>;
3358 + regulator-name = "vdd-sys-dll";
3359 +};
3360 +
3361 +&reg_dcdc5 {
3362 + regulator-always-on;
3363 + regulator-min-microvolt = <1500000>;
3364 + regulator-max-microvolt = <1500000>;
3365 + regulator-name = "vcc-dram";
3366 +};
3367 +
3368 +&reg_dldo1 {
3369 + regulator-min-microvolt = <3300000>;
3370 + regulator-max-microvolt = <3300000>;
3371 + regulator-name = "vcc-wifi";
3372 +};
3373 +
3374 +/* Voltage source for I2C pullup resistors for I2C Bus 0 */
3375 +&reg_dldo3 {
3376 + regulator-min-microvolt = <2800000>;
3377 + regulator-max-microvolt = <2800000>;
3378 + regulator-name = "vddio-csi";
3379 +};
3380 +
3381 +&uart0 {
3382 + pinctrl-names = "default";
3383 + pinctrl-0 = <&uart0_pins_a>;
3384 + status = "okay";
3385 +};
3386 +
3387 +&usbphy {
3388 + usb1_vbus-supply = <&reg_dldo1>;
3389 + usb2_vbus-supply = <&reg_dc1sw>;
3390 + status = "okay";
3391 +};
3392 diff --git a/arch/arm/dts/sun7i-a20-bananapi.dts b/arch/arm/dts/sun7i-a20-bananapi.dts
3393 index 9f7b472..67c8a76 100644
3394 --- a/arch/arm/dts/sun7i-a20-bananapi.dts
3395 +++ b/arch/arm/dts/sun7i-a20-bananapi.dts
3396 @@ -92,6 +92,24 @@
3397 status = "okay";
3398 };
3399
3400 +&codec {
3401 + status = "okay";
3402 +};
3403 +
3404 +&cpu0 {
3405 + cpu-supply = <&reg_dcdc2>;
3406 + operating-points = <
3407 + /* kHz uV */
3408 + 960000 1400000
3409 + 912000 1400000
3410 + 864000 1350000
3411 + 720000 1250000
3412 + 528000 1150000
3413 + 312000 1100000
3414 + 144000 1050000
3415 + >;
3416 +};
3417 +
3418 &ehci0 {
3419 status = "okay";
3420 };
3421 @@ -119,13 +137,9 @@
3422 status = "okay";
3423
3424 axp209: pmic@34 {
3425 - compatible = "x-powers,axp209";
3426 reg = <0x34>;
3427 interrupt-parent = <&nmi_intc>;
3428 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
3429 -
3430 - interrupt-controller;
3431 - #interrupt-cells = <1>;
3432 };
3433 };
3434
3435 @@ -159,7 +173,18 @@
3436 status = "okay";
3437 };
3438
3439 +&otg_sram {
3440 + status = "okay";
3441 +};
3442 +
3443 &pio {
3444 + usb0_id_detect_pin: usb0_id_detect_pin@0 {
3445 + allwinner,pins = "PH4";
3446 + allwinner,function = "gpio_in";
3447 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
3448 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
3449 + };
3450 +
3451 mmc0_cd_pin_bananapi: mmc0_cd_pin@0 {
3452 allwinner,pins = "PH10";
3453 allwinner,function = "gpio_in";
3454 @@ -182,6 +207,37 @@
3455 };
3456 };
3457
3458 +#include "axp209.dtsi"
3459 +
3460 +&reg_dcdc2 {
3461 + regulator-always-on;
3462 + regulator-min-microvolt = <1000000>;
3463 + regulator-max-microvolt = <1400000>;
3464 + regulator-name = "vdd-cpu";
3465 +};
3466 +
3467 +&reg_dcdc3 {
3468 + regulator-always-on;
3469 + regulator-min-microvolt = <1000000>;
3470 + regulator-max-microvolt = <1400000>;
3471 + regulator-name = "vdd-int-dll";
3472 +};
3473 +
3474 +&reg_ldo1 {
3475 + regulator-name = "vdd-rtc";
3476 +};
3477 +
3478 +&reg_ldo2 {
3479 + regulator-always-on;
3480 + regulator-min-microvolt = <3000000>;
3481 + regulator-max-microvolt = <3000000>;
3482 + regulator-name = "avcc";
3483 +};
3484 +
3485 +&reg_usb0_vbus {
3486 + status = "okay";
3487 +};
3488 +
3489 &reg_usb1_vbus {
3490 status = "okay";
3491 };
3492 @@ -216,7 +272,21 @@
3493 status = "okay";
3494 };
3495
3496 +&usb_otg {
3497 + dr_mode = "otg";
3498 + status = "okay";
3499 +};
3500 +
3501 +&usb_power_supply {
3502 + status = "okay";
3503 +};
3504 +
3505 &usbphy {
3506 + pinctrl-names = "default";
3507 + pinctrl-0 = <&usb0_id_detect_pin>;
3508 + usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
3509 + usb0_vbus_power-supply = <&usb_power_supply>;
3510 + usb0_vbus-supply = <&reg_usb0_vbus>;
3511 usb1_vbus-supply = <&reg_usb1_vbus>;
3512 usb2_vbus-supply = <&reg_usb2_vbus>;
3513 status = "okay";
3514 diff --git a/arch/arm/dts/sun7i-a20-cubieboard2.dts b/arch/arm/dts/sun7i-a20-cubieboard2.dts
3515 index 39a51d5..1fa832d 100644
3516 --- a/arch/arm/dts/sun7i-a20-cubieboard2.dts
3517 +++ b/arch/arm/dts/sun7i-a20-cubieboard2.dts
3518 @@ -84,6 +84,10 @@
3519 status = "okay";
3520 };
3521
3522 +&codec {
3523 + status = "okay";
3524 +};
3525 +
3526 &cpu0 {
3527 cpu-supply = <&reg_dcdc2>;
3528 };
3529 @@ -150,6 +154,10 @@
3530 status = "okay";
3531 };
3532
3533 +&otg_sram {
3534 + status = "okay";
3535 +};
3536 +
3537 &pio {
3538 led_pins_cubieboard2: led_pins@0 {
3539 allwinner,pins = "PH20", "PH21";
3540 @@ -157,12 +165,24 @@
3541 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
3542 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
3543 };
3544 +
3545 + usb0_id_detect_pin: usb0_id_detect_pin@0 {
3546 + allwinner,pins = "PH4";
3547 + allwinner,function = "gpio_in";
3548 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
3549 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
3550 + };
3551 };
3552
3553 &reg_ahci_5v {
3554 status = "okay";
3555 };
3556
3557 +&usb_otg {
3558 + dr_mode = "otg";
3559 + status = "okay";
3560 +};
3561 +
3562 #include "axp209.dtsi"
3563
3564 &reg_dcdc2 {
3565 @@ -205,6 +225,9 @@
3566 };
3567
3568 &usbphy {
3569 + pinctrl-names = "default";
3570 + pinctrl-0 = <&usb0_id_detect_pin>;
3571 + usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
3572 usb1_vbus-supply = <&reg_usb1_vbus>;
3573 usb2_vbus-supply = <&reg_usb2_vbus>;
3574 status = "okay";
3575 diff --git a/arch/arm/dts/sun7i-a20-cubietruck.dts b/arch/arm/dts/sun7i-a20-cubietruck.dts
3576 index e6b0192..8da939a 100644
3577 --- a/arch/arm/dts/sun7i-a20-cubietruck.dts
3578 +++ b/arch/arm/dts/sun7i-a20-cubietruck.dts
3579 @@ -101,6 +101,10 @@
3580 status = "okay";
3581 };
3582
3583 +&codec {
3584 + status = "okay";
3585 +};
3586 +
3587 &cpu0 {
3588 cpu-supply = <&reg_dcdc2>;
3589 };
3590 diff --git a/arch/arm/dts/sun7i-a20-icnova-swac.dts b/arch/arm/dts/sun7i-a20-icnova-swac.dts
3591 new file mode 100644
3592 index 0000000..f5b5325
3593 --- /dev/null
3594 +++ b/arch/arm/dts/sun7i-a20-icnova-swac.dts
3595 @@ -0,0 +1,169 @@
3596 +/*
3597 + * Copyright 2015 Stefan Roese <sr@denx.de>
3598 + *
3599 + * This file is dual-licensed: you can use it either under the terms
3600 + * of the GPL or the X11 license, at your option. Note that this dual
3601 + * licensing only applies to this file, and not this project as a
3602 + * whole.
3603 + *
3604 + * a) This file is free software; you can redistribute it and/or
3605 + * modify it under the terms of the GNU General Public License as
3606 + * published by the Free Software Foundation; either version 2 of the
3607 + * License, or (at your option) any later version.
3608 + *
3609 + * This file is distributed in the hope that it will be useful,
3610 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
3611 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3612 + * GNU General Public License for more details.
3613 + *
3614 + * Or, alternatively,
3615 + *
3616 + * b) Permission is hereby granted, free of charge, to any person
3617 + * obtaining a copy of this software and associated documentation
3618 + * files (the "Software"), to deal in the Software without
3619 + * restriction, including without limitation the rights to use,
3620 + * copy, modify, merge, publish, distribute, sublicense, and/or
3621 + * sell copies of the Software, and to permit persons to whom the
3622 + * Software is furnished to do so, subject to the following
3623 + * conditions:
3624 + *
3625 + * The above copyright notice and this permission notice shall be
3626 + * included in all copies or substantial portions of the Software.
3627 + *
3628 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
3629 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
3630 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
3631 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
3632 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
3633 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
3634 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
3635 + * OTHER DEALINGS IN THE SOFTWARE.
3636 + */
3637 +
3638 +/dts-v1/;
3639 +#include "sun7i-a20.dtsi"
3640 +#include "sunxi-common-regulators.dtsi"
3641 +
3642 +#include <dt-bindings/gpio/gpio.h>
3643 +#include <dt-bindings/interrupt-controller/irq.h>
3644 +#include <dt-bindings/pinctrl/sun4i-a10.h>
3645 +
3646 +/ {
3647 + model = "ICnova-A20 SWAC";
3648 + compatible = "swac,icnova-a20-swac", "incircuit,icnova-a20", "allwinner,sun7i-a20";
3649 +
3650 + aliases {
3651 + serial0 = &uart0;
3652 + };
3653 +
3654 + chosen {
3655 + stdout-path = "serial0:115200n8";
3656 + };
3657 +};
3658 +
3659 +&cpu0 {
3660 + cpu-supply = <&reg_dcdc2>;
3661 +};
3662 +
3663 +&ehci0 {
3664 + status = "okay";
3665 +};
3666 +
3667 +&ehci1 {
3668 + status = "okay";
3669 +};
3670 +
3671 +&gmac {
3672 + pinctrl-names = "default";
3673 + pinctrl-0 = <&gmac_pins_mii_a>;
3674 + phy = <&phy1>;
3675 + phy-mode = "mii";
3676 + status = "okay";
3677 +
3678 + phy1: ethernet-phy@1 {
3679 + reg = <1>;
3680 + };
3681 +};
3682 +
3683 +&i2c0 {
3684 + pinctrl-names = "default";
3685 + pinctrl-0 = <&i2c0_pins_a>;
3686 + status = "okay";
3687 +
3688 + axp209: pmic@34 {
3689 + reg = <0x34>;
3690 + interrupt-parent = <&nmi_intc>;
3691 + interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
3692 + };
3693 +};
3694 +
3695 +&i2c1 {
3696 + pinctrl-names = "default";
3697 + pinctrl-0 = <&i2c1_pins_a>;
3698 + status = "okay";
3699 +};
3700 +
3701 +&mmc0 {
3702 + pinctrl-names = "default";
3703 + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
3704 + vmmc-supply = <&reg_vcc3v3>;
3705 + bus-width = <4>;
3706 + cd-gpios = <&pio 8 5 GPIO_ACTIVE_HIGH>; /* PI5 */
3707 + cd-inverted;
3708 + status = "okay";
3709 +};
3710 +
3711 +&ohci0 {
3712 + status = "okay";
3713 +};
3714 +
3715 +&ohci1 {
3716 + status = "okay";
3717 +};
3718 +
3719 +#include "axp209.dtsi"
3720 +
3721 +&reg_dcdc2 {
3722 + regulator-always-on;
3723 + regulator-min-microvolt = <1000000>;
3724 + regulator-max-microvolt = <1400000>;
3725 + regulator-name = "vdd-cpu";
3726 +};
3727 +
3728 +&reg_dcdc3 {
3729 + regulator-always-on;
3730 + regulator-min-microvolt = <1000000>;
3731 + regulator-max-microvolt = <1400000>;
3732 + regulator-name = "vdd-int-dll";
3733 +};
3734 +
3735 +&reg_ldo1 {
3736 + regulator-name = "vdd-rtc";
3737 +};
3738 +
3739 +&reg_ldo2 {
3740 + regulator-always-on;
3741 + regulator-min-microvolt = <3000000>;
3742 + regulator-max-microvolt = <3000000>;
3743 + regulator-name = "avcc";
3744 +};
3745 +
3746 +&reg_usb1_vbus {
3747 + status = "okay";
3748 +};
3749 +
3750 +&reg_usb2_vbus {
3751 + status = "okay";
3752 +};
3753 +
3754 +&uart0 {
3755 + pinctrl-names = "default";
3756 + pinctrl-0 = <&uart0_pins_a>;
3757 + status = "okay";
3758 +};
3759 +
3760 +&usbphy {
3761 + usb1_vbus-supply = <&reg_usb1_vbus>;
3762 + usb2_vbus-supply = <&reg_usb2_vbus>;
3763 + status = "okay";
3764 +};
3765 diff --git a/arch/arm/dts/sun7i-a20-itead-ibox.dts b/arch/arm/dts/sun7i-a20-itead-ibox.dts
3766 new file mode 100644
3767 index 0000000..661c21d
3768 --- /dev/null
3769 +++ b/arch/arm/dts/sun7i-a20-itead-ibox.dts
3770 @@ -0,0 +1,125 @@
3771 +/*
3772 + * Copyright 2015 - Marcus Cooper <codekipper@gmail.com>
3773 + *
3774 + * This file is dual-licensed: you can use it either under the terms
3775 + * of the GPL or the X11 license, at your option. Note that this dual
3776 + * licensing only applies to this file, and not this project as a
3777 + * whole.
3778 + *
3779 + * a) This file is free software; you can redistribute it and/or
3780 + * modify it under the terms of the GNU General Public License as
3781 + * published by the Free Software Foundation; either version 2 of the
3782 + * License, or (at your option) any later version.
3783 + *
3784 + * This file is distributed in the hope that it will be useful,
3785 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
3786 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3787 + * GNU General Public License for more details.
3788 + *
3789 + * Or, alternatively,
3790 + *
3791 + * b) Permission is hereby granted, free of charge, to any person
3792 + * obtaining a copy of this software and associated documentation
3793 + * files (the "Software"), to deal in the Software without
3794 + * restriction, including without limitation the rights to use,
3795 + * copy, modify, merge, publish, distribute, sublicense, and/or
3796 + * sell copies of the Software, and to permit persons to whom the
3797 + * Software is furnished to do so, subject to the following
3798 + * conditions:
3799 + *
3800 + * The above copyright notice and this permission notice shall be
3801 + * included in all copies or substantial portions of the Software.
3802 + *
3803 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
3804 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
3805 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
3806 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
3807 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
3808 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
3809 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
3810 + * OTHER DEALINGS IN THE SOFTWARE.
3811 + */
3812 +
3813 +/dts-v1/;
3814 +#include "sun7i-a20.dtsi"
3815 +#include "sunxi-itead-core-common.dtsi"
3816 +
3817 +/ {
3818 + model = "Itead Ibox A20";
3819 + compatible = "itead,itead-ibox-a20", "allwinner,sun7i-a20";
3820 +
3821 + leds {
3822 + compatible = "gpio-leds";
3823 + pinctrl-names = "default";
3824 + pinctrl-0 = <&led_pins_itead_core>;
3825 +
3826 + green {
3827 + label = "itead_core:green:usr";
3828 + gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>;
3829 + default-state = "on";
3830 + };
3831 +
3832 + blue {
3833 + label = "itead_core:blue:usr";
3834 + gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>;
3835 + default-state = "on";
3836 + };
3837 + };
3838 +};
3839 +
3840 +&ahci {
3841 + target-supply = <&reg_ahci_5v>;
3842 + status = "okay";
3843 +};
3844 +
3845 +&codec {
3846 + status = "okay";
3847 +};
3848 +
3849 +&gmac {
3850 + pinctrl-names = "default";
3851 + pinctrl-0 = <&gmac_pins_mii_a>;
3852 + phy = <&phy1>;
3853 + phy-mode = "mii";
3854 + status = "okay";
3855 +
3856 + phy1: ethernet-phy@1 {
3857 + reg = <1>;
3858 + };
3859 +};
3860 +
3861 +&i2c0 {
3862 + axp209: pmic@34 {
3863 + interrupt-parent = <&nmi_intc>;
3864 + interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
3865 + };
3866 +};
3867 +
3868 +&ir0 {
3869 + pinctrl-names = "default";
3870 + pinctrl-0 = <&ir0_rx_pins_a>;
3871 + status = "okay";
3872 +};
3873 +
3874 +&mmc0 {
3875 + pinctrl-names = "default";
3876 + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
3877 + vmmc-supply = <&reg_vcc3v3>;
3878 + bus-width = <4>;
3879 + cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
3880 + cd-inverted;
3881 + status = "okay";
3882 +};
3883 +
3884 +&pio {
3885 + led_pins_itead_core: led_pins@0 {
3886 + allwinner,pins = "PH20","PH21";
3887 + allwinner,function = "gpio_out";
3888 + allwinner,drive = <SUN4I_PINCTRL_20_MA>;
3889 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
3890 + };
3891 +};
3892 +
3893 +&reg_ahci_5v {
3894 + status = "okay";
3895 +};
3896 diff --git a/arch/arm/dts/sun7i-a20-lamobo-r1.dts b/arch/arm/dts/sun7i-a20-lamobo-r1.dts
3897 index 975b0b2..5ee43d8 100644
3898 --- a/arch/arm/dts/sun7i-a20-lamobo-r1.dts
3899 +++ b/arch/arm/dts/sun7i-a20-lamobo-r1.dts
3900 @@ -97,16 +97,6 @@
3901
3902 &cpu0 {
3903 cpu-supply = <&reg_dcdc2>;
3904 - operating-points = <
3905 - /* kHz uV */
3906 - 960000 1400000
3907 - 912000 1400000
3908 - 864000 1350000
3909 - 720000 1250000
3910 - 528000 1150000
3911 - 312000 1100000
3912 - 144000 1050000
3913 - >;
3914 };
3915
3916 &ehci0 {
3917 diff --git a/arch/arm/dts/sun7i-a20-mk808c.dts b/arch/arm/dts/sun7i-a20-mk808c.dts
3918 index 4f432f8..90ff4a2 100644
3919 --- a/arch/arm/dts/sun7i-a20-mk808c.dts
3920 +++ b/arch/arm/dts/sun7i-a20-mk808c.dts
3921 @@ -53,6 +53,7 @@
3922
3923 #include <dt-bindings/gpio/gpio.h>
3924 #include <dt-bindings/interrupt-controller/irq.h>
3925 +#include <dt-bindings/pinctrl/sun4i-a10.h>
3926
3927 / {
3928 model = "mk808c";
3929 @@ -68,6 +69,10 @@
3930 };
3931 };
3932
3933 +&codec {
3934 + status = "okay";
3935 +};
3936 +
3937 &ehci0 {
3938 status = "okay";
3939 };
3940 @@ -121,6 +126,30 @@
3941 status = "okay";
3942 };
3943
3944 +&otg_sram {
3945 + status = "okay";
3946 +};
3947 +
3948 +&pio {
3949 + usb0_id_detect_pin: usb0_id_detect_pin@0 {
3950 + allwinner,pins = "PH4";
3951 + allwinner,function = "gpio_in";
3952 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
3953 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
3954 + };
3955 +
3956 + usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
3957 + allwinner,pins = "PH5";
3958 + allwinner,function = "gpio_in";
3959 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
3960 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
3961 + };
3962 +};
3963 +
3964 +&reg_usb0_vbus {
3965 + status = "okay";
3966 +};
3967 +
3968 &reg_usb1_vbus {
3969 status = "okay";
3970 };
3971 @@ -141,7 +170,17 @@
3972 status = "okay";
3973 };
3974
3975 +&usb_otg {
3976 + dr_mode = "otg";
3977 + status = "okay";
3978 +};
3979 +
3980 &usbphy {
3981 + pinctrl-names = "default";
3982 + pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
3983 + usb0_id_det-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
3984 + usb0_vbus_det-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
3985 + usb0_vbus-supply = <&reg_usb0_vbus>;
3986 usb1_vbus-supply = <&reg_usb1_vbus>;
3987 usb2_vbus-supply = <&reg_usb2_vbus>;
3988 status = "okay";
3989 diff --git a/arch/arm/dts/sun7i-a20-olimex-som-evb.dts b/arch/arm/dts/sun7i-a20-olimex-som-evb.dts
3990 index 6904dbd..23aacce 100644
3991 --- a/arch/arm/dts/sun7i-a20-olimex-som-evb.dts
3992 +++ b/arch/arm/dts/sun7i-a20-olimex-som-evb.dts
3993 @@ -1,5 +1,6 @@
3994 /*
3995 * Copyright 2015 - Marcus Cooper <codekipper@gmail.com>
3996 + * Copyright 2015 - Karsten Merker <merker@debian.org>
3997 *
3998 * This file is dual-licensed: you can use it either under the terms
3999 * of the GPL or the X11 license, at your option. Note that this dual
4000 @@ -45,6 +46,7 @@
4001 #include "sunxi-common-regulators.dtsi"
4002
4003 #include <dt-bindings/gpio/gpio.h>
4004 +#include <dt-bindings/input/input.h>
4005 #include <dt-bindings/interrupt-controller/irq.h>
4006 #include <dt-bindings/pinctrl/sun4i-a10.h>
4007
4008 @@ -71,14 +73,6 @@
4009 default-state = "on";
4010 };
4011 };
4012 -
4013 - reg_axp_ipsout: axp_ipsout {
4014 - compatible = "regulator-fixed";
4015 - regulator-name = "axp-ipsout";
4016 - regulator-min-microvolt = <5000000>;
4017 - regulator-max-microvolt = <5000000>;
4018 - regulator-always-on;
4019 - };
4020 };
4021
4022 &ahci {
4023 @@ -94,6 +88,10 @@
4024 status = "okay";
4025 };
4026
4027 +&codec {
4028 + status = "okay";
4029 +};
4030 +
4031 &gmac {
4032 pinctrl-names = "default";
4033 pinctrl-0 = <&gmac_pins_rgmii_a>;
4034 @@ -118,10 +116,58 @@
4035 };
4036 };
4037
4038 -&i2c1 {
4039 - pinctrl-names = "default";
4040 - pinctrl-0 = <&i2c1_pins_a>;
4041 +&lradc {
4042 + vref-supply = <&reg_vcc3v0>;
4043 status = "okay";
4044 +
4045 + button@190 {
4046 + label = "Volume Up";
4047 + linux,code = <KEY_VOLUMEUP>;
4048 + channel = <0>;
4049 + voltage = <190000>;