Commit graph

16 commits

Author SHA1 Message Date
Siarhei Siamashka 5d0c8b190a ARM: dts: sun4i: Enable USB DRC on pcDuino1/2
Enable the otg/drc usb controller on the pcDuino1/2 board. Note
that the pcDuino1 FEX file from the vendor contains the following
information in the [usbc0] section:
    usb_id_gpio = port:PH04<0><1><default><default>
    usb_det_vbus_gpio = port:PH05<0><0><default><default>
    usb_drv_vbus_gpio = port:PB09<1><0><default><0>
While the pcDuino2 FEX has:
    usb_id_gpio = port:PH04<0><1><default><default>
    usb_det_vbus_gpio = port:PH05<0><0><default><default>
    usb_drv_vbus_gpio = port:PD02<1><0><default><0>

The ID pin is indeed PH4. The PD2 pin can be used to switch power
on/off for the USB Type A receptacle on pcDuino2, but it has nothing
to do with the MicroUSB OTG receptacle. The VBUS pin of the MicroUSB
receptacle is always connected to 5V according to the schematics
(both pcDuino1 and pcDuino2) and confirmed by doing some tests on
pcDuino2. The PH5 pin is just one of the pins on the J8 expansion
header and has nothing to do with USB OTG. The PB9 pin is pulled
up and connected to the N_VBUSEN pin of AXP209 PMIC, while the
VBUS pin of AXP209 only has a capacitor between it and the
ground (this pin is not used for anything else).

To sum it up. Only the ID pin (PH4) has a real use. And 5V voltage
is always served to the MicroUSB OTG receptacle no matter what is
the state of the PB9/PD2 pins.

This patch has been tested on pcDuino2 to work fine in a host role
with a USB keyboard connected via an OTG cable. It also works fine
in a device role (cdc_ether) with a regular Micro-B cable connected
to a desktop PC.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2015-10-11 19:06:22 +02:00
Siarhei Siamashka 96521b7200 ARM: dts: sun4i: Allow to use the PH6 pin for GPIO on pcDuino1/2
The pcDuino1 board does not use any power switches at all for its
two USB host ports and the VBUS pins are always connected to 5V.

The pcDuino2 board uses the RT9701GB power switch for its single
USB host port, but the USB_EN pin (PD2) is pulled up with a 10K
resistor. So that the USB power is still enabled by default,
resulting in the same behaviour as pcDuino1 if nobody touches
the PD2 pin. This minor difference is going to be handled in a
follow-up patch, introducing a separate dts file for pcDuino2.

The primary reason for this fix is that the current dts file
unnecessarily meddles with the PH3 and PH6 pins. But the PH6 pin
is available on the Arduino-compatible expansion header and may
have a better use for other purposes. This patch fixes the
problem and now the PH6 pin can be used with the GPIO sysfs
interface. Tested on a pcDuino2 board with a multimeter:

    echo 230 > /sys/class/gpio/export
    echo "out" > /sys/class/gpio/gpio230/direction
    echo 0 > /sys/class/gpio/gpio230/value
    echo 1 > /sys/class/gpio/gpio230/value

USB still works as expected too.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2015-10-11 18:47:42 +02:00
Siarhei Siamashka a2f1a68011 ARM: dts: sun4i: Add AXP209 PMU regulators for pcDuino1/2
This allows voltage-scaling with cpufreq-dt. The reliability of
voltage-scaling has been checked by reducing the voltage of all
operating points by 0.025V (for extra safety headroom) and running
libjpeg-turbo decoding tests on 5 pcDuino2 boards. It means that
the standard sun4i voltages should be perfectly fine too.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2015-10-05 14:56:11 +02:00
Maxime Ripard 1fbc15175d ARM: dts: sun4i: Add A10 SRAM and SRAM controller
The A10 has a few SRAM that can be mapped either to a device or to the CPU,
with the mapping being controlled by a SRAM controller.

