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