package: uboot-sunxi: various changes - bump to 2016.03 - add bugfixes related to...
[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>;
4050 + };
4051 +
4052 + button@390 {
4053 + label = "Volume Down";
4054 + linux,code = <KEY_VOLUMEDOWN>;
4055 + channel = <0>;
4056 + voltage = <390000>;
4057 + };
4058 +
4059 + button@600 {
4060 + label = "Menu";
4061 + linux,code = <KEY_MENU>;
4062 + channel = <0>;
4063 + voltage = <600000>;
4064 + };
4065 +
4066 + button@800 {
4067 + label = "Search";
4068 + linux,code = <KEY_SEARCH>;
4069 + channel = <0>;
4070 + voltage = <800000>;
4071 + };
4072 +
4073 + button@980 {
4074 + label = "Home";
4075 + linux,code = <KEY_HOMEPAGE>;
4076 + channel = <0>;
4077 + voltage = <980000>;
4078 + };
4079 +
4080 + button@1180 {
4081 + label = "Esc";
4082 + linux,code = <KEY_ESC>;
4083 + channel = <0>;
4084 + voltage = <1180000>;
4085 + };
4086 +
4087 + button@1400 {
4088 + label = "Enter";
4089 + linux,code = <KEY_ENTER>;
4090 + channel = <0>;
4091 + voltage = <1400000>;
4092 + };
4093 };
4094
4095 &mmc0 {
4096 @@ -134,6 +180,16 @@
4097 status = "okay";
4098 };
4099
4100 +&mmc3 {
4101 + pinctrl-names = "default";
4102 + pinctrl-0 = <&mmc3_pins_a>, <&mmc3_cd_pin_olimex_som_evb>;
4103 + vmmc-supply = <&reg_vcc3v3>;
4104 + bus-width = <4>;
4105 + cd-gpios = <&pio 7 0 GPIO_ACTIVE_HIGH>; /* PH0 */
4106 + cd-inverted;
4107 + status = "okay";
4108 +};
4109 +
4110 &ohci0 {
4111 status = "okay";
4112 };
4113 @@ -161,15 +217,22 @@
4114 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
4115 };
4116
4117 + mmc3_cd_pin_olimex_som_evb: mmc3_cd_pin@0 {
4118 + allwinner,pins = "PH0";
4119 + allwinner,function = "gpio_in";
4120 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4121 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
4122 + };
4123 +
4124 usb0_id_detect_pin: usb0_id_detect_pin@0 {
4125 - allwinner,pins = "PH04";
4126 + allwinner,pins = "PH4";
4127 allwinner,function = "gpio_in";
4128 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4129 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
4130 };
4131
4132 usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
4133 - allwinner,pins = "PH05";
4134 + allwinner,pins = "PH5";
4135 allwinner,function = "gpio_in";
4136 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4137 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
4138 @@ -187,7 +250,7 @@
4139 &reg_dcdc2 {
4140 regulator-always-on;
4141 regulator-min-microvolt = <1000000>;
4142 - regulator-max-microvolt = <1425000>;
4143 + regulator-max-microvolt = <1400000>;
4144 regulator-name = "vdd-cpu";
4145 };
4146
4147 @@ -235,8 +298,8 @@
4148 &usbphy {
4149 pinctrl-names = "default";
4150 pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
4151 - usb0_id_det-gpios = <&pio 7 04 GPIO_ACTIVE_HIGH>; /* PH04 */
4152 - usb0_vbus_det-gpios = <&pio 7 05 GPIO_ACTIVE_HIGH>; /* PH05 */
4153 + usb0_id_det-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH04 */
4154 + usb0_vbus_det-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH05 */
4155 usb0_vbus-supply = <&reg_usb0_vbus>;
4156 usb1_vbus-supply = <&reg_usb1_vbus>;
4157 usb2_vbus-supply = <&reg_usb2_vbus>;
4158 diff --git a/arch/arm/dts/sun7i-a20-olinuxino-lime.dts b/arch/arm/dts/sun7i-a20-olinuxino-lime.dts
4159 index 0423708..35ad700 100644
4160 --- a/arch/arm/dts/sun7i-a20-olinuxino-lime.dts
4161 +++ b/arch/arm/dts/sun7i-a20-olinuxino-lime.dts
4162 @@ -117,6 +117,18 @@
4163 };
4164 };
4165
4166 +&i2c1 {
4167 + pinctrl-names = "default";
4168 + pinctrl-0 = <&i2c1_pins_a>;
4169 + status = "okay";
4170 +
4171 + eeprom: eeprom@50 {
4172 + compatible = "atmel,24c16";
4173 + reg = <0x50>;
4174 + pagesize = <16>;
4175 + };
4176 +};
4177 +
4178 &mmc0 {
4179 pinctrl-names = "default";
4180 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
4181 diff --git a/arch/arm/dts/sun7i-a20-olinuxino-lime2.dts b/arch/arm/dts/sun7i-a20-olinuxino-lime2.dts
4182 index 8acff78..d5c796c 100644
4183 --- a/arch/arm/dts/sun7i-a20-olinuxino-lime2.dts
4184 +++ b/arch/arm/dts/sun7i-a20-olinuxino-lime2.dts
4185 @@ -170,6 +170,12 @@
4186 pinctrl-names = "default";
4187 pinctrl-0 = <&i2c1_pins_a>;
4188 status = "okay";
4189 +
4190 + eeprom: eeprom@50 {
4191 + compatible = "atmel,24c16";
4192 + reg = <0x50>;
4193 + pagesize = <16>;
4194 + };
4195 };
4196
4197 &mmc0 {
4198 @@ -190,6 +196,10 @@
4199 status = "okay";
4200 };
4201
4202 +&otg_sram {
4203 + status = "okay";
4204 +};
4205 +
4206 &pio {
4207 ahci_pwr_pin_olinuxinolime: ahci_pwr_pin@1 {
4208 allwinner,pins = "PC3";
4209 @@ -204,6 +214,27 @@
4210 allwinner,drive = <SUN4I_PINCTRL_20_MA>;
4211 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
4212 };
4213 +
4214 + usb0_id_detect_pin: usb0_id_detect_pin@0 {
4215 + allwinner,pins = "PH4";
4216 + allwinner,function = "gpio_in";
4217 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4218 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
4219 + };
4220 +
4221 + usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
4222 + allwinner,pins = "PH5";
4223 + allwinner,function = "gpio_in";
4224 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4225 + allwinner,pull = <SUN4I_PINCTRL_PULL_DOWN>;
4226 + };
4227 +
4228 + usb0_vbus_pin_lime2: usb0_vbus_pin@0 {
4229 + allwinner,pins = "PC17";
4230 + allwinner,function = "gpio_out";
4231 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4232 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
4233 + };
4234 };
4235
4236 &reg_ahci_5v {
4237 @@ -212,6 +243,12 @@
4238 status = "okay";
4239 };
4240
4241 +&reg_usb0_vbus {
4242 + pinctrl-0 = <&usb0_vbus_pin_lime2>;
4243 + gpio = <&pio 2 17 GPIO_ACTIVE_HIGH>;
4244 + status = "okay";
4245 +};
4246 +
4247 &reg_usb1_vbus {
4248 status = "okay";
4249 };
4250 @@ -226,7 +263,17 @@
4251 status = "okay";
4252 };
4253
4254 +&usb_otg {
4255 + dr_mode = "otg";
4256 + status = "okay";
4257 +};
4258 +
4259 &usbphy {
4260 + pinctrl-names = "default";
4261 + pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
4262 + usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
4263 + usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
4264 + usb0_vbus-supply = <&reg_usb0_vbus>;
4265 usb1_vbus-supply = <&reg_usb1_vbus>;
4266 usb2_vbus-supply = <&reg_usb2_vbus>;
4267 status = "okay";
4268 diff --git a/arch/arm/dts/sun7i-a20-olinuxino-micro.dts b/arch/arm/dts/sun7i-a20-olinuxino-micro.dts
4269 index c5d70ca..7e3006f 100644
4270 --- a/arch/arm/dts/sun7i-a20-olinuxino-micro.dts
4271 +++ b/arch/arm/dts/sun7i-a20-olinuxino-micro.dts
4272 @@ -125,6 +125,12 @@
4273 pinctrl-names = "default";
4274 pinctrl-0 = <&i2c1_pins_a>;
4275 status = "okay";
4276 +
4277 + eeprom: eeprom@50 {
4278 + compatible = "atmel,24c16";
4279 + reg = <0x50>;
4280 + pagesize = <16>;
4281 + };
4282 };
4283
4284 &i2c2 {
4285 diff --git a/arch/arm/dts/sun7i-a20-orangepi-mini.dts b/arch/arm/dts/sun7i-a20-orangepi-mini.dts
4286 index 73cd81e..2be04c4 100644
4287 --- a/arch/arm/dts/sun7i-a20-orangepi-mini.dts
4288 +++ b/arch/arm/dts/sun7i-a20-orangepi-mini.dts
4289 @@ -95,6 +95,10 @@
4290 status = "okay";
4291 };
4292
4293 +&codec {
4294 + status = "okay";
4295 +};
4296 +
4297 &ehci0 {
4298 status = "okay";
4299 };
4300 @@ -156,7 +160,18 @@
4301 status = "okay";
4302 };
4303
4304 +&otg_sram {
4305 + status = "okay";
4306 +};
4307 +
4308 &pio {
4309 + usb0_id_detect_pin: usb0_id_detect_pin@0 {
4310 + allwinner,pins = "PH4";
4311 + allwinner,function = "gpio_in";
4312 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4313 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
4314 + };
4315 +
4316 mmc0_cd_pin_orangepi: mmc0_cd_pin@0 {
4317 allwinner,pins = "PH10";
4318 allwinner,function = "gpio_in";
4319 @@ -225,6 +240,10 @@
4320 regulator-name = "avcc";
4321 };
4322
4323 +&reg_usb0_vbus {
4324 + status = "okay";
4325 +};
4326 +
4327 &reg_usb1_vbus {
4328 pinctrl-0 = <&usb1_vbus_pin_bananapro>;
4329 gpio = <&pio 7 26 GPIO_ACTIVE_HIGH>; /* PH26 */
4330 @@ -243,7 +262,21 @@
4331 status = "okay";
4332 };
4333
4334 +&usb_otg {
4335 + dr_mode = "otg";
4336 + status = "okay";
4337 +};
4338 +
4339 +&usb_power_supply {
4340 + status = "okay";
4341 +};
4342 +
4343 &usbphy {
4344 + pinctrl-names = "default";
4345 + pinctrl-0 = <&usb0_id_detect_pin>;
4346 + usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
4347 + usb0_vbus_power-supply = <&usb_power_supply>;
4348 + usb0_vbus-supply = <&reg_usb0_vbus>;
4349 usb1_vbus-supply = <&reg_usb1_vbus>;
4350 usb2_vbus-supply = <&reg_usb2_vbus>;
4351 status = "okay";
4352 diff --git a/arch/arm/dts/sun7i-a20-orangepi.dts b/arch/arm/dts/sun7i-a20-orangepi.dts
4353 index 55a06ce..71125bf 100644
4354 --- a/arch/arm/dts/sun7i-a20-orangepi.dts
4355 +++ b/arch/arm/dts/sun7i-a20-orangepi.dts
4356 @@ -141,7 +141,18 @@
4357 status = "okay";
4358 };
4359
4360 +&otg_sram {
4361 + status = "okay";
4362 +};
4363 +
4364 &pio {
4365 + usb0_id_detect_pin: usb0_id_detect_pin@0 {
4366 + allwinner,pins = "PH4";
4367 + allwinner,function = "gpio_in";
4368 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4369 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
4370 + };
4371 +
4372 mmc0_cd_pin_orangepi: mmc0_cd_pin@0 {
4373 allwinner,pins = "PH10";
4374 allwinner,function = "gpio_in";
4375 @@ -203,6 +214,10 @@
4376 regulator-name = "avcc";
4377 };
4378
4379 +&reg_usb0_vbus {
4380 + status = "okay";
4381 +};
4382 +
4383 &reg_usb1_vbus {
4384 pinctrl-0 = <&usb1_vbus_pin_bananapro>;
4385 gpio = <&pio 7 26 GPIO_ACTIVE_HIGH>; /* PH26 */
4386 @@ -221,7 +236,21 @@
4387 status = "okay";
4388 };
4389
4390 +&usb_otg {
4391 + dr_mode = "otg";
4392 + status = "okay";
4393 +};
4394 +
4395 +&usb_power_supply {
4396 + status = "okay";
4397 +};
4398 +
4399 &usbphy {
4400 + pinctrl-names = "default";
4401 + pinctrl-0 = <&usb0_id_detect_pin>;
4402 + usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
4403 + usb0_vbus_power-supply = <&usb_power_supply>;
4404 + usb0_vbus-supply = <&reg_usb0_vbus>;
4405 usb1_vbus-supply = <&reg_usb1_vbus>;
4406 usb2_vbus-supply = <&reg_usb2_vbus>;
4407 status = "okay";
4408 diff --git a/arch/arm/dts/sun7i-a20-pcduino3-nano.dts b/arch/arm/dts/sun7i-a20-pcduino3-nano.dts
4409 index 5361fce..ddac732 100644
4410 --- a/arch/arm/dts/sun7i-a20-pcduino3-nano.dts
4411 +++ b/arch/arm/dts/sun7i-a20-pcduino3-nano.dts
4412 @@ -82,6 +82,14 @@
4413 status = "okay";
4414 };
4415
4416 +&codec {
4417 + status = "okay";
4418 +};
4419 +
4420 +&cpu0 {
4421 + cpu-supply = <&reg_dcdc2>;
4422 +};
4423 +
4424 &ehci0 {
4425 status = "okay";
4426 };
4427 @@ -108,13 +116,9 @@
4428 status = "okay";
4429
4430 axp209: pmic@34 {
4431 - compatible = "x-powers,axp209";
4432 reg = <0x34>;
4433 interrupt-parent = <&nmi_intc>;
4434 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
4435 -
4436 - interrupt-controller;
4437 - #interrupt-cells = <1>;
4438 };
4439 };
4440
4441 @@ -142,6 +146,10 @@
4442 status = "okay";
4443 };
4444
4445 +&otg_sram {
4446 + status = "okay";
4447 +};
4448 +
4449 &pio {
4450 ahci_pwr_pin_pcduino3_nano: ahci_pwr_pin@0 {
4451 allwinner,pins = "PH2";
4452 @@ -157,8 +165,15 @@
4453 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
4454 };
4455
4456 + usb0_id_detect_pin: usb0_id_detect_pin@0 {
4457 + allwinner,pins = "PH4";
4458 + allwinner,function = "gpio_in";
4459 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4460 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
4461 + };
4462 +
4463 usb1_vbus_pin_pcduino3_nano: usb1_vbus_pin@0 {
4464 - allwinner,pins = "PH11";
4465 + allwinner,pins = "PD2";
4466 allwinner,function = "gpio_out";
4467 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4468 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
4469 @@ -171,13 +186,37 @@
4470 status = "okay";
4471 };
4472
4473 -&reg_usb1_vbus {
4474 - pinctrl-0 = <&usb1_vbus_pin_pcduino3_nano>;
4475 - gpio = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */
4476 - status = "okay";
4477 +#include "axp209.dtsi"
4478 +
4479 +&reg_dcdc2 {
4480 + regulator-always-on;
4481 + regulator-min-microvolt = <1000000>;
4482 + regulator-max-microvolt = <1400000>;
4483 + regulator-name = "vdd-cpu";
4484 +};
4485 +
4486 +&reg_dcdc3 {
4487 + regulator-always-on;
4488 + regulator-min-microvolt = <1000000>;
4489 + regulator-max-microvolt = <1400000>;
4490 + regulator-name = "vdd-int-pll";
4491 +};
4492 +
4493 +&reg_ldo1 {
4494 + regulator-name = "vdd-rtc";
4495 +};
4496 +
4497 +&reg_ldo2 {
4498 + regulator-always-on;
4499 + regulator-min-microvolt = <3000000>;
4500 + regulator-max-microvolt = <3000000>;
4501 + regulator-name = "avcc";
4502 };
4503
4504 -&reg_usb2_vbus {
4505 +/* A single regulator (U24) powers both USB host ports. */
4506 +&reg_usb1_vbus {
4507 + pinctrl-0 = <&usb1_vbus_pin_pcduino3_nano>;
4508 + gpio = <&pio 3 2 GPIO_ACTIVE_HIGH>; /* PD2 */
4509 status = "okay";
4510 };
4511
4512 @@ -187,8 +226,16 @@
4513 status = "okay";
4514 };
4515
4516 +&usb_otg {
4517 + dr_mode = "otg";
4518 + status = "okay";
4519 +};
4520 +
4521 &usbphy {
4522 + pinctrl-names = "default";
4523 + pinctrl-0 = <&usb0_id_detect_pin>;
4524 + usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
4525 usb1_vbus-supply = <&reg_usb1_vbus>;
4526 - usb2_vbus-supply = <&reg_usb2_vbus>;
4527 + usb2_vbus-supply = <&reg_usb1_vbus>;
4528 status = "okay";
4529 };
4530 diff --git a/arch/arm/dts/sun7i-a20-pcduino3.dts b/arch/arm/dts/sun7i-a20-pcduino3.dts
4531 index afc9ece..1a8b39b 100644
4532 --- a/arch/arm/dts/sun7i-a20-pcduino3.dts
4533 +++ b/arch/arm/dts/sun7i-a20-pcduino3.dts
4534 @@ -111,6 +111,14 @@
4535 allwinner,pins = "PH2";
4536 };
4537
4538 +&codec {
4539 + status = "okay";
4540 +};
4541 +
4542 +&cpu0 {
4543 + cpu-supply = <&reg_dcdc2>;
4544 +};
4545 +
4546 &ehci0 {
4547 status = "okay";
4548 };
4549 @@ -137,16 +145,14 @@
4550 status = "okay";
4551
4552 axp209: pmic@34 {
4553 - compatible = "x-powers,axp209";
4554 reg = <0x34>;
4555 interrupt-parent = <&nmi_intc>;
4556 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
4557 -
4558 - interrupt-controller;
4559 - #interrupt-cells = <1>;
4560 };
4561 };
4562
4563 +#include "axp209.dtsi"
4564 +
4565 &ir0 {
4566 pinctrl-names = "default";
4567 pinctrl-0 = <&ir0_rx_pins_a>;
4568 @@ -171,6 +177,10 @@
4569 status = "okay";
4570 };
4571
4572 +&otg_sram {
4573 + status = "okay";
4574 +};
4575 +
4576 &pio {
4577 led_pins_pcduino3: led_pins@0 {
4578 allwinner,pins = "PH15", "PH16";
4579 @@ -185,6 +195,13 @@
4580 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4581 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
4582 };
4583 +
4584 + usb0_id_detect_pin: usb0_id_detect_pin@0 {
4585 + allwinner,pins = "PH4";
4586 + allwinner,function = "gpio_in";
4587 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4588 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
4589 + };
4590 };
4591
4592 &reg_ahci_5v {
4593 @@ -192,6 +209,31 @@
4594 status = "okay";
4595 };
4596
4597 +&reg_dcdc2 {
4598 + regulator-always-on;
4599 + regulator-min-microvolt = <1000000>;
4600 + regulator-max-microvolt = <1400000>;
4601 + regulator-name = "vdd-cpu";
4602 +};
4603 +
4604 +&reg_dcdc3 {
4605 + regulator-always-on;
4606 + regulator-min-microvolt = <1000000>;
4607 + regulator-max-microvolt = <1400000>;
4608 + regulator-name = "vdd-int-pll";
4609 +};
4610 +
4611 +&reg_ldo1 {
4612 + regulator-name = "vdd-rtc";
4613 +};
4614 +
4615 +&reg_ldo2 {
4616 + regulator-always-on;
4617 + regulator-min-microvolt = <3000000>;
4618 + regulator-max-microvolt = <3000000>;
4619 + regulator-name = "avcc";
4620 +};
4621 +
4622 &reg_usb1_vbus {
4623 status = "okay";
4624 };
4625 @@ -206,7 +248,15 @@
4626 status = "okay";
4627 };
4628
4629 +&usb_otg {
4630 + dr_mode = "otg";
4631 + status = "okay";
4632 +};
4633 +
4634 &usbphy {
4635 + pinctrl-names = "default";
4636 + pinctrl-0 = <&usb0_id_detect_pin>;
4637 + usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
4638 usb1_vbus-supply = <&reg_usb1_vbus>;
4639 usb2_vbus-supply = <&reg_usb2_vbus>;
4640 status = "okay";
4641 diff --git a/arch/arm/dts/sun7i-a20-wexler-tab7200.dts b/arch/arm/dts/sun7i-a20-wexler-tab7200.dts
4642 index 83c6d3f..2f6b21a 100644
4643 --- a/arch/arm/dts/sun7i-a20-wexler-tab7200.dts
4644 +++ b/arch/arm/dts/sun7i-a20-wexler-tab7200.dts
4645 @@ -48,6 +48,7 @@
4646 #include <dt-bindings/gpio/gpio.h>
4647 #include <dt-bindings/input/input.h>
4648 #include <dt-bindings/interrupt-controller/irq.h>
4649 +#include <dt-bindings/pwm/pwm.h>
4650
4651 / {
4652 model = "Wexler TAB7200";
4653 @@ -57,11 +58,28 @@
4654 serial0 = &uart0;
4655 };
4656
4657 + backlight {
4658 + compatible = "pwm-backlight";
4659 + pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
4660 + brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
4661 + default-brightness-level = <8>;
4662 + pinctrl-names = "default";
4663 + pinctrl-0 = <&bl_enable_pin>;
4664 + enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */
4665 + };
4666 +
4667 chosen {
4668 stdout-path = "serial0:115200n8";
4669 };
4670 };
4671
4672 +&codec {
4673 + pinctrl-names = "default";
4674 + pinctrl-0 = <&codec_pa_pin>;
4675 + allwinner,pa-gpios = <&pio 7 15 GPIO_ACTIVE_HIGH>; /* PH15 */
4676 + status = "okay";
4677 +};
4678 +
4679 &cpu0 {
4680 cpu-supply = <&reg_dcdc2>;
4681 };
4682 @@ -86,6 +104,8 @@
4683 };
4684 };
4685
4686 +#include "axp209.dtsi"
4687 +
4688 &i2c1 {
4689 pinctrl-names = "default";
4690 pinctrl-0 = <&i2c1_pins_a>;
4691 @@ -96,6 +116,18 @@
4692 pinctrl-names = "default";
4693 pinctrl-0 = <&i2c2_pins_a>;
4694 status = "okay";
4695 +
4696 + gt911: touchscreen@5d {
4697 + compatible = "goodix,gt911";
4698 + reg = <0x5d>;
4699 + interrupt-parent = <&pio>;
4700 + interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; /* EINT21 (PH21) */
4701 + pinctrl-names = "default";
4702 + pinctrl-0 = <&ts_reset_pin>;
4703 + irq-gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>; /* INT (PH21) */
4704 + reset-gpios = <&pio 1 13 GPIO_ACTIVE_HIGH>; /* RST (PB13) */
4705 + touchscreen-swapped-x-y;
4706 + };
4707 };
4708
4709 &lradc {
4710 @@ -135,7 +167,45 @@
4711 status = "okay";
4712 };
4713
4714 -#include "axp209.dtsi"
4715 +&otg_sram {
4716 + status = "okay";
4717 +};
4718 +
4719 +&pio {
4720 + bl_enable_pin: bl_enable_pin@0 {
4721 + allwinner,pins = "PH7";
4722 + allwinner,function = "gpio_out";
4723 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4724 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
4725 + };
4726 +
4727 + codec_pa_pin: codec_pa_pin@0 {
4728 + allwinner,pins = "PH15";
4729 + allwinner,function = "gpio_out";
4730 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4731 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
4732 + };
4733 +
4734 + ts_reset_pin: ts_reset_pin@0 {
4735 + allwinner,pins = "PB13";
4736 + allwinner,function = "gpio_out";
4737 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4738 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
4739 + };
4740 +
4741 + usb0_id_detect_pin: usb0_id_detect_pin@0 {
4742 + allwinner,pins = "PH4";
4743 + allwinner,function = "gpio_in";
4744 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4745 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
4746 + };
4747 +};
4748 +
4749 +&pwm {
4750 + pinctrl-names = "default";
4751 + pinctrl-0 = <&pwm0_pins_a>;
4752 + status = "okay";
4753 +};
4754
4755 &reg_dcdc2 {
4756 regulator-always-on;
4757 @@ -162,6 +232,10 @@
4758 regulator-name = "avcc";
4759 };
4760
4761 +&reg_usb0_vbus {
4762 + status = "okay";
4763 +};
4764 +
4765 &reg_usb1_vbus {
4766 status = "okay";
4767 };
4768 @@ -176,7 +250,21 @@
4769 status = "okay";
4770 };
4771
4772 +&usb_otg {
4773 + dr_mode = "otg";
4774 + status = "okay";
4775 +};
4776 +
4777 +&usb_power_supply {
4778 + status = "okay";
4779 +};
4780 +
4781 &usbphy {
4782 + pinctrl-names = "default";
4783 + pinctrl-0 = <&usb0_id_detect_pin>;
4784 + usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
4785 + usb0_vbus_power-supply = <&usb_power_supply>;
4786 + usb0_vbus-supply = <&reg_usb0_vbus>;
4787 usb1_vbus-supply = <&reg_usb1_vbus>;
4788 usb2_vbus-supply = <&reg_usb2_vbus>;
4789 status = "okay";
4790 diff --git a/arch/arm/dts/sun7i-a20-wits-pro-a20-dkt.dts b/arch/arm/dts/sun7i-a20-wits-pro-a20-dkt.dts
4791 index e7d84fe..dc31d47 100644
4792 --- a/arch/arm/dts/sun7i-a20-wits-pro-a20-dkt.dts
4793 +++ b/arch/arm/dts/sun7i-a20-wits-pro-a20-dkt.dts
4794 @@ -1,13 +1,52 @@
4795 /*
4796 - * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
4797 + * Copyright 2015 Jelle de Jong <jelledejong@powercraft.nl>
4798 *
4799 - * Minimal dts file for the Wits Pro A20 DKT for u-boot only
4800 + * This file is dual-licensed: you can use it either under the terms
4801 + * of the GPL or the X11 license, at your option. Note that this dual
4802 + * licensing only applies to this file, and not this project as a
4803 + * whole.
4804 *
4805 - * SPDX-License-Identifier: GPL-2.0+ or X11
4806 + * a) This file is free software; you can redistribute it and/or
4807 + * modify it under the terms of the GNU General Public License as
4808 + * published by the Free Software Foundation; either version 2 of the
4809 + * License, or (at your option) any later version.
4810 + *
4811 + * This file is distributed in the hope that it will be useful,
4812 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
4813 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4814 + * GNU General Public License for more details.
4815 + *
4816 + * Or, alternatively,
4817 + *
4818 + * b) Permission is hereby granted, free of charge, to any person
4819 + * obtaining a copy of this software and associated documentation
4820 + * files (the "Software"), to deal in the Software without
4821 + * restriction, including without limitation the rights to use,
4822 + * copy, modify, merge, publish, distribute, sublicense, and/or
4823 + * sell copies of the Software, and to permit persons to whom the
4824 + * Software is furnished to do so, subject to the following
4825 + * conditions:
4826 + *
4827 + * The above copyright notice and this permission notice shall be
4828 + * included in all copies or substantial portions of the Software.
4829 + *
4830 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
4831 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
4832 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
4833 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
4834 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
4835 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
4836 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
4837 + * OTHER DEALINGS IN THE SOFTWARE.
4838 */
4839
4840 /dts-v1/;
4841 #include "sun7i-a20.dtsi"
4842 +#include "sunxi-common-regulators.dtsi"
4843 +
4844 +#include <dt-bindings/gpio/gpio.h>
4845 +#include <dt-bindings/input/input.h>
4846 +#include <dt-bindings/interrupt-controller/irq.h>
4847
4848 / {
4849 model = "Wits Pro A20 DKT";
4850 @@ -20,6 +59,17 @@
4851 chosen {
4852 stdout-path = "serial0:115200n8";
4853 };
4854 +
4855 + mmc3_pwrseq: mmc3_pwrseq {
4856 + compatible = "mmc-pwrseq-simple";
4857 + pinctrl-names = "default";
4858 + pinctrl-0 = <&vmmc3_pin_ap6xxx_wl_regon>;
4859 + reset-gpios = <&pio 7 9 GPIO_ACTIVE_LOW>; /* PH9 WIFI_EN */
4860 + };
4861 +};
4862 +
4863 +&cpu0 {
4864 + cpu-supply = <&reg_dcdc2>;
4865 };
4866
4867 &ehci0 {
4868 @@ -42,6 +92,60 @@
4869 };
4870 };
4871
4872 +&i2c0 {
4873 + pinctrl-names = "default";
4874 + pinctrl-0 = <&i2c0_pins_a>;
4875 + status = "okay";
4876 +
4877 + axp209: pmic@34 {
4878 + reg = <0x34>;
4879 + interrupt-parent = <&nmi_intc>;
4880 + interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
4881 + };
4882 +};
4883 +
4884 +&i2c1 {
4885 + pinctrl-names = "default";
4886 + pinctrl-0 = <&i2c1_pins_a>;
4887 + status = "okay";
4888 +};
4889 +
4890 +&i2c2 {
4891 + pinctrl-names = "default";
4892 + pinctrl-0 = <&i2c2_pins_a>;
4893 + status = "okay";
4894 +};
4895 +
4896 +#include "axp209.dtsi"
4897 +
4898 +&mmc0 {
4899 + pinctrl-names = "default";
4900 + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
4901 + vmmc-supply = <&reg_vcc3v3>;
4902 + bus-width = <4>;
4903 + cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
4904 + cd-inverted;
4905 + status = "okay";
4906 +};
4907 +
4908 +&mmc3 {
4909 + pinctrl-names = "default";
4910 + pinctrl-0 = <&mmc3_pins_a>;
4911 + vmmc-supply = <&reg_vcc3v3>;
4912 + mmc-pwrseq = <&mmc3_pwrseq>;
4913 + bus-width = <4>;
4914 + non-removable;
4915 + status = "okay";
4916 +
4917 + brcmf: bcrmf@1 {
4918 + reg = <1>;
4919 + compatible = "brcm,bcm4329-fmac";
4920 + interrupt-parent = <&pio>;
4921 + interrupts = <7 10 IRQ_TYPE_LEVEL_LOW>; /* PH10 / EINT10 */
4922 + interrupt-names = "host-wake";
4923 + };
4924 +};
4925 +
4926 &ohci0 {
4927 status = "okay";
4928 };
4929 @@ -50,8 +154,85 @@
4930 status = "okay";
4931 };
4932
4933 +&otg_sram {
4934 + status = "okay";
4935 +};
4936 +
4937 +&pio {
4938 + vmmc3_pin_ap6xxx_wl_regon: vmmc3_pin@0 {
4939 + allwinner,pins = "PH9";
4940 + allwinner,function = "gpio_out";
4941 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4942 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
4943 + };
4944 +
4945 + usb0_id_detect_pin: usb0_id_detect_pin@0 {
4946 + allwinner,pins = "PH4";
4947 + allwinner,function = "gpio_in";
4948 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
4949 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
4950 + };
4951 +};
4952 +
4953 +&reg_dcdc2 {
4954 + regulator-always-on;
4955 + regulator-min-microvolt = <1000000>;
4956 + regulator-max-microvolt = <1450000>;
4957 + regulator-name = "vdd-cpu";
4958 +};
4959 +
4960 +&reg_dcdc3 {
4961 + regulator-always-on;
4962 + regulator-min-microvolt = <1000000>;
4963 + regulator-max-microvolt = <1400000>;
4964 + regulator-name = "vdd-int-dll";
4965 +};
4966 +
4967 +&reg_ldo1 {
4968 + regulator-name = "vdd-rtc";
4969 +};
4970 +
4971 +&reg_ldo2 {
4972 + regulator-always-on;
4973 + regulator-min-microvolt = <3000000>;
4974 + regulator-max-microvolt = <3000000>;
4975 + regulator-name = "avcc";
4976 +};
4977 +
4978 +&reg_usb0_vbus {
4979 + status = "okay";
4980 +};
4981 +
4982 +&reg_usb1_vbus {
4983 + status = "okay";
4984 +};
4985 +
4986 +&reg_usb2_vbus {
4987 + status = "okay";
4988 +};
4989 +
4990 &uart0 {
4991 pinctrl-names = "default";
4992 pinctrl-0 = <&uart0_pins_a>;
4993 status = "okay";
4994 };
4995 +
4996 +&usb_otg {
4997 + dr_mode = "otg";
4998 + status = "okay";
4999 +};
5000 +
5001 +&usb_power_supply {
5002 + status = "okay";
5003 +};
5004 +
5005 +&usbphy {
5006 + pinctrl-names = "default";
5007 + pinctrl-0 = <&usb0_id_detect_pin>;
5008 + usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
5009 + usb0_vbus_power-supply = <&usb_power_supply>;
5010 + usb0_vbus-supply = <&reg_usb0_vbus>;
5011 + usb1_vbus-supply = <&reg_usb1_vbus>;
5012 + usb2_vbus-supply = <&reg_usb2_vbus>;
5013 + status = "okay";
5014 +};
5015 diff --git a/arch/arm/dts/sun7i-a20.dtsi b/arch/arm/dts/sun7i-a20.dtsi
5016 index 71ab6b8..0940a78 100644
5017 --- a/arch/arm/dts/sun7i-a20.dtsi
5018 +++ b/arch/arm/dts/sun7i-a20.dtsi
5019 @@ -47,6 +47,7 @@
5020 #include <dt-bindings/interrupt-controller/arm-gic.h>
5021 #include <dt-bindings/thermal/thermal.h>
5022
5023 +#include <dt-bindings/clock/sun4i-a10-pll2.h>
5024 #include <dt-bindings/dma/sun4i-a10.h>
5025 #include <dt-bindings/pinctrl/sun4i-a10.h>
5026
5027 @@ -67,7 +68,7 @@
5028 "simple-framebuffer";
5029 allwinner,pipeline = "de_be0-lcd0-hdmi";
5030 clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>,
5031 - <&ahb_gates 44>;
5032 + <&ahb_gates 44>, <&dram_gates 26>;
5033 status = "disabled";
5034 };
5035
5036 @@ -75,7 +76,8 @@
5037 compatible = "allwinner,simple-framebuffer",
5038 "simple-framebuffer";
5039 allwinner,pipeline = "de_be0-lcd0";
5040 - clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>;
5041 + clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>,
5042 + <&dram_gates 26>;
5043 status = "disabled";
5044 };
5045
5046 @@ -84,7 +86,7 @@
5047 "simple-framebuffer";
5048 allwinner,pipeline = "de_be0-lcd0-tve0";
5049 clocks = <&pll5 1>, <&ahb_gates 34>, <&ahb_gates 36>,
5050 - <&ahb_gates 44>;
5051 + <&ahb_gates 44>, <&dram_gates 26>;
5052 status = "disabled";
5053 };
5054 };
5055 @@ -107,7 +109,7 @@
5056 720000 1200000
5057 528000 1100000
5058 312000 1000000
5059 - 144000 900000
5060 + 144000 1000000
5061 >;
5062 #cooling-cells = <2>;
5063 cooling-min-level = <0>;
5064 @@ -199,6 +201,15 @@
5065 clock-output-names = "pll1";
5066 };
5067
5068 + pll2: clk@01c20008 {
5069 + #clock-cells = <1>;
5070 + compatible = "allwinner,sun4i-a10-pll2-clk";
5071 + reg = <0x01c20008 0x8>;
5072 + clocks = <&osc24M>;
5073 + clock-output-names = "pll2-1x", "pll2-2x",
5074 + "pll2-4x", "pll2-8x";
5075 + };
5076 +
5077 pll4: clk@01c20018 {
5078 #clock-cells = <0>;
5079 compatible = "allwinner,sun7i-a20-pll4-clk";
5080 @@ -267,6 +278,19 @@
5081 compatible = "allwinner,sun7i-a20-ahb-gates-clk";
5082 reg = <0x01c20060 0x8>;
5083 clocks = <&ahb>;
5084 + clock-indices = <0>, <1>,
5085 + <2>, <3>, <4>,
5086 + <5>, <6>, <7>, <8>,
5087 + <9>, <10>, <11>, <12>,
5088 + <13>, <14>, <16>,
5089 + <17>, <18>, <20>, <21>,
5090 + <22>, <23>, <25>,
5091 + <28>, <32>, <33>, <34>,
5092 + <35>, <36>, <37>, <40>,
5093 + <41>, <42>, <43>,
5094 + <44>, <45>, <46>,
5095 + <47>, <49>, <50>,
5096 + <52>;
5097 clock-output-names = "ahb_usb0", "ahb_ehci0",
5098 "ahb_ohci0", "ahb_ehci1", "ahb_ohci1",
5099 "ahb_ss", "ahb_dma", "ahb_bist", "ahb_mmc0",
5100 @@ -295,6 +319,10 @@
5101 compatible = "allwinner,sun7i-a20-apb0-gates-clk";
5102 reg = <0x01c20068 0x4>;
5103 clocks = <&apb0>;
5104 + clock-indices = <0>, <1>,
5105 + <2>, <3>, <4>,
5106 + <5>, <6>, <7>,
5107 + <8>, <10>;
5108 clock-output-names = "apb0_codec", "apb0_spdif",
5109 "apb0_ac97", "apb0_iis0", "apb0_iis1",
5110 "apb0_pio", "apb0_ir0", "apb0_ir1",
5111 @@ -314,6 +342,12 @@
5112 compatible = "allwinner,sun7i-a20-apb1-gates-clk";
5113 reg = <0x01c2006c 0x4>;
5114 clocks = <&apb1>;
5115 + clock-indices = <0>, <1>,
5116 + <2>, <3>, <4>,
5117 + <5>, <6>, <7>,
5118 + <15>, <16>, <17>,
5119 + <18>, <19>, <20>,
5120 + <21>, <22>, <23>;
5121 clock-output-names = "apb1_i2c0", "apb1_i2c1",
5122 "apb1_i2c2", "apb1_i2c3", "apb1_can",
5123 "apb1_scr", "apb1_ps20", "apb1_ps21",
5124 @@ -442,6 +476,14 @@
5125 clock-output-names = "ir1";
5126 };
5127
5128 + keypad_clk: clk@01c200c4 {
5129 + #clock-cells = <0>;
5130 + compatible = "allwinner,sun4i-a10-mod0-clk";
5131 + reg = <0x01c200c4 0x4>;
5132 + clocks = <&osc24M>;
5133 + clock-output-names = "keypad";
5134 + };
5135 +
5136 usb_clk: clk@01c200cc {
5137 #clock-cells = <1>;
5138 #reset-cells = <1>;
5139 @@ -460,6 +502,48 @@
5140 clock-output-names = "spi3";
5141 };
5142
5143 + dram_gates: clk@01c20100 {
5144 + #clock-cells = <1>;
5145 + compatible = "allwinner,sun4i-a10-dram-gates-clk";
5146 + reg = <0x01c20100 0x4>;
5147 + clocks = <&pll5 0>;
5148 + clock-indices = <0>,
5149 + <1>, <2>,
5150 + <3>,
5151 + <4>,
5152 + <5>, <6>,
5153 + <15>,
5154 + <24>, <25>,
5155 + <26>, <27>,
5156 + <28>, <29>;
5157 + clock-output-names = "dram_ve",
5158 + "dram_csi0", "dram_csi1",
5159 + "dram_ts",
5160 + "dram_tvd",
5161 + "dram_tve0", "dram_tve1",
5162 + "dram_output",
5163 + "dram_de_fe1", "dram_de_fe0",
5164 + "dram_de_be0", "dram_de_be1",
5165 + "dram_de_mp", "dram_ace";
5166 + };
5167 +
5168 + ve_clk: clk@01c2013c {
5169 + #clock-cells = <0>;
5170 + #reset-cells = <0>;
5171 + compatible = "allwinner,sun4i-a10-ve-clk";
5172 + reg = <0x01c2013c 0x4>;
5173 + clocks = <&pll4>;
5174 + clock-output-names = "ve";
5175 + };
5176 +
5177 + codec_clk: clk@01c20140 {
5178 + #clock-cells = <0>;
5179 + compatible = "allwinner,sun4i-a10-codec-clk";
5180 + reg = <0x01c20140 0x4>;
5181 + clocks = <&pll2 SUN4I_A10_PLL2_1X>;
5182 + clock-output-names = "codec";
5183 + };
5184 +
5185 mbus_clk: clk@01c2015c {
5186 #clock-cells = <0>;
5187 compatible = "allwinner,sun5i-a13-mbus-clk";
5188 @@ -744,6 +828,14 @@
5189 status = "disabled";
5190 };
5191
5192 + crypto: crypto-engine@01c15000 {
5193 + compatible = "allwinner,sun4i-a10-crypto";
5194 + reg = <0x01c15000 0x1000>;
5195 + interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
5196 + clocks = <&ahb_gates 5>, <&ss_clk>;
5197 + clock-names = "ahb", "mod";
5198 + };
5199 +
5200 spi2: spi@01c17000 {
5201 compatible = "allwinner,sun4i-a10-spi";
5202 reg = <0x01c17000 0x1000>;
5203 @@ -1159,6 +1251,19 @@
5204 status = "disabled";
5205 };
5206
5207 + codec: codec@01c22c00 {
5208 + #sound-dai-cells = <0>;
5209 + compatible = "allwinner,sun7i-a20-codec";
5210 + reg = <0x01c22c00 0x40>;
5211 + interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
5212 + clocks = <&apb0_gates 0>, <&codec_clk>;
5213 + clock-names = "apb", "codec";
5214 + dmas = <&dma SUN4I_DMA_NORMAL 19>,
5215 + <&dma SUN4I_DMA_NORMAL 19>;
5216 + dma-names = "rx", "tx";
5217 + status = "disabled";
5218 + };
5219 +
5220 sid: eeprom@01c23800 {
5221 compatible = "allwinner,sun7i-a20-sid";
5222 reg = <0x01c23800 0x200>;
5223 diff --git a/arch/arm/dts/sun8i-a23-a33.dtsi b/arch/arm/dts/sun8i-a23-a33.dtsi
5224 index 9c4a55c..7e05e09 100644
5225 --- a/arch/arm/dts/sun8i-a23-a33.dtsi
5226 +++ b/arch/arm/dts/sun8i-a23-a33.dtsi
5227 @@ -56,7 +56,7 @@
5228 #size-cells = <1>;
5229 ranges;
5230
5231 - framebuffer@0 {
5232 + simplefb_lcd: framebuffer@0 {
5233 compatible = "allwinner,simple-framebuffer",
5234 "simple-framebuffer";
5235 allwinner,pipeline = "de_be0-lcd0";
5236 @@ -175,27 +175,13 @@
5237 clock-output-names = "apb1";
5238 };
5239
5240 - ahb1_gates: clk@01c20060 {
5241 - #clock-cells = <1>;
5242 - compatible = "allwinner,sun8i-a23-ahb1-gates-clk";
5243 - reg = <0x01c20060 0x8>;
5244 - clocks = <&ahb1>;
5245 - clock-output-names = "ahb1_mipidsi", "ahb1_dma",
5246 - "ahb1_mmc0", "ahb1_mmc1", "ahb1_mmc2",
5247 - "ahb1_nand", "ahb1_sdram",
5248 - "ahb1_hstimer", "ahb1_spi0",
5249 - "ahb1_spi1", "ahb1_otg", "ahb1_ehci",
5250 - "ahb1_ohci", "ahb1_ve", "ahb1_lcd",
5251 - "ahb1_csi", "ahb1_be", "ahb1_fe",
5252 - "ahb1_gpu", "ahb1_spinlock",
5253 - "ahb1_drc";
5254 - };
5255 -
5256 apb1_gates: clk@01c20068 {
5257 #clock-cells = <1>;
5258 compatible = "allwinner,sun8i-a23-apb1-gates-clk";
5259 reg = <0x01c20068 0x4>;
5260 clocks = <&apb1>;
5261 + clock-indices = <0>, <5>,
5262 + <12>, <13>;
5263 clock-output-names = "apb1_codec", "apb1_pio",
5264 "apb1_daudio0", "apb1_daudio1";
5265 };
5266 @@ -213,6 +199,10 @@
5267 compatible = "allwinner,sun8i-a23-apb2-gates-clk";
5268 reg = <0x01c2006c 0x4>;
5269 clocks = <&apb2>;
5270 + clock-indices = <0>, <1>,
5271 + <2>, <16>,
5272 + <17>, <18>,
5273 + <19>, <20>;
5274 clock-output-names = "apb2_i2c0", "apb2_i2c1",
5275 "apb2_i2c2", "apb2_uart0",
5276 "apb2_uart1", "apb2_uart2",
5277 @@ -391,12 +381,19 @@
5278 allwinner,pins = "PC5", "PC6", "PC8",
5279 "PC9", "PC10", "PC11",
5280 "PC12", "PC13", "PC14",
5281 - "PC15";
5282 + "PC15", "PC16";
5283 allwinner,function = "mmc2";
5284 allwinner,drive = <SUN4I_PINCTRL_30_MA>;
5285 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
5286 };
5287
5288 + pwm0_pins: pwm0 {
5289 + allwinner,pins = "PH0";
5290 + allwinner,function = "pwm0";
5291 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
5292 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
5293 + };
5294 +
5295 i2c0_pins_a: i2c0@0 {
5296 allwinner,pins = "PH2", "PH3";
5297 allwinner,function = "i2c0";
5298 @@ -451,6 +448,14 @@
5299 interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
5300 };
5301
5302 + pwm: pwm@01c21400 {
5303 + compatible = "allwinner,sun7i-a20-pwm";
5304 + reg = <0x01c21400 0xc>;
5305 + clocks = <&osc24M>;
5306 + #pwm-cells = <3>;
5307 + status = "disabled";
5308 + };
5309 +
5310 lradc: lradc@01c22800 {
5311 compatible = "allwinner,sun4i-a10-lradc-keys";
5312 reg = <0x01c22800 0x100>;
5313 @@ -574,6 +579,14 @@
5314 <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
5315 };
5316
5317 + nmi_intc: interrupt-controller@01f00c0c {
5318 + compatible = "allwinner,sun6i-a31-sc-nmi";
5319 + interrupt-controller;
5320 + #interrupt-cells = <2>;
5321 + reg = <0x01f00c0c 0x38>;
5322 + interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
5323 + };
5324 +
5325 prcm@01f01400 {
5326 compatible = "allwinner,sun8i-a23-prcm";
5327 reg = <0x01f01400 0x200>;
5328 @@ -642,10 +655,18 @@
5329 resets = <&apb0_rst 0>;
5330 gpio-controller;
5331 interrupt-controller;
5332 + #interrupt-cells = <3>;
5333 #address-cells = <1>;
5334 #size-cells = <0>;
5335 #gpio-cells = <3>;
5336
5337 + r_rsb_pins: r_rsb {
5338 + allwinner,pins = "PL0", "PL1";
5339 + allwinner,function = "s_rsb";
5340 + allwinner,drive = <SUN4I_PINCTRL_20_MA>;
5341 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
5342 + };
5343 +
5344 r_uart_pins_a: r_uart@0 {
5345 allwinner,pins = "PL2", "PL3";
5346 allwinner,function = "s_uart";
5347 @@ -653,5 +674,19 @@
5348 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
5349 };
5350 };
5351 +
5352 + r_rsb: rsb@01f03400 {
5353 + compatible = "allwinner,sun8i-a23-rsb";
5354 + reg = <0x01f03400 0x400>;
5355 + interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>;
5356 + clocks = <&apb0_gates 3>;
5357 + clock-frequency = <3000000>;
5358 + resets = <&apb0_rst 3>;
5359 + pinctrl-names = "default";
5360 + pinctrl-0 = <&r_rsb_pins>;
5361 + status = "disabled";
5362 + #address-cells = <1>;
5363 + #size-cells = <0>;
5364 + };
5365 };
5366 };
5367 diff --git a/arch/arm/dts/sun8i-a23-gt90h-v4.dts b/arch/arm/dts/sun8i-a23-gt90h-v4.dts
5368 index 1aeb06c..b2ce284 100644
5369 --- a/arch/arm/dts/sun8i-a23-gt90h-v4.dts
5370 +++ b/arch/arm/dts/sun8i-a23-gt90h-v4.dts
5371 @@ -47,15 +47,26 @@
5372 #include <dt-bindings/gpio/gpio.h>
5373 #include <dt-bindings/input/input.h>
5374 #include <dt-bindings/pinctrl/sun4i-a10.h>
5375 +#include <dt-bindings/pwm/pwm.h>
5376
5377 / {
5378 - model = "Allwinner GT90H Quad Core Tablet (v4)";
5379 - compatible = "allwinner,gt90h-v4", "allwinner,sun8i-a33";
5380 + model = "Allwinner GT90H Dual Core Tablet (v4)";
5381 + compatible = "allwinner,gt90h-v4", "allwinner,sun8i-a23";
5382
5383 aliases {
5384 serial0 = &r_uart;
5385 };
5386
5387 + backlight: backlight {
5388 + compatible = "pwm-backlight";
5389 + pinctrl-names = "default";
5390 + pinctrl-0 = <&bl_en_pin_gt90h>;
5391 + pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
5392 + brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
5393 + default-brightness-level = <8>;
5394 + enable-gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
5395 + };
5396 +
5397 chosen {
5398 stdout-path = "serial0:115200n8";
5399 };
5400 @@ -106,8 +117,7 @@
5401 &mmc0 {
5402 pinctrl-names = "default";
5403 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_gt90h>;
5404 - /* FIXME this really is aldo1, correct once we've pmic support */
5405 - vmmc-supply = <&reg_vcc3v0>;
5406 + vmmc-supply = <&reg_aldo1>;
5407 bus-width = <4>;
5408 cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */
5409 cd-inverted;
5410 @@ -115,6 +125,13 @@
5411 };
5412
5413 &pio {
5414 + bl_en_pin_gt90h: bl_en_pin@0 {
5415 + allwinner,pins = "PH6";
5416 + allwinner,function = "gpio_in";
5417 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
5418 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
5419 + };
5420 +
5421 mmc0_cd_pin_gt90h: mmc0_cd_pin@0 {
5422 allwinner,pins = "PB4";
5423 allwinner,function = "gpio_in";
5424 @@ -123,12 +140,106 @@
5425 };
5426 };
5427
5428 +&pwm {
5429 + pinctrl-names = "default";
5430 + pinctrl-0 = <&pwm0_pins>;
5431 + status = "okay";
5432 +};
5433 +
5434 +&r_rsb {
5435 + status = "okay";
5436 +
5437 + axp22x: pmic@3a3 {
5438 + compatible = "x-powers,axp223";
5439 + reg = <0x3a3>;
5440 + interrupt-parent = <&nmi_intc>;
5441 + interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
5442 + eldoin-supply = <&reg_dcdc1>;
5443 + };
5444 +};
5445 +
5446 &r_uart {
5447 pinctrl-names = "default";
5448 pinctrl-0 = <&r_uart_pins_a>;
5449 status = "okay";
5450 };
5451
5452 +#include "axp22x.dtsi"
5453 +
5454 +&reg_aldo1 {
5455 + regulator-always-on;
5456 + regulator-min-microvolt = <3000000>;
5457 + regulator-max-microvolt = <3000000>;
5458 + regulator-name = "vcc-io";
5459 +};
5460 +
5461 +&reg_aldo2 {
5462 + regulator-always-on;
5463 + regulator-min-microvolt = <2350000>;
5464 + regulator-max-microvolt = <2650000>;
5465 + regulator-name = "vdd-dll";
5466 +};
5467 +
5468 +&reg_aldo3 {
5469 + regulator-always-on;
5470 + regulator-min-microvolt = <2700000>;
5471 + regulator-max-microvolt = <3300000>;
5472 + regulator-name = "vcc-pll-avcc";
5473 +};
5474 +
5475 +&reg_dc1sw {
5476 + regulator-name = "vcc-lcd";
5477 +};
5478 +
5479 +&reg_dc5ldo {
5480 + regulator-always-on;
5481 + regulator-min-microvolt = <900000>;
5482 + regulator-max-microvolt = <1400000>;
5483 + regulator-name = "vdd-cpus";
5484 +};
5485 +
5486 +&reg_dcdc1 {
5487 + regulator-always-on;
5488 + regulator-min-microvolt = <3000000>;
5489 + regulator-max-microvolt = <3000000>;
5490 + regulator-name = "vcc-3v0";
5491 +};
5492 +
5493 +&reg_dcdc2 {
5494 + regulator-always-on;
5495 + regulator-min-microvolt = <900000>;
5496 + regulator-max-microvolt = <1400000>;
5497 + regulator-name = "vdd-sys";
5498 +};
5499 +
5500 +&reg_dcdc3 {
5501 + regulator-always-on;
5502 + regulator-min-microvolt = <900000>;
5503 + regulator-max-microvolt = <1400000>;
5504 + regulator-name = "vdd-cpu";
5505 +};
5506 +
5507 +&reg_dcdc5 {
5508 + regulator-always-on;
5509 + regulator-min-microvolt = <1500000>;
5510 + regulator-max-microvolt = <1500000>;
5511 + regulator-name = "vcc-dram";
5512 +};
5513 +
5514 +&reg_dldo1 {
5515 + regulator-min-microvolt = <3300000>;
5516 + regulator-max-microvolt = <3300000>;
5517 + regulator-name = "vcc-wifi";
5518 +};
5519 +
5520 +&reg_rtc_ldo {
5521 + regulator-name = "vcc-rtc";
5522 +};
5523 +
5524 +&simplefb_lcd {
5525 + vcc-lcd-supply = <&reg_dc1sw>;
5526 +};
5527 +
5528 /*
5529 * FIXME for now we only support host mode and rely on u-boot to have
5530 * turned on Vbus which is controlled by the axp223 pmic on the board.
5531 @@ -141,5 +252,6 @@
5532 };
5533
5534 &usbphy {
5535 + usb1_vbus-supply = <&reg_dldo1>;
5536 status = "okay";
5537 };
5538 diff --git a/arch/arm/dts/sun8i-a23.dtsi b/arch/arm/dts/sun8i-a23.dtsi
5539 index 2cc27c7..92e6616 100644
5540 --- a/arch/arm/dts/sun8i-a23.dtsi
5541 +++ b/arch/arm/dts/sun8i-a23.dtsi
5542 @@ -50,6 +50,31 @@
5543 };
5544
5545 clocks {
5546 + ahb1_gates: clk@01c20060 {
5547 + #clock-cells = <1>;
5548 + compatible = "allwinner,sun8i-a23-ahb1-gates-clk";
5549 + reg = <0x01c20060 0x8>;
5550 + clocks = <&ahb1>;
5551 + clock-indices = <1>, <6>,
5552 + <8>, <9>, <10>,
5553 + <13>, <14>,
5554 + <19>, <20>,
5555 + <21>, <24>, <26>,
5556 + <29>, <32>, <36>,
5557 + <40>, <44>, <46>,
5558 + <52>, <53>,
5559 + <54>, <57>;
5560 + clock-output-names = "ahb1_mipidsi", "ahb1_dma",
5561 + "ahb1_mmc0", "ahb1_mmc1", "ahb1_mmc2",
5562 + "ahb1_nand", "ahb1_sdram",
5563 + "ahb1_hstimer", "ahb1_spi0",
5564 + "ahb1_spi1", "ahb1_otg", "ahb1_ehci",
5565 + "ahb1_ohci", "ahb1_ve", "ahb1_lcd",
5566 + "ahb1_csi", "ahb1_be", "ahb1_fe",
5567 + "ahb1_gpu", "ahb1_msgbox",
5568 + "ahb1_spinlock", "ahb1_drc";
5569 + };
5570 +
5571 mbus_clk: clk@01c2015c {
5572 #clock-cells = <0>;
5573 compatible = "allwinner,sun8i-a23-mbus-clk";
5574 diff --git a/arch/arm/dts/sun8i-a33-sinlinx-sina33.dts b/arch/arm/dts/sun8i-a33-sinlinx-sina33.dts
5575 index 1d5390d..fef6abc 100644
5576 --- a/arch/arm/dts/sun8i-a33-sinlinx-sina33.dts
5577 +++ b/arch/arm/dts/sun8i-a33-sinlinx-sina33.dts
5578 @@ -68,7 +68,7 @@
5579 };
5580
5581 &lradc {
5582 - vref-supply = <&reg_vcc3v0>;
5583 + vref-supply = <&reg_dcdc1>;
5584 status = "okay";
5585
5586 button@200 {
5587 @@ -96,7 +96,7 @@
5588 &mmc0 {
5589 pinctrl-names = "default";
5590 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_sina33>;
5591 - vmmc-supply = <&reg_vcc3v0>;
5592 + vmmc-supply = <&reg_dcdc1>;
5593 bus-width = <4>;
5594 cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */
5595 cd-inverted;
5596 @@ -106,13 +106,16 @@
5597 &mmc2 {
5598 pinctrl-names = "default";
5599 pinctrl-0 = <&mmc2_8bit_pins>;
5600 - vmmc-supply = <&reg_vcc3v0>;
5601 + vmmc-supply = <&reg_dcdc1>;
5602 bus-width = <8>;
5603 non-removable;
5604 + cap-mmc-hw-reset;
5605 status = "okay";
5606 };
5607
5608 &mmc2_8bit_pins {
5609 + /* Increase drive strength for DDR modes */
5610 + allwinner,drive = <SUN4I_PINCTRL_40_MA>;
5611 /* eMMC is missing pull-ups */
5612 allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
5613 };
5614 @@ -130,6 +133,80 @@
5615 };
5616 };
5617
5618 +&r_rsb {
5619 + status = "okay";
5620 +
5621 + axp22x: pmic@3a3 {
5622 + compatible = "x-powers,axp223";
5623 + reg = <0x3a3>;
5624 + interrupt-parent = <&nmi_intc>;
5625 + interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
5626 + eldoin-supply = <&reg_dcdc1>;
5627 + };
5628 +};
5629 +
5630 +#include "axp22x.dtsi"
5631 +
5632 +&reg_aldo1 {
5633 + regulator-always-on;
5634 + regulator-min-microvolt = <3000000>;
5635 + regulator-max-microvolt = <3000000>;
5636 + regulator-name = "vcc-io";
5637 +};
5638 +
5639 +&reg_aldo2 {
5640 + regulator-always-on;
5641 + regulator-min-microvolt = <2350000>;
5642 + regulator-max-microvolt = <2650000>;
5643 + regulator-name = "vdd-dll";
5644 +};
5645 +
5646 +&reg_aldo3 {
5647 + regulator-always-on;
5648 + regulator-min-microvolt = <2700000>;
5649 + regulator-max-microvolt = <3300000>;
5650 + regulator-name = "vcc-pll-avcc";
5651 +};
5652 +
5653 +&reg_dc5ldo {
5654 + regulator-always-on;
5655 + regulator-min-microvolt = <900000>;
5656 + regulator-max-microvolt = <1400000>;
5657 + regulator-name = "vdd-cpus";
5658 +};
5659 +
5660 +&reg_dcdc1 {
5661 + regulator-always-on;
5662 + regulator-min-microvolt = <3000000>;
5663 + regulator-max-microvolt = <3000000>;
5664 + regulator-name = "vcc-3v0";
5665 +};
5666 +
5667 +&reg_dcdc2 {
5668 + regulator-always-on;
5669 + regulator-min-microvolt = <900000>;
5670 + regulator-max-microvolt = <1400000>;
5671 + regulator-name = "vdd-sys";
5672 +};
5673 +
5674 +&reg_dcdc3 {
5675 + regulator-always-on;
5676 + regulator-min-microvolt = <900000>;
5677 + regulator-max-microvolt = <1400000>;
5678 + regulator-name = "vdd-cpu";
5679 +};
5680 +
5681 +&reg_dcdc5 {
5682 + regulator-always-on;
5683 + regulator-min-microvolt = <1500000>;
5684 + regulator-max-microvolt = <1500000>;
5685 + regulator-name = "vcc-dram";
5686 +};
5687 +
5688 +&reg_rtc_ldo {
5689 + regulator-name = "vcc-rtc";
5690 +};
5691 +
5692 &uart0 {
5693 pinctrl-names = "default";
5694 pinctrl-0 = <&uart0_pins_b>;
5695 diff --git a/arch/arm/dts/sun8i-a33.dtsi b/arch/arm/dts/sun8i-a33.dtsi
5696 index faa7d3c..001d840 100644
5697 --- a/arch/arm/dts/sun8i-a33.dtsi
5698 +++ b/arch/arm/dts/sun8i-a33.dtsi
5699 @@ -72,6 +72,41 @@
5700 clock-output-names = "pll11";
5701 };
5702
5703 + ahb1_gates: clk@01c20060 {
5704 + #clock-cells = <1>;
5705 + compatible = "allwinner,sun8i-a33-ahb1-gates-clk";
5706 + reg = <0x01c20060 0x8>;
5707 + clocks = <&ahb1>;
5708 + clock-indices = <1>, <5>,
5709 + <6>, <8>, <9>,
5710 + <10>, <13>, <14>,
5711 + <19>, <20>,
5712 + <21>, <24>, <26>,
5713 + <29>, <32>, <36>,
5714 + <40>, <44>, <46>,
5715 + <52>, <53>,
5716 + <54>, <57>,
5717 + <58>;
5718 + clock-output-names = "ahb1_mipidsi", "ahb1_ss",
5719 + "ahb1_dma","ahb1_mmc0", "ahb1_mmc1",
5720 + "ahb1_mmc2", "ahb1_nand", "ahb1_sdram",
5721 + "ahb1_hstimer", "ahb1_spi0",
5722 + "ahb1_spi1", "ahb1_otg", "ahb1_ehci",
5723 + "ahb1_ohci", "ahb1_ve", "ahb1_lcd",
5724 + "ahb1_csi", "ahb1_be", "ahb1_fe",
5725 + "ahb1_gpu", "ahb1_msgbox",
5726 + "ahb1_spinlock", "ahb1_drc",
5727 + "ahb1_sat";
5728 + };
5729 +
5730 + ss_clk: clk@01c2009c {
5731 + #clock-cells = <0>;
5732 + compatible = "allwinner,sun4i-a10-mod0-clk";
5733 + reg = <0x01c2009c 0x4>;
5734 + clocks = <&osc24M>, <&pll6 0>;
5735 + clock-output-names = "ss";
5736 + };
5737 +
5738 mbus_clk: clk@01c2015c {
5739 #clock-cells = <0>;
5740 compatible = "allwinner,sun8i-a23-mbus-clk";
5741 @@ -82,6 +117,16 @@
5742 };
5743
5744 soc@01c00000 {
5745 + crypto: crypto-engine@01c15000 {
5746 + compatible = "allwinner,sun4i-a10-crypto";
5747 + reg = <0x01c15000 0x1000>;
5748 + interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>;
5749 + clocks = <&ahb1_gates 5>, <&ss_clk>;
5750 + clock-names = "ahb", "mod";
5751 + resets = <&ahb1_rst 5>;
5752 + reset-names = "ahb";
5753 + };
5754 +
5755 usb_otg: usb@01c19000 {
5756 compatible = "allwinner,sun8i-a33-musb";
5757 reg = <0x01c19000 0x0400>;
5758 diff --git a/arch/arm/dts/sun8i-a83t-cubietruck-plus.dts b/arch/arm/dts/sun8i-a83t-cubietruck-plus.dts
5759 new file mode 100644
5760 index 0000000..88b1e09
5761 --- /dev/null
5762 +++ b/arch/arm/dts/sun8i-a83t-cubietruck-plus.dts
5763 @@ -0,0 +1,65 @@
5764 +/*
5765 + * Copyright 2015 Chen-Yu Tsai
5766 + *
5767 + * Chen-Yu Tsai <wens@csie.org>
5768 + *
5769 + * This file is dual-licensed: you can use it either under the terms
5770 + * of the GPL or the X11 license, at your option. Note that this dual
5771 + * licensing only applies to this file, and not this project as a
5772 + * whole.
5773 + *
5774 + * a) This file is free software; you can redistribute it and/or
5775 + * modify it under the terms of the GNU General Public License as
5776 + * published by the Free Software Foundation; either version 2 of the
5777 + * License, or (at your option) any later version.
5778 + *
5779 + * This file is distributed in the hope that it will be useful,
5780 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
5781 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5782 + * GNU General Public License for more details.
5783 + *
5784 + * Or, alternatively,
5785 + *
5786 + * b) Permission is hereby granted, free of charge, to any person
5787 + * obtaining a copy of this software and associated documentation
5788 + * files (the "Software"), to deal in the Software without
5789 + * restriction, including without limitation the rights to use,
5790 + * copy, modify, merge, publish, distribute, sublicense, and/or
5791 + * sell copies of the Software, and to permit persons to whom the
5792 + * Software is furnished to do so, subject to the following
5793 + * conditions:
5794 + *
5795 + * The above copyright notice and this permission notice shall be
5796 + * included in all copies or substantial portions of the Software.
5797 + *
5798 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
5799 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
5800 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
5801 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
5802 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
5803 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
5804 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
5805 + * OTHER DEALINGS IN THE SOFTWARE.
5806 + */
5807 +
5808 +/dts-v1/;
5809 +#include "sun8i-a83t.dtsi"
5810 +
5811 +/ {
5812 + model = "Cubietech Cubietruck Plus";
5813 + compatible = "cubietech,cubietruck-plus", "allwinner,sun8i-a83t";
5814 +
5815 + aliases {
5816 + serial0 = &uart0;
5817 + };
5818 +
5819 + chosen {
5820 + stdout-path = "serial0:115200n8";
5821 + };
5822 +};
5823 +
5824 +&uart0 {
5825 + pinctrl-names = "default";
5826 + pinctrl-0 = <&uart0_pins_b>;
5827 + status = "okay";
5828 +};
5829 diff --git a/arch/arm/dts/sun8i-a83t.dtsi b/arch/arm/dts/sun8i-a83t.dtsi
5830 index 245b819..d3473f8 100644
5831 --- a/arch/arm/dts/sun8i-a83t.dtsi
5832 +++ b/arch/arm/dts/sun8i-a83t.dtsi
5833 @@ -52,12 +52,6 @@
5834 / {
5835 interrupt-parent = <&gic>;
5836
5837 - chosen {
5838 - #address-cells = <1>;
5839 - #size-cells = <1>;
5840 - ranges;
5841 - };
5842 -
5843 cpus {
5844 #address-cells = <1>;
5845 #size-cells = <0>;
5846 @@ -85,6 +79,7 @@
5847 device_type = "cpu";
5848 reg = <3>;
5849 };
5850 +
5851 cpu@100 {
5852 compatible = "arm,cortex-a7";
5853 device_type = "cpu";
5854 @@ -96,6 +91,7 @@
5855 device_type = "cpu";
5856 reg = <0x101>;
5857 };
5858 +
5859 cpu@102 {
5860 compatible = "arm,cortex-a7";
5861 device_type = "cpu";
5862 @@ -109,18 +105,12 @@
5863 };
5864 };
5865
5866 - memory {
5867 - reg = <0x40000000 0x80000000>;
5868 - };
5869 -
5870 timer {
5871 compatible = "arm,armv7-timer";
5872 - interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
5873 - <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
5874 - <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
5875 - <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
5876 - clock-frequency = <24000000>;
5877 - arm,cpu-registers-not-fw-configured;
5878 + interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
5879 + <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
5880 + <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
5881 + <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>;
5882 };
5883
5884 clocks {
5885 @@ -128,6 +118,7 @@
5886 #size-cells = <1>;
5887 ranges;
5888
5889 + /* TODO: PRCM block has a mux for this. */
5890 osc24M: osc24M_clk {
5891 #clock-cells = <0>;
5892 compatible = "fixed-clock";
5893 @@ -135,36 +126,39 @@
5894 clock-output-names = "osc24M";
5895 };
5896
5897 - osc32k: osc32k_clk {
5898 + /*
5899 + * This is called "internal OSC" in some places.
5900 + * It is an internal RC-based oscillator.
5901 + * TODO: Its controls are in the PRCM block.
5902 + */
5903 + osc16M: osc16M_clk {
5904 #clock-cells = <0>;
5905 compatible = "fixed-clock";
5906 - clock-frequency = <32768>;
5907 - clock-output-names = "osc32k";
5908 + clock-frequency = <16000000>;
5909 + clock-output-names = "osc16M";
5910 + };
5911 +
5912 + osc16Md512: osc16Md512_clk {
5913 + #clock-cells = <0>;
5914 + compatible = "fixed-factor-clock";
5915 + clock-div = <512>;
5916 + clock-mult = <1>;
5917 + clocks = <&osc16M>;
5918 + clock-output-names = "osc16M-d512";
5919 };
5920 };
5921
5922 - soc@01c00000 {
5923 + soc {
5924 compatible = "simple-bus";
5925 #address-cells = <1>;
5926 #size-cells = <1>;
5927 ranges;
5928
5929 - gic: interrupt-controller@01c81000 {
5930 - compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic";
5931 - reg = <0x01c81000 0x1000>,
5932 - <0x01c82000 0x1000>,
5933 - <0x01c84000 0x2000>,
5934 - <0x01c86000 0x2000>;
5935 - interrupt-controller;
5936 - #interrupt-cells = <3>;
5937 - interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
5938 - };
5939 -
5940 pio: pinctrl@01c20800 {
5941 compatible = "allwinner,sun8i-a83t-pinctrl";
5942 interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
5943 - <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>,
5944 - <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
5945 + <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>,
5946 + <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>;
5947 reg = <0x01c20800 0x400>;
5948 clocks = <&osc24M>;
5949 gpio-controller;
5950 @@ -172,27 +166,6 @@
5951 #interrupt-cells = <3>;
5952 #gpio-cells = <3>;
5953
5954 - i2c0_pins_a: i2c0@0 {
5955 - allwinner,pins = "PH0", "PH1";
5956 - allwinner,function = "i2c0";
5957 - allwinner,drive = <SUN4I_PINCTRL_10_MA>;
5958 - allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
5959 - };
5960 -
5961 - i2c1_pins_a: i2c1@0 {
5962 - allwinner,pins = "PH2", "PH3";
5963 - allwinner,function = "i2c1";
5964 - allwinner,drive = <SUN4I_PINCTRL_10_MA>;
5965 - allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
5966 - };
5967 -
5968 - i2c2_pins_a: i2c2@0 {
5969 - allwinner,pins = "PH4", "PH5";
5970 - allwinner,function = "i2c2";
5971 - allwinner,drive = <SUN4I_PINCTRL_10_MA>;
5972 - allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
5973 - };
5974 -
5975 mmc0_pins_a: mmc0@0 {
5976 allwinner,pins = "PF0", "PF1", "PF2",
5977 "PF3", "PF4", "PF5";
5978 @@ -201,24 +174,6 @@
5979 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
5980 };
5981
5982 - mmc1_pins_a: mmc1@0 {
5983 - allwinner,pins = "PG0", "PG1", "PG2",
5984 - "PG3", "PG4", "PG5";
5985 - allwinner,function = "mmc1";
5986 - allwinner,drive = <SUN4I_PINCTRL_30_MA>;
5987 - allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
5988 - };
5989 -
5990 - mmc2_8bit_pins: mmc2_8bit {
5991 - allwinner,pins = "PC5", "PC6", "PC8",
5992 - "PC9", "PC10", "PC11",
5993 - "PC12", "PC13", "PC14",
5994 - "PC15";
5995 - allwinner,function = "mmc2";
5996 - allwinner,drive = <SUN4I_PINCTRL_30_MA>;
5997 - allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
5998 - };
5999 -
6000 uart0_pins_a: uart0@0 {
6001 allwinner,pins = "PF2", "PF4";
6002 allwinner,function = "uart0";
6003 @@ -234,6 +189,21 @@
6004 };
6005 };
6006
6007 + timer@01c20c00 {
6008 + compatible = "allwinner,sun4i-a10-timer";
6009 + reg = <0x01c20c00 0xa0>;
6010 + interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>,
6011 + <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
6012 + clocks = <&osc24M>;
6013 + };
6014 +
6015 + watchdog@01c20ca0 {
6016 + compatible = "allwinner,sun6i-a31-wdt";
6017 + reg = <0x01c20ca0 0x20>;
6018 + interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
6019 + clocks = <&osc24M>;
6020 + };
6021 +
6022 uart0: serial@01c28000 {
6023 compatible = "snps,dw-apb-uart";
6024 reg = <0x01c28000 0x400>;
6025 @@ -243,5 +213,16 @@
6026 clocks = <&osc24M>;
6027 status = "disabled";
6028 };
6029 +
6030 + gic: interrupt-controller@01c81000 {
6031 + compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic";
6032 + reg = <0x01c81000 0x1000>,
6033 + <0x01c82000 0x1000>,
6034 + <0x01c84000 0x2000>,
6035 + <0x01c86000 0x2000>;
6036 + interrupt-controller;
6037 + #interrupt-cells = <3>;
6038 + interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_HIGH)>;
6039 + };
6040 };
6041 };
6042 diff --git a/arch/arm/dts/sun8i-h3-orangepi-pc.dts b/arch/arm/dts/sun8i-h3-orangepi-pc.dts
6043 index 4b25dcc..30ccca0 100644
6044 --- a/arch/arm/dts/sun8i-h3-orangepi-pc.dts
6045 +++ b/arch/arm/dts/sun8i-h3-orangepi-pc.dts
6046 @@ -45,6 +45,7 @@
6047 #include "sunxi-common-regulators.dtsi"
6048
6049 #include <dt-bindings/gpio/gpio.h>
6050 +#include <dt-bindings/input/input.h>
6051 #include <dt-bindings/pinctrl/sun4i-a10.h>
6052
6053 / {
6054 @@ -58,6 +59,43 @@
6055 chosen {
6056 stdout-path = "serial0:115200n8";
6057 };
6058 +
6059 + leds {
6060 + compatible = "gpio-leds";
6061 + pinctrl-names = "default";
6062 + pinctrl-0 = <&leds_opc>;
6063 +
6064 + status_led {
6065 + label = "status:red:user";
6066 + gpios = <&pio 0 15 GPIO_ACTIVE_HIGH>;
6067 + };
6068 + };
6069 +
6070 + r_leds {
6071 + compatible = "gpio-leds";
6072 + pinctrl-names = "default";
6073 + pinctrl-0 = <&leds_r_opc>;
6074 +
6075 + tx {
6076 + label = "pwr:green:user";
6077 + gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
6078 + default-state = "on";
6079 + };
6080 + };
6081 +
6082 + r_gpio_keys {
6083 + compatible = "gpio-keys";
6084 + input-name = "sw4";
6085 +
6086 + pinctrl-names = "default";
6087 + pinctrl-0 = <&sw_r_opc>;
6088 +
6089 + sw4@0 {
6090 + label = "sw4";
6091 + linux,code = <BTN_0>;
6092 + gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
6093 + };
6094 + };
6095 };
6096
6097 &ehci1 {
6098 @@ -72,6 +110,12 @@
6099 status = "okay";
6100 };
6101
6102 +&ir {
6103 + pinctrl-names = "default";
6104 + pinctrl-0 = <&ir_pins_a>;
6105 + status = "okay";
6106 +};
6107 +
6108 &mmc0 {
6109 pinctrl-names = "default";
6110 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
6111 @@ -94,6 +138,31 @@
6112 status = "okay";
6113 };
6114
6115 +&pio {
6116 + leds_opc: led_pins@0 {
6117 + allwinner,pins = "PA15";
6118 + allwinner,function = "gpio_out";
6119 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
6120 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
6121 + };
6122 +};
6123 +
6124 +&r_pio {
6125 + leds_r_opc: led_pins@0 {
6126 + allwinner,pins = "PL10";
6127 + allwinner,function = "gpio_out";
6128 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
6129 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
6130 + };
6131 +
6132 + sw_r_opc: key_pins@0 {
6133 + allwinner,pins = "PL03";
6134 + allwinner,function = "gpio_in";
6135 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
6136 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
6137 + };
6138 +};
6139 +
6140 &uart0 {
6141 pinctrl-names = "default";
6142 pinctrl-0 = <&uart0_pins_a>;
6143 diff --git a/arch/arm/dts/sun8i-h3-orangepi-plus.dts b/arch/arm/dts/sun8i-h3-orangepi-plus.dts
6144 index 1cb6c66..900ec4f 100644
6145 --- a/arch/arm/dts/sun8i-h3-orangepi-plus.dts
6146 +++ b/arch/arm/dts/sun8i-h3-orangepi-plus.dts
6147 @@ -45,6 +45,7 @@
6148 #include "sunxi-common-regulators.dtsi"
6149
6150 #include <dt-bindings/gpio/gpio.h>
6151 +#include <dt-bindings/input/input.h>
6152 #include <dt-bindings/pinctrl/sun4i-a10.h>
6153
6154 / {
6155 @@ -70,6 +71,68 @@
6156 enable-active-high;
6157 gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>;
6158 };
6159 +
6160 + leds {
6161 + compatible = "gpio-leds";
6162 + pinctrl-names = "default";
6163 + pinctrl-0 = <&leds_opc>;
6164 +
6165 + status_led {
6166 + label = "status:red:user";
6167 + gpios = <&pio 0 15 GPIO_ACTIVE_HIGH>;
6168 + };
6169 + };
6170 +
6171 + r_leds {
6172 + compatible = "gpio-leds";
6173 + pinctrl-names = "default";
6174 + pinctrl-0 = <&leds_r_opc>;
6175 +
6176 + tx {
6177 + label = "pwr:green:user";
6178 + gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
6179 + default-state = "on";
6180 + };
6181 + };
6182 +
6183 + r_gpio_keys {
6184 + compatible = "gpio-keys";
6185 + input-name = "sw4";
6186 +
6187 + pinctrl-names = "default";
6188 + pinctrl-0 = <&sw_r_opc>;
6189 +
6190 + sw4@0 {
6191 + label = "sw4";
6192 + linux,code = <BTN_0>;
6193 + gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
6194 + };
6195 + };
6196 +};
6197 +
6198 +&pio {
6199 + leds_opc: led_pins@0 {
6200 + allwinner,pins = "PA15";
6201 + allwinner,function = "gpio_out";
6202 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
6203 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
6204 + };
6205 +};
6206 +
6207 +&r_pio {
6208 + leds_r_opc: led_pins@0 {
6209 + allwinner,pins = "PL10";
6210 + allwinner,function = "gpio_out";
6211 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
6212 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
6213 + };
6214 +
6215 + sw_r_opc: key_pins@0 {
6216 + allwinner,pins = "PL03";
6217 + allwinner,function = "gpio_in";
6218 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
6219 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
6220 + };
6221 };
6222
6223 &ehci1 {
6224 diff --git a/arch/arm/dts/sun8i-h3.dtsi b/arch/arm/dts/sun8i-h3.dtsi
6225 index 0faa38a..c2f63c5 100644
6226 --- a/arch/arm/dts/sun8i-h3.dtsi
6227 +++ b/arch/arm/dts/sun8i-h3.dtsi
6228 @@ -83,12 +83,6 @@
6229 <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
6230 <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
6231 <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
6232 - clock-frequency = <24000000>;
6233 - arm,cpu-registers-not-fw-configured;
6234 - };
6235 -
6236 - memory {
6237 - reg = <0x40000000 0x80000000>;
6238 };
6239
6240 clocks {
6241 @@ -131,15 +125,24 @@
6242 compatible = "allwinner,sun6i-a31-pll6-clk";
6243 reg = <0x01c20028 0x4>;
6244 clocks = <&osc24M>;
6245 - clock-output-names = "pll6", "pll6x2", "pll6d2";
6246 + clock-output-names = "pll6", "pll6x2";
6247 };
6248
6249 - pll8: clk@01c20044 {
6250 - #clock-cells = <1>;
6251 - compatible = "allwinner,sun6i-a31-pll6-clk";
6252 - reg = <0x01c20044 0x4>;
6253 - clocks = <&osc24M>;
6254 - clock-output-names = "pll8", "pll8x2";
6255 + pll6d2: pll6d2_clk {
6256 + #clock-cells = <0>;
6257 + compatible = "fixed-factor-clock";
6258 + clock-div = <2>;
6259 + clock-mult = <1>;
6260 + clocks = <&pll6 0>;
6261 + clock-output-names = "pll6d2";
6262 + };
6263 +
6264 + /* dummy clock until pll6 can be reused */
6265 + pll8: pll8_clk {
6266 + #clock-cells = <0>;
6267 + compatible = "fixed-clock";
6268 + clock-frequency = <1>;
6269 + clock-output-names = "pll8";
6270 };
6271
6272 cpu: cpu_clk@01c20050 {
6273 @@ -170,7 +173,7 @@
6274 #clock-cells = <0>;
6275 compatible = "allwinner,sun8i-h3-ahb2-clk";
6276 reg = <0x01c2005c 0x4>;
6277 - clocks = <&ahb1>, <&pll6 2>;
6278 + clocks = <&ahb1>, <&pll6d2>;
6279 clock-output-names = "ahb2";
6280 };
6281
6282 @@ -213,34 +216,34 @@
6283 <76>, <77>, <78>,
6284 <96>, <97>, <98>,
6285 <112>, <113>,
6286 - <114>, <115>, <116>,
6287 - <128>, <135>;
6288 - clock-output-names = "ahb1_ce", "ahb1_dma", "ahb1_mmc0",
6289 - "ahb1_mmc1", "ahb1_mmc2", "ahb1_nand",
6290 - "ahb1_sdram", "ahb2_gmac", "ahb1_ts",
6291 - "ahb1_hstimer", "ahb1_spi0",
6292 - "ahb1_spi1", "ahb1_otg",
6293 - "ahb1_otg_ehci0", "ahb1_ehic1",
6294 - "ahb1_ehic2", "ahb1_ehic3",
6295 - "ahb1_otg_ohci0", "ahb2_ohic1",
6296 - "ahb2_ohic2", "ahb2_ohic3", "ahb1_ve",
6297 - "ahb1_lcd0", "ahb1_lcd1", "ahb1_deint",
6298 - "ahb1_csi", "ahb1_tve", "ahb1_hdmi",
6299 - "ahb1_de", "ahb1_gpu", "ahb1_msgbox",
6300 - "ahb1_spinlock", "apb1_codec",
6301 - "apb1_spdif", "apb1_pio", "apb1_ths",
6302 - "apb1_i2s0", "apb1_i2s1", "apb1_i2s2",
6303 - "apb2_i2c0", "apb2_i2c1", "apb2_i2c2",
6304 - "apb2_uart0", "apb2_uart1",
6305 - "apb2_uart2", "apb2_uart3", "apb2_scr",
6306 - "ahb1_ephy", "ahb1_dbg";
6307 + <114>, <115>,
6308 + <116>, <128>, <135>;
6309 + clock-output-names = "bus_ce", "bus_dma", "bus_mmc0",
6310 + "bus_mmc1", "bus_mmc2", "bus_nand",
6311 + "bus_sdram", "bus_gmac", "bus_ts",
6312 + "bus_hstimer", "bus_spi0",
6313 + "bus_spi1", "bus_otg",
6314 + "bus_otg_ehci0", "bus_ehci1",
6315 + "bus_ehci2", "bus_ehci3",
6316 + "bus_otg_ohci0", "bus_ohci1",
6317 + "bus_ohci2", "bus_ohci3", "bus_ve",
6318 + "bus_lcd0", "bus_lcd1", "bus_deint",
6319 + "bus_csi", "bus_tve", "bus_hdmi",
6320 + "bus_de", "bus_gpu", "bus_msgbox",
6321 + "bus_spinlock", "bus_codec",
6322 + "bus_spdif", "bus_pio", "bus_ths",
6323 + "bus_i2s0", "bus_i2s1", "bus_i2s2",
6324 + "bus_i2c0", "bus_i2c1", "bus_i2c2",
6325 + "bus_uart0", "bus_uart1",
6326 + "bus_uart2", "bus_uart3",
6327 + "bus_scr", "bus_ephy", "bus_dbg";
6328 };
6329
6330 mmc0_clk: clk@01c20088 {
6331 #clock-cells = <1>;
6332 compatible = "allwinner,sun4i-a10-mmc-clk";
6333 reg = <0x01c20088 0x4>;
6334 - clocks = <&osc24M>, <&pll6 0>, <&pll8 0>;
6335 + clocks = <&osc24M>, <&pll6 0>, <&pll8>;
6336 clock-output-names = "mmc0",
6337 "mmc0_output",
6338 "mmc0_sample";
6339 @@ -250,7 +253,7 @@
6340 #clock-cells = <1>;
6341 compatible = "allwinner,sun4i-a10-mmc-clk";
6342 reg = <0x01c2008c 0x4>;
6343 - clocks = <&osc24M>, <&pll6 0>, <&pll8 0>;
6344 + clocks = <&osc24M>, <&pll6 0>, <&pll8>;
6345 clock-output-names = "mmc1",
6346 "mmc1_output",
6347 "mmc1_sample";
6348 @@ -260,7 +263,7 @@
6349 #clock-cells = <1>;
6350 compatible = "allwinner,sun4i-a10-mmc-clk";
6351 reg = <0x01c20090 0x4>;
6352 - clocks = <&osc24M>, <&pll6 0>, <&pll8 0>;
6353 + clocks = <&osc24M>, <&pll6 0>, <&pll8>;
6354 clock-output-names = "mmc2",
6355 "mmc2_output",
6356 "mmc2_sample";
6357 @@ -285,6 +288,33 @@
6358 clocks = <&osc24M>, <&pll6 1>, <&pll5>;
6359 clock-output-names = "mbus";
6360 };
6361 +
6362 + apb0: apb0_clk {
6363 + compatible = "fixed-factor-clock";
6364 + #clock-cells = <0>;
6365 + clock-div = <1>;
6366 + clock-mult = <1>;
6367 + clocks = <&osc24M>;
6368 + clock-output-names = "apb0";
6369 + };
6370 +
6371 + apb0_gates: clk@01f01428 {
6372 + compatible = "allwinner,sun8i-h3-apb0-gates-clk",
6373 + "allwinner,sun4i-a10-gates-clk";
6374 + reg = <0x01f01428 0x4>;
6375 + #clock-cells = <1>;
6376 + clocks = <&apb0>;
6377 + clock-indices = <0>, <1>;
6378 + clock-output-names = "apb0_pio", "apb0_ir";
6379 + };
6380 +
6381 + ir_clk: ir_clk@01f01454 {
6382 + compatible = "allwinner,sun4i-a10-mod0-clk";
6383 + reg = <0x01f01454 0x4>;
6384 + #clock-cells = <0>;
6385 + clocks = <&osc32k>, <&osc24M>;
6386 + clock-output-names = "ir";
6387 + };
6388 };
6389
6390 soc {
6391 @@ -298,7 +328,7 @@
6392 reg = <0x01c02000 0x1000>;
6393 interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
6394 clocks = <&bus_gates 6>;
6395 - resets = <&bus_rst 6>;
6396 + resets = <&ahb_rst 6>;
6397 #dma-cells = <1>;
6398 };
6399
6400 @@ -313,7 +343,7 @@
6401 "mmc",
6402 "output",
6403 "sample";
6404 - resets = <&bus_rst 8>;
6405 + resets = <&ahb_rst 8>;
6406 reset-names = "ahb";
6407 interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
6408 status = "disabled";
6409 @@ -332,7 +362,7 @@
6410 "mmc",
6411 "output",
6412 "sample";
6413 - resets = <&bus_rst 9>;
6414 + resets = <&ahb_rst 9>;
6415 reset-names = "ahb";
6416 interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
6417 status = "disabled";
6418 @@ -351,7 +381,7 @@
6419 "mmc",
6420 "output",
6421 "sample";
6422 - resets = <&bus_rst 10>;
6423 + resets = <&ahb_rst 10>;
6424 reset-names = "ahb";
6425 interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
6426 status = "disabled";
6427 @@ -396,7 +426,7 @@
6428 reg = <0x01c1b000 0x100>;
6429 interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
6430 clocks = <&bus_gates 25>, <&bus_gates 29>;
6431 - resets = <&bus_rst 25>, <&bus_rst 29>;
6432 + resets = <&ahb_rst 25>, <&ahb_rst 29>;
6433 phys = <&usbphy 1>;
6434 phy-names = "usb";
6435 status = "disabled";
6436 @@ -408,7 +438,7 @@
6437 interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>;
6438 clocks = <&bus_gates 29>, <&bus_gates 25>,
6439 <&usb_clk 17>;
6440 - resets = <&bus_rst 29>, <&bus_rst 25>;
6441 + resets = <&ahb_rst 29>, <&ahb_rst 25>;
6442 phys = <&usbphy 1>;
6443 phy-names = "usb";
6444 status = "disabled";
6445 @@ -419,7 +449,7 @@
6446 reg = <0x01c1c000 0x100>;
6447 interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
6448 clocks = <&bus_gates 26>, <&bus_gates 30>;
6449 - resets = <&bus_rst 26>, <&bus_rst 30>;
6450 + resets = <&ahb_rst 26>, <&ahb_rst 30>;
6451 phys = <&usbphy 2>;
6452 phy-names = "usb";
6453 status = "disabled";
6454 @@ -431,7 +461,7 @@
6455 interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
6456 clocks = <&bus_gates 30>, <&bus_gates 26>,
6457 <&usb_clk 18>;
6458 - resets = <&bus_rst 30>, <&bus_rst 26>;
6459 + resets = <&ahb_rst 30>, <&ahb_rst 26>;
6460 phys = <&usbphy 2>;
6461 phy-names = "usb";
6462 status = "disabled";
6463 @@ -442,7 +472,7 @@
6464 reg = <0x01c1d000 0x100>;
6465 interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>;
6466 clocks = <&bus_gates 27>, <&bus_gates 31>;
6467 - resets = <&bus_rst 27>, <&bus_rst 31>;
6468 + resets = <&ahb_rst 27>, <&ahb_rst 31>;
6469 phys = <&usbphy 3>;
6470 phy-names = "usb";
6471 status = "disabled";
6472 @@ -454,7 +484,7 @@
6473 interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>;
6474 clocks = <&bus_gates 31>, <&bus_gates 27>,
6475 <&usb_clk 19>;
6476 - resets = <&bus_rst 31>, <&bus_rst 27>;
6477 + resets = <&ahb_rst 31>, <&ahb_rst 27>;
6478 phys = <&usbphy 3>;
6479 phy-names = "usb";
6480 status = "disabled";
6481 @@ -469,7 +499,7 @@
6482 gpio-controller;
6483 #gpio-cells = <3>;
6484 interrupt-controller;
6485 - #interrupt-cells = <2>;
6486 + #interrupt-cells = <3>;
6487
6488 uart0_pins_a: uart0@0 {
6489 allwinner,pins = "PA4", "PA5";
6490 @@ -502,10 +532,22 @@
6491 };
6492 };
6493
6494 - bus_rst: reset@01c202c0 {
6495 + ahb_rst: reset@01c202c0 {
6496 #reset-cells = <1>;
6497 - compatible = "allwinner,sun8i-h3-bus-reset";
6498 - reg = <0x01c202c0 0x1c>;
6499 + compatible = "allwinner,sun6i-a31-ahb1-reset";
6500 + reg = <0x01c202c0 0xc>;
6501 + };
6502 +
6503 + apb1_rst: reset@01c202d0 {
6504 + #reset-cells = <1>;
6505 + compatible = "allwinner,sun6i-a31-clock-reset";
6506 + reg = <0x01c202d0 0x4>;
6507 + };
6508 +
6509 + apb2_rst: reset@01c202d8 {
6510 + #reset-cells = <1>;
6511 + compatible = "allwinner,sun6i-a31-clock-reset";
6512 + reg = <0x01c202d8 0x4>;
6513 };
6514
6515 timer@01c20c00 {
6516 @@ -529,7 +571,7 @@
6517 reg-shift = <2>;
6518 reg-io-width = <4>;
6519 clocks = <&bus_gates 112>;
6520 - resets = <&bus_rst 144>;
6521 + resets = <&apb2_rst 16>;
6522 dmas = <&dma 6>, <&dma 6>;
6523 dma-names = "rx", "tx";
6524 status = "disabled";
6525 @@ -542,7 +584,7 @@
6526 reg-shift = <2>;
6527 reg-io-width = <4>;
6528 clocks = <&bus_gates 113>;
6529 - resets = <&bus_rst 145>;
6530 + resets = <&apb2_rst 17>;
6531 dmas = <&dma 7>, <&dma 7>;
6532 dma-names = "rx", "tx";
6533 status = "disabled";
6534 @@ -555,7 +597,7 @@
6535 reg-shift = <2>;
6536 reg-io-width = <4>;
6537 clocks = <&bus_gates 114>;
6538 - resets = <&bus_rst 146>;
6539 + resets = <&apb2_rst 18>;
6540 dmas = <&dma 8>, <&dma 8>;
6541 dma-names = "rx", "tx";
6542 status = "disabled";
6543 @@ -568,7 +610,7 @@
6544 reg-shift = <2>;
6545 reg-io-width = <4>;
6546 clocks = <&bus_gates 115>;
6547 - resets = <&bus_rst 147>;
6548 + resets = <&apb2_rst 19>;
6549 dmas = <&dma 9>, <&dma 9>;
6550 dma-names = "rx", "tx";
6551 status = "disabled";
6552 @@ -591,5 +633,40 @@
6553 interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
6554 <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
6555 };
6556 +
6557 + apb0_reset: reset@01f014b0 {
6558 + reg = <0x01f014b0 0x4>;
6559 + compatible = "allwinner,sun6i-a31-clock-reset";
6560 + #reset-cells = <1>;
6561 + };
6562 +
6563 + ir: ir@01f02000 {
6564 + compatible = "allwinner,sun5i-a13-ir";
6565 + clocks = <&apb0_gates 1>, <&ir_clk>;
6566 + clock-names = "apb", "ir";
6567 + resets = <&apb0_reset 1>;
6568 + interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
6569 + reg = <0x01f02000 0x40>;
6570 + status = "disabled";
6571 + };
6572 +
6573 + r_pio: pinctrl@01f02c00 {
6574 + compatible = "allwinner,sun8i-h3-r-pinctrl";
6575 + reg = <0x01f02c00 0x400>;
6576 + interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
6577 + clocks = <&apb0_gates 0>;
6578 + resets = <&apb0_reset 0>;
6579 + gpio-controller;
6580 + #gpio-cells = <3>;
6581 + interrupt-controller;
6582 + #interrupt-cells = <3>;
6583 +
6584 + ir_pins_a: ir@0 {
6585 + allwinner,pins = "PL11";
6586 + allwinner,function = "s_cir_rx";
6587 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
6588 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
6589 + };
6590 + };
6591 };
6592 };
6593 diff --git a/arch/arm/dts/sun8i-q8-common.dtsi b/arch/arm/dts/sun8i-q8-common.dtsi
6594 index 07cd268..346a49d 100644
6595 --- a/arch/arm/dts/sun8i-q8-common.dtsi
6596 +++ b/arch/arm/dts/sun8i-q8-common.dtsi
6597 @@ -41,11 +41,23 @@
6598 */
6599 #include "sunxi-q8-common.dtsi"
6600
6601 +#include <dt-bindings/pwm/pwm.h>
6602 +
6603 / {
6604 aliases {
6605 serial0 = &r_uart;
6606 };
6607
6608 + backlight: backlight {
6609 + compatible = "pwm-backlight";
6610 + pinctrl-names = "default";
6611 + pinctrl-0 = <&bl_en_pin_q8>;
6612 + pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
6613 + brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
6614 + default-brightness-level = <8>;
6615 + enable-gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
6616 + };
6617 +
6618 chosen {
6619 stdout-path = "serial0:115200n8";
6620 };
6621 @@ -54,7 +66,7 @@
6622 &mmc0 {
6623 pinctrl-names = "default";
6624 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_q8>;
6625 - vmmc-supply = <&reg_vcc3v0>;
6626 + vmmc-supply = <&reg_dcdc1>;
6627 bus-width = <4>;
6628 cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */
6629 cd-inverted;
6630 @@ -77,8 +89,90 @@
6631 };
6632 };
6633
6634 +&r_rsb {
6635 + status = "okay";
6636 +
6637 + axp22x: pmic@3a3 {
6638 + compatible = "x-powers,axp223";
6639 + reg = <0x3a3>;
6640 + interrupt-parent = <&nmi_intc>;
6641 + interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
6642 + eldoin-supply = <&reg_dcdc1>;
6643 + };
6644 +};
6645 +
6646 +#include "axp22x.dtsi"
6647 +
6648 +&reg_aldo1 {
6649 + regulator-always-on;
6650 + regulator-min-microvolt = <3000000>;
6651 + regulator-max-microvolt = <3000000>;
6652 + regulator-name = "vcc-io";
6653 +};
6654 +
6655 +&reg_aldo2 {
6656 + regulator-always-on;
6657 + regulator-min-microvolt = <2350000>;
6658 + regulator-max-microvolt = <2650000>;
6659 + regulator-name = "vdd-dll";
6660 +};
6661 +
6662 +&reg_aldo3 {
6663 + regulator-always-on;
6664 + regulator-min-microvolt = <2700000>;
6665 + regulator-max-microvolt = <3300000>;
6666 + regulator-name = "vcc-pll-avcc";
6667 +};
6668 +
6669 +&reg_dc1sw {
6670 + regulator-name = "vcc-lcd";
6671 +};
6672 +
6673 +&reg_dc5ldo {
6674 + regulator-always-on;
6675 + regulator-min-microvolt = <900000>;
6676 + regulator-max-microvolt = <1400000>;
6677 + regulator-name = "vdd-cpus";
6678 +};
6679 +
6680 +&reg_dcdc1 {
6681 + regulator-always-on;
6682 + regulator-min-microvolt = <3000000>;
6683 + regulator-max-microvolt = <3000000>;
6684 + regulator-name = "vcc-3v0";
6685 +};
6686 +
6687 +&reg_dcdc2 {
6688 + regulator-always-on;
6689 + regulator-min-microvolt = <900000>;
6690 + regulator-max-microvolt = <1400000>;
6691 + regulator-name = "vdd-sys";
6692 +};
6693 +
6694 +&reg_dcdc3 {
6695 + regulator-always-on;
6696 + regulator-min-microvolt = <900000>;
6697 + regulator-max-microvolt = <1400000>;
6698 + regulator-name = "vdd-cpu";
6699 +};
6700 +
6701 +&reg_dcdc5 {
6702 + regulator-always-on;
6703 + regulator-min-microvolt = <1500000>;
6704 + regulator-max-microvolt = <1500000>;
6705 + regulator-name = "vcc-dram";
6706 +};
6707 +
6708 +&reg_rtc_ldo {
6709 + regulator-name = "vcc-rtc";
6710 +};
6711 +
6712 &r_uart {
6713 pinctrl-names = "default";
6714 pinctrl-0 = <&r_uart_pins_a>;
6715 status = "okay";
6716 };
6717 +
6718 +&simplefb_lcd {
6719 + vcc-lcd-supply = <&reg_dc1sw>;
6720 +};
6721 diff --git a/arch/arm/dts/sun9i-a80-cubieboard4.dts b/arch/arm/dts/sun9i-a80-cubieboard4.dts
6722 index 6484dcf..eb2ccd0 100644
6723 --- a/arch/arm/dts/sun9i-a80-cubieboard4.dts
6724 +++ b/arch/arm/dts/sun9i-a80-cubieboard4.dts
6725 @@ -62,9 +62,31 @@
6726 stdout-path = "serial0:115200n8";
6727 };
6728
6729 + leds {
6730 + compatible = "gpio-leds";
6731 + pinctrl-names = "default";
6732 + pinctrl-0 = <&led_pins_cubieboard4>;
6733 +
6734 + green {
6735 + label = "cubieboard4:green:usr";
6736 + gpios = <&pio 7 17 GPIO_ACTIVE_HIGH>; /* PH17 */
6737 + };
6738 +
6739 + red {
6740 + label = "cubieboard4:red:usr";
6741 + gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
6742 + };
6743 + };
6744 };
6745
6746 &pio {
6747 + led_pins_cubieboard4: led-pins@0 {
6748 + allwinner,pins = "PH6", "PH17";
6749 + allwinner,function = "gpio_out";
6750 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
6751 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
6752 + };
6753 +
6754 mmc0_cd_pin_cubieboard4: mmc0_cd_pin@0 {
6755 allwinner,pins = "PH18";
6756 allwinner,function = "gpio_in";
6757 @@ -89,6 +111,20 @@
6758 vmmc-supply = <&reg_vcc3v0>;
6759 bus-width = <8>;
6760 non-removable;
6761 + cap-mmc-hw-reset;
6762 + status = "okay";
6763 +};
6764 +
6765 +&mmc2_8bit_pins {
6766 + /* Increase drive strength for DDR modes */
6767 + allwinner,drive = <SUN4I_PINCTRL_40_MA>;
6768 +};
6769 +
6770 +&r_ir {
6771 + status = "okay";
6772 +};
6773 +
6774 +&r_rsb {
6775 status = "okay";
6776 };
6777
6778 diff --git a/arch/arm/dts/sun9i-a80-optimus.dts b/arch/arm/dts/sun9i-a80-optimus.dts
6779 index 6ce4b5e..d7a20d9 100644
6780 --- a/arch/arm/dts/sun9i-a80-optimus.dts
6781 +++ b/arch/arm/dts/sun9i-a80-optimus.dts
6782 @@ -65,7 +65,7 @@
6783 leds {
6784 compatible = "gpio-leds";
6785 pinctrl-names = "default";
6786 - pinctrl-0 = <&led_pins_optimus>;
6787 + pinctrl-0 = <&led_pins_optimus>, <&led_r_pins_optimus>;
6788
6789 /* The LED names match those found on the board */
6790
6791 @@ -74,7 +74,10 @@
6792 gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>;
6793 };
6794
6795 - /* led3 is on PM15, in R_PIO */
6796 + led3 {
6797 + label = "optimus:led3:usr";
6798 + gpios = <&r_pio 1 15 GPIO_ACTIVE_HIGH>; /* PM15 */
6799 + };
6800
6801 led4 {
6802 label = "optimus:led4:usr";
6803 @@ -106,17 +109,6 @@
6804 status = "okay";
6805 };
6806
6807 -&i2c3 {
6808 - pinctrl-names = "default";
6809 - pinctrl-0 = <&i2c3_pins_a>;
6810 - status = "okay";
6811 -};
6812 -
6813 -&i2c3_pins_a {
6814 - /* Enable internal pull-up */
6815 - allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
6816 -};
6817 -
6818 &ohci0 {
6819 status = "okay";
6820 };
6821 @@ -171,30 +163,42 @@
6822 vmmc-supply = <&reg_vcc3v0>;
6823 bus-width = <8>;
6824 non-removable;
6825 + cap-mmc-hw-reset;
6826 status = "okay";
6827 };
6828
6829 +&mmc2_8bit_pins {
6830 + /* Increase drive strength for DDR modes */
6831 + allwinner,drive = <SUN4I_PINCTRL_40_MA>;
6832 +};
6833 +
6834 &reg_usb1_vbus {
6835 pinctrl-0 = <&usb1_vbus_pin_optimus>;
6836 gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
6837 status = "okay";
6838 };
6839
6840 -&uart0 {
6841 - pinctrl-names = "default";
6842 - pinctrl-0 = <&uart0_pins_a>;
6843 +&r_ir {
6844 status = "okay";
6845 };
6846
6847 -&uart4 {
6848 - pinctrl-names = "default";
6849 - pinctrl-0 = <&uart4_pins_a>;
6850 +&r_pio {
6851 + led_r_pins_optimus: led-pins@1 {
6852 + allwinner,pins = "PM15";
6853 + allwinner,function = "gpio_out";
6854 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
6855 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
6856 + };
6857 +};
6858 +
6859 +&r_rsb {
6860 status = "okay";
6861 };
6862
6863 -&uart4_pins_a {
6864 - /* Enable internal pull-up */
6865 - allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
6866 +&uart0 {
6867 + pinctrl-names = "default";
6868 + pinctrl-0 = <&uart0_pins_a>;
6869 + status = "okay";
6870 };
6871
6872 &usbphy1 {
6873 diff --git a/arch/arm/dts/sun9i-a80.dtsi b/arch/arm/dts/sun9i-a80.dtsi
6874 index a43ad77..f68b324 100644
6875 --- a/arch/arm/dts/sun9i-a80.dtsi
6876 +++ b/arch/arm/dts/sun9i-a80.dtsi
6877 @@ -128,6 +128,17 @@
6878 */
6879 ranges = <0 0 0 0x20000000>;
6880
6881 + /*
6882 + * This clock is actually configurable from the PRCM address
6883 + * space. The external 24M oscillator can be turned off, and
6884 + * the clock switched to an internal 16M RC oscillator. Under
6885 + * normal operation there's no reason to do this, and the
6886 + * default is to use the external good one, so just model this
6887 + * as a fixed clock. Also it is not entirely clear if the
6888 + * osc24M mux in the PRCM affects the entire clock tree, which
6889 + * would also throw all the PLL clock rates off, or just the
6890 + * downstream clocks in the PRCM.
6891 + */
6892 osc24M: osc24M_clk {
6893 #clock-cells = <0>;
6894 compatible = "fixed-clock";
6895 @@ -135,6 +146,13 @@
6896 clock-output-names = "osc24M";
6897 };
6898
6899 + /*
6900 + * The 32k clock is from an external source, normally the
6901 + * AC100 codec/RTC chip. This clock is by default enabled
6902 + * and clocked at 32768 Hz, from the oscillator connected
6903 + * to the AC100. It is configurable, but no such driver or
6904 + * bindings exist yet.
6905 + */
6906 osc32k: osc32k_clk {
6907 #clock-cells = <0>;
6908 compatible = "fixed-clock";
6909 @@ -164,6 +182,14 @@
6910 "usb_phy2", "usb_hsic_12M";
6911 };
6912
6913 + pll3: clk@06000008 {
6914 + /* placeholder until implemented */
6915 + #clock-cells = <0>;
6916 + compatible = "fixed-clock";
6917 + clock-rate = <0>;
6918 + clock-output-names = "pll3";
6919 + };
6920 +
6921 pll4: clk@0600000c {
6922 #clock-cells = <0>;
6923 compatible = "allwinner,sun9i-a80-pll4-clk";
6924 @@ -277,9 +303,12 @@
6925 compatible = "allwinner,sun9i-a80-ahb0-gates-clk";
6926 reg = <0x06000580 0x4>;
6927 clocks = <&ahb0>;
6928 - clock-indices = <0>, <1>, <3>, <5>, <8>, <12>, <13>,
6929 - <14>, <15>, <16>, <18>, <20>, <21>,
6930 - <22>, <23>;
6931 + clock-indices = <0>, <1>, <3>,
6932 + <5>, <8>, <12>,
6933 + <13>, <14>,
6934 + <15>, <16>, <18>,
6935 + <20>, <21>, <22>,
6936 + <23>;
6937 clock-output-names = "ahb0_fd", "ahb0_ve", "ahb0_gpu",
6938 "ahb0_ss", "ahb0_sd", "ahb0_nand1",
6939 "ahb0_nand0", "ahb0_sdram",
6940 @@ -293,7 +322,10 @@
6941 compatible = "allwinner,sun9i-a80-ahb1-gates-clk";
6942 reg = <0x06000584 0x4>;
6943 clocks = <&ahb1>;
6944 - clock-indices = <0>, <1>, <17>, <21>, <22>, <23>, <24>;
6945 + clock-indices = <0>, <1>,
6946 + <17>, <21>,
6947 + <22>, <23>,
6948 + <24>;
6949 clock-output-names = "ahb1_usbotg", "ahb1_usbhci",
6950 "ahb1_gmac", "ahb1_msgbox",
6951 "ahb1_spinlock", "ahb1_hstimer",
6952 @@ -305,8 +337,9 @@
6953 compatible = "allwinner,sun9i-a80-ahb2-gates-clk";
6954 reg = <0x06000588 0x4>;
6955 clocks = <&ahb2>;
6956 - clock-indices = <0>, <1>, <2>, <4>, <5>, <7>, <8>,
6957 - <11>;
6958 + clock-indices = <0>, <1>,
6959 + <2>, <4>, <5>,
6960 + <7>, <8>, <11>;
6961 clock-output-names = "ahb2_lcd0", "ahb2_lcd1",
6962 "ahb2_edp", "ahb2_csi", "ahb2_hdmi",
6963 "ahb2_de", "ahb2_mp", "ahb2_mipi_dsi";
6964 @@ -317,8 +350,10 @@
6965 compatible = "allwinner,sun9i-a80-apb0-gates-clk";
6966 reg = <0x06000590 0x4>;
6967 clocks = <&apb0>;
6968 - clock-indices = <1>, <5>, <11>, <12>, <13>, <15>,
6969 - <17>, <18>, <19>;
6970 + clock-indices = <1>, <5>,
6971 + <11>, <12>, <13>,
6972 + <15>, <17>, <18>,
6973 + <19>;
6974 clock-output-names = "apb0_spdif", "apb0_pio",
6975 "apb0_ac97", "apb0_i2s0", "apb0_i2s1",
6976 "apb0_lradc", "apb0_gpadc", "apb0_twd",
6977 @@ -330,14 +365,79 @@
6978 compatible = "allwinner,sun9i-a80-apb1-gates-clk";
6979 reg = <0x06000594 0x4>;
6980 clocks = <&apb1>;
6981 - clock-indices = <0>, <1>, <2>, <3>, <4>,
6982 - <16>, <17>, <18>, <19>, <20>, <21>;
6983 + clock-indices = <0>, <1>,
6984 + <2>, <3>, <4>,
6985 + <16>, <17>,
6986 + <18>, <19>,
6987 + <20>, <21>;
6988 clock-output-names = "apb1_i2c0", "apb1_i2c1",
6989 "apb1_i2c2", "apb1_i2c3", "apb1_i2c4",
6990 "apb1_uart0", "apb1_uart1",
6991 "apb1_uart2", "apb1_uart3",
6992 "apb1_uart4", "apb1_uart5";
6993 };
6994 +
6995 + cpus_clk: clk@08001410 {
6996 + compatible = "allwinner,sun9i-a80-cpus-clk";
6997 + reg = <0x08001410 0x4>;
6998 + #clock-cells = <0>;
6999 + clocks = <&osc32k>, <&osc24M>, <&pll4>, <&pll3>;
7000 + clock-output-names = "cpus";
7001 + };
7002 +
7003 + ahbs: ahbs_clk {
7004 + compatible = "fixed-factor-clock";
7005 + #clock-cells = <0>;
7006 + clock-div = <1>;
7007 + clock-mult = <1>;
7008 + clocks = <&cpus_clk>;
7009 + clock-output-names = "ahbs";
7010 + };
7011 +
7012 + apbs: clk@0800141c {
7013 + compatible = "allwinner,sun8i-a23-apb0-clk";
7014 + reg = <0x0800141c 0x4>;
7015 + #clock-cells = <0>;
7016 + clocks = <&ahbs>;
7017 + clock-output-names = "apbs";
7018 + };
7019 +
7020 + apbs_gates: clk@08001428 {
7021 + compatible = "allwinner,sun9i-a80-apbs-gates-clk";
7022 + reg = <0x08001428 0x4>;
7023 + #clock-cells = <1>;
7024 + clocks = <&apbs>;
7025 + clock-indices = <0>, <1>,
7026 + <2>, <3>,
7027 + <4>, <5>,
7028 + <6>, <7>,
7029 + <12>, <13>,
7030 + <16>, <17>,
7031 + <18>, <20>;
7032 + clock-output-names = "apbs_pio", "apbs_ir",
7033 + "apbs_timer", "apbs_rsb",
7034 + "apbs_uart", "apbs_1wire",
7035 + "apbs_i2c0", "apbs_i2c1",
7036 + "apbs_ps2_0", "apbs_ps2_1",
7037 + "apbs_dma", "apbs_i2s0",
7038 + "apbs_i2s1", "apbs_twd";
7039 + };
7040 +
7041 + r_1wire_clk: clk@08001450 {
7042 + reg = <0x08001450 0x4>;
7043 + #clock-cells = <0>;
7044 + compatible = "allwinner,sun4i-a10-mod0-clk";
7045 + clocks = <&osc32k>, <&osc24M>;
7046 + clock-output-names = "r_1wire";
7047 + };
7048 +
7049 + r_ir_clk: clk@08001454 {
7050 + reg = <0x08001454 0x4>;
7051 + #clock-cells = <0>;
7052 + compatible = "allwinner,sun4i-a10-mod0-clk";
7053 + clocks = <&osc32k>, <&osc24M>;
7054 + clock-output-names = "r_ir";
7055 + };
7056 };
7057
7058 soc {
7059 @@ -443,7 +543,7 @@
7060 };
7061
7062 mmc0: mmc@01c0f000 {
7063 - compatible = "allwinner,sun5i-a13-mmc";
7064 + compatible = "allwinner,sun9i-a80-mmc";
7065 reg = <0x01c0f000 0x1000>;
7066 clocks = <&mmc_config_clk 0>, <&mmc0_clk 0>,
7067 <&mmc0_clk 1>, <&mmc0_clk 2>;
7068 @@ -457,7 +557,7 @@
7069 };
7070
7071 mmc1: mmc@01c10000 {
7072 - compatible = "allwinner,sun5i-a13-mmc";
7073 + compatible = "allwinner,sun9i-a80-mmc";
7074 reg = <0x01c10000 0x1000>;
7075 clocks = <&mmc_config_clk 1>, <&mmc1_clk 0>,
7076 <&mmc1_clk 1>, <&mmc1_clk 2>;
7077 @@ -471,7 +571,7 @@
7078 };
7079
7080 mmc2: mmc@01c11000 {
7081 - compatible = "allwinner,sun5i-a13-mmc";
7082 + compatible = "allwinner,sun9i-a80-mmc";
7083 reg = <0x01c11000 0x1000>;
7084 clocks = <&mmc_config_clk 2>, <&mmc2_clk 0>,
7085 <&mmc2_clk 1>, <&mmc2_clk 2>;
7086 @@ -485,7 +585,7 @@
7087 };
7088
7089 mmc3: mmc@01c12000 {
7090 - compatible = "allwinner,sun5i-a13-mmc";
7091 + compatible = "allwinner,sun9i-a80-mmc";
7092 reg = <0x01c12000 0x1000>;
7093 clocks = <&mmc_config_clk 3>, <&mmc3_clk 0>,
7094 <&mmc3_clk 1>, <&mmc3_clk 2>;
7095 @@ -582,7 +682,7 @@
7096 clocks = <&apb0_gates 5>;
7097 gpio-controller;
7098 interrupt-controller;
7099 - #interrupt-cells = <2>;
7100 + #interrupt-cells = <3>;
7101 #size-cells = <0>;
7102 #gpio-cells = <3>;
7103
7104 @@ -604,7 +704,8 @@
7105 mmc2_8bit_pins: mmc2_8bit {
7106 allwinner,pins = "PC6", "PC7", "PC8", "PC9",
7107 "PC10", "PC11", "PC12",
7108 - "PC13", "PC14", "PC15";
7109 + "PC13", "PC14", "PC15",
7110 + "PC16";
7111 allwinner,function = "mmc2";
7112 allwinner,drive = <SUN4I_PINCTRL_30_MA>;
7113 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
7114 @@ -752,14 +853,83 @@
7115 interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
7116 };
7117
7118 + apbs_rst: reset@080014b0 {
7119 + reg = <0x080014b0 0x4>;
7120 + compatible = "allwinner,sun6i-a31-clock-reset";
7121 + #reset-cells = <1>;
7122 + };
7123 +
7124 + nmi_intc: interrupt-controller@080015a0 {
7125 + compatible = "allwinner,sun9i-a80-nmi";
7126 + interrupt-controller;
7127 + #interrupt-cells = <2>;
7128 + reg = <0x080015a0 0xc>;
7129 + interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
7130 + };
7131 +
7132 + r_ir: ir@08002000 {
7133 + compatible = "allwinner,sun5i-a13-ir";
7134 + interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
7135 + pinctrl-names = "default";
7136 + pinctrl-0 = <&r_ir_pins>;
7137 + clocks = <&apbs_gates 1>, <&r_ir_clk>;
7138 + clock-names = "apb", "ir";
7139 + resets = <&apbs_rst 1>;
7140 + reg = <0x08002000 0x40>;
7141 + status = "disabled";
7142 + };
7143 +
7144 r_uart: serial@08002800 {
7145 compatible = "snps,dw-apb-uart";
7146 reg = <0x08002800 0x400>;
7147 interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>;
7148 reg-shift = <2>;
7149 reg-io-width = <4>;
7150 - clocks = <&osc24M>;
7151 + clocks = <&apbs_gates 4>;
7152 + resets = <&apbs_rst 4>;
7153 status = "disabled";
7154 };
7155 +
7156 + r_pio: pinctrl@08002c00 {
7157 + compatible = "allwinner,sun9i-a80-r-pinctrl";
7158 + reg = <0x08002c00 0x400>;
7159 + interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>,
7160 + <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
7161 + clocks = <&apbs_gates 0>;
7162 + resets = <&apbs_rst 0>;
7163 + gpio-controller;
7164 + interrupt-controller;
7165 + #address-cells = <1>;
7166 + #size-cells = <0>;
7167 + #gpio-cells = <3>;
7168 +
7169 + r_ir_pins: r_ir {
7170 + allwinner,pins = "PL6";
7171 + allwinner,function = "s_cir_rx";
7172 + allwinner,drive = <SUN4I_PINCTRL_10_MA>;
7173 + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
7174 + };
7175 +
7176 + r_rsb_pins: r_rsb {
7177 + allwinner,pins = "PN0", "PN1";
7178 + allwinner,function = "s_rsb";
7179 + allwinner,drive = <SUN4I_PINCTRL_20_MA>;
7180 + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
7181 + };
7182 + };
7183 +
7184 + r_rsb: i2c@08003400 {
7185 + compatible = "allwinner,sun8i-a23-rsb";
7186 + reg = <0x08003400 0x400>;
7187 + interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>;
7188 + clocks = <&apbs_gates 3>;
7189 + clock-frequency = <3000000>;
7190 + resets = <&apbs_rst 3>;
7191 + pinctrl-names = "default";
7192 + pinctrl-0 = <&r_rsb_pins>;
7193 + status = "disabled";
7194 + #address-cells = <1>;
7195 + #size-cells = <0>;
7196 + };
7197 };
7198 };
7199 diff --git a/arch/arm/dts/sunxi-itead-core-common.dtsi b/arch/arm/dts/sunxi-itead-core-common.dtsi
7200 new file mode 100644
7201 index 0000000..2565d51
7202 --- /dev/null
7203 +++ b/arch/arm/dts/sunxi-itead-core-common.dtsi
7204 @@ -0,0 +1,136 @@
7205 +/*
7206 + * Copyright 2015 - Marcus Cooper <codekipper@gmail.com>
7207 + *
7208 + * This file is dual-licensed: you can use it either under the terms
7209 + * of the GPL or the X11 license, at your option. Note that this dual
7210 + * licensing only applies to this file, and not this project as a
7211 + * whole.
7212 + *
7213 + * a) This file is free software; you can redistribute it and/or
7214 + * modify it under the terms of the GNU General Public License as
7215 + * published by the Free Software Foundation; either version 2 of the
7216 + * License, or (at your option) any later version.
7217 + *
7218 + * This file is distributed in the hope that it will be useful,
7219 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
7220 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7221 + * GNU General Public License for more details.
7222 + *
7223 + * Or, alternatively,
7224 + *
7225 + * b) Permission is hereby granted, free of charge, to any person
7226 + * obtaining a copy of this software and associated documentation
7227 + * files (the "Software"), to deal in the Software without
7228 + * restriction, including without limitation the rights to use,
7229 + * copy, modify, merge, publish, distribute, sublicense, and/or
7230 + * sell copies of the Software, and to permit persons to whom the
7231 + * Software is furnished to do so, subject to the following
7232 + * conditions:
7233 + *
7234 + * The above copyright notice and this permission notice shall be
7235 + * included in all copies or substantial portions of the Software.
7236 + *
7237 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
7238 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
7239 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
7240 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
7241 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
7242 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
7243 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
7244 + * OTHER DEALINGS IN THE SOFTWARE.
7245 + */
7246 +
7247 +#include "sunxi-common-regulators.dtsi"
7248 +
7249 +/ {
7250 + aliases {
7251 + serial0 = &uart0;
7252 + };
7253 +
7254 + chosen {
7255 + stdout-path = "serial0:115200n8";
7256 + };
7257 +};
7258 +
7259 +&cpu0 {
7260 + cpu-supply = <&reg_dcdc2>;
7261 +};
7262 +
7263 +&ehci0 {
7264 + status = "okay";
7265 +};
7266 +
7267 +&ehci1 {
7268 + status = "okay";
7269 +};
7270 +
7271 +&i2c0 {
7272 + pinctrl-names = "default";
7273 + pinctrl-0 = <&i2c0_pins_a>;
7274 + status = "okay";
7275 +
7276 + axp209: pmic@34 {
7277 + reg = <0x34>;
7278 + };
7279 +};
7280 +
7281 +&i2c1 {
7282 + pinctrl-names = "default";
7283 + pinctrl-0 = <&i2c1_pins_a>;
7284 + status = "okay";
7285 +};
7286 +
7287 +&ohci0 {
7288 + status = "okay";
7289 +};
7290 +
7291 +&ohci1 {
7292 + status = "okay";
7293 +};
7294 +
7295 +#include "axp209.dtsi"
7296 +
7297 +&reg_dcdc2 {
7298 + regulator-always-on;
7299 + regulator-min-microvolt = <1000000>;
7300 + regulator-max-microvolt = <1400000>;
7301 + regulator-name = "vdd-cpu";
7302 +};
7303 +
7304 +&reg_dcdc3 {
7305 + regulator-always-on;
7306 + regulator-min-microvolt = <1000000>;
7307 + regulator-max-microvolt = <1400000>;
7308 + regulator-name = "vdd-int-dll";
7309 +};
7310 +
7311 +&reg_ldo1 {
7312 + regulator-name = "vdd-rtc";
7313 +};
7314 +
7315 +&reg_ldo2 {
7316 + regulator-always-on;
7317 + regulator-min-microvolt = <3000000>;
7318 + regulator-max-microvolt = <3000000>;
7319 + regulator-name = "avcc";
7320 +};
7321 +
7322 +&reg_usb1_vbus {
7323 + status = "okay";
7324 +};
7325 +
7326 +&reg_usb2_vbus {
7327 + status = "okay";
7328 +};
7329 +
7330 +&uart0 {
7331 + pinctrl-names = "default";
7332 + pinctrl-0 = <&uart0_pins_a>;
7333 + status = "okay";
7334 +};
7335 +
7336 +&usbphy {
7337 + usb1_vbus-supply = <&reg_usb1_vbus>;
7338 + usb2_vbus-supply = <&reg_usb2_vbus>;
7339 + status = "okay";
7340 +};
7341 diff --git a/arch/arm/dts/sunxi-q8-common.dtsi b/arch/arm/dts/sunxi-q8-common.dtsi
7342 index 17b26ff..b824146 100644
7343 --- a/arch/arm/dts/sunxi-q8-common.dtsi
7344 +++ b/arch/arm/dts/sunxi-q8-common.dtsi
7345 @@ -75,3 +75,9 @@
7346 voltage = <400000>;
7347 };
7348 };
7349 +
7350 +&pwm {
7351 + pinctrl-names = "default";
7352 + pinctrl-0 = <&pwm0_pins>;
7353 + status = "okay";
7354 +};