Add the SRAM controller, the SRAM that it drives and the section that can
be used by the various devices.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
2015-06-01 11:13:26 +02:00
Maxime Ripard c0c2eb2476 ARM: sunxi: dt: Remove the FSF address
The FSF address triggers a warning on checkpatch, saying that the FSF
license is already present in the Linux source code, and that it has
already changed in the past.

Remove it from our DT, as suggested.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2015-05-10 10:22:23 +02:00
Maxime Ripard 59ebbe88a6 ARM: sunxi: DT: Add stdout-path property
Add UART aliases and stdout-path property for all the Allwinner boards so that
we won't have to rely on the bootargs' console= value, while working with
legacy bootloaders.

While we're at it, also remove the mentions of earlyprintk in the bootargs,
that will remove our default bootargs entirely, and allow the kernel to boot on
a system even if DEBUG_LL is configured for another system.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2015-04-27 08:20:30 +02:00
Maxime Ripard 5e87736949 ARM: sun4i: pcduino: Convert to DT label based syntax
In order to lessen the amount of duplication of the DT tree, ease the
new and follow the trend that prefers to use label based references
when overriding DTSI nodes, convert the board to this syntax

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2015-04-27 08:20:20 +02:00
Zoltan HERPAI e721a28716 ARM: dts: pcduino: Enable user LED and button support for pcDuino
The pcDuino board has LEDs connected to PH15/PH16, and back/home/menu
buttons to PH17/18/19 respectively. Enable these via gpio-leds and
gpio-keys. This is shared across the v1 and v2 versions of the board.

Tested on a v2 and verified against the schematics of a v1.

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
Acked-by: Hans de Goede <hdegoede@redhat.com>
[Maxime: Added some newlines between the button nodes]
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2015-01-21 09:59:08 +01:00
Maxime Ripard bca12924f0 ARM: sunxi: DT: convert DTs to use common GPIOs includes
Replace the various raw GPIO flags by their definition in the common
dt-bindings header.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2015-01-21 09:58:56 +01:00
Maxime Ripard 7145570159 ARM: sunxi: DT: Convert to device tree includes
Prepare the device trees to use the C preprocessor.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2015-01-21 09:58:55 +01:00
Maxime Ripard a35070ddde ARM: sun4i: pcduino: Relicense the device tree under GPLv2/X11
The current GPL only licensing on the DTSI makes it very impractical for other
software components licensed under another license.

In order to make it easier for them to reuse our device trees, relicense our
device trees under a GPL/X11 dual-license.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Carlo Caione <carlo@caione.org>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Zoltan HERPAI <wigyori@uid0.hu>
2014-11-05 09:07:48 +01:00
Carlo Caione e288f1bac4 ARM: dts: sun4i: Add AXP209 support to various boards
At a node for the axp209, and where necessary the i2c controller to the dts
for various boards. Note the axp209 regulators are omitted as we don't have
any use for them yet, and on some boards were not sure how exactly they are
wired up.

Adding support for just the axp209 without the regulators is still useful, as
it will give us power-button and poweroff support.

Signed-off-by: Carlo Caione <carlo@caione.org>
[hdegoede@redhat.com: Drop the regulator bits for now]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2014-07-01 09:48:54 +02:00
Hans de Goede a4da476b6c ARM: dts: sun4i: Add reg_vcc3v3 to sun4i board mmc nodes
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2014-05-11 19:07:00 +02:00
Hans de Goede c0955a86f4 ARM: dts: sun4i: Enable mmc controller on various A10 boards
Tested on a subset of these boards, for the others boards the settings match
the ones of the tested boards according to the original firmware fex files.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2014-05-04 22:52:17 -05:00
Hans de Goede 77978a3728 ARM: sun4i: dt: Add USB host nodes to pcduino.dts
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2014-03-04 17:45:23 +01:00
Zoltan HERPAI 7f624cecb7 ARM: sun4i: dt: Add basic board support for LinkSprite pcDuino
This patch will add a basic board support DT for the
LinkSprite pcDuino board.

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2014-02-03 13:45:24 +01:00