]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
7 years agosunxi: enable SATA on Banana Pi M2 Ultra
Icenowy Zheng [Mon, 1 May 2017 06:31:57 +0000 (14:31 +0800)]
sunxi: enable SATA on Banana Pi M2 Ultra

Banana Pi M2 Ultra has a SATA port connected to the internal SATA
controller of R40 SoC. The controller's 1.2v VDD is connected to ELDO3
and the 2.5v VDD is connected to DLDO4.

Enable these regulators as well as the SATA support of Banana Pi M2
Ultra, by adding needed config lines into its defconfig.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: add clock configuration of R40 sata
Icenowy Zheng [Mon, 1 May 2017 06:31:56 +0000 (14:31 +0800)]
sunxi: add clock configuration of R40 sata

R40 has a similar SATA controller with the ones on A10/A20, but with a
reset line added (like other peripherals on sun6i+), and two extra VDD
pins added (1.2v and 2.5v).

Add clock configuration of R40 SATA.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agoARM: sunxi: use imply instead of bare default y in Kconfig
Masahiro Yamada [Fri, 28 Apr 2017 10:42:19 +0000 (19:42 +0900)]
ARM: sunxi: use imply instead of bare default y in Kconfig

Fix annoying config redefines in SoC/board level Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agoARM: sunxi: move board/sunxi/Kconfig to arch/arm/mach-sunxi/Kconfig
Masahiro Yamada [Fri, 28 Apr 2017 10:42:18 +0000 (19:42 +0900)]
ARM: sunxi: move board/sunxi/Kconfig to arch/arm/mach-sunxi/Kconfig

For the consistent location of SoC-level Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: Disable DE2 video driver where not needed
Jernej Skrabec [Mon, 27 Mar 2017 17:22:33 +0000 (19:22 +0200)]
sunxi: Disable DE2 video driver where not needed

Because DE2 driver is enabled by default, it is nice to disable it on
all boards which don't have any video output. List of such boards is
also much shorter.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: video: Add A64/H3/H5 HDMI driver
Jernej Skrabec [Mon, 27 Mar 2017 17:22:32 +0000 (19:22 +0200)]
sunxi: video: Add A64/H3/H5 HDMI driver

This commit adds support for HDMI output.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: Enable DM_I2C for A64/H3/H5
Jernej Skrabec [Wed, 26 Apr 2017 22:03:37 +0000 (00:03 +0200)]
sunxi: Enable DM_I2C for A64/H3/H5

This commits enable DM I2C support for A64/H3/H5 SoCs.

It is not enabled globaly for all sunxi SoCs, because some boards use
PMICs which are connected through I2C. In order to keep same
functionality, PMIC drivers needs to be ported to DM too.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: i2c: Add support for DM I2C
Jernej Skrabec [Wed, 26 Apr 2017 22:03:36 +0000 (00:03 +0200)]
sunxi: i2c: Add support for DM I2C

This commit adds support for DM I2C on sunxi platform. It can coexist
with old style sunxi I2C driver, because it is still used in SPL and
by some SoCs.

Because sunxi platform doesn't yet support DM clk, reset and pinctrl
driver, workaround is needed to enable clocks and set resets and
pinctrls. This is done by calling i2c_init_board() in board_init().
This means that CONFIG_I2Cx_ENABLE options needs to be correctly set
in order to use needed I2C controller.

Commit is based on the previous patch made by Philipp Tomsich

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: Move function for later convenience
Jernej Skrabec [Wed, 26 Apr 2017 22:03:35 +0000 (00:03 +0200)]
sunxi: Move function for later convenience

This commit only moves i2c_init_board() function almost to the top and
doesn't have any functional changes.

This is needed for a temporary workaround in next commit when support
for DM I2C will be introduced.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: power: Compile sy8106a driver only during SPL build
Jernej Skrabec [Wed, 26 Apr 2017 22:03:34 +0000 (00:03 +0200)]
sunxi: power: Compile sy8106a driver only during SPL build

Driver for that regulator is used only in SPL and it uses old I2C
interface. If we want to use DM I2C in U-Boot proper, compilation of
this driver has to be limited only to SPL.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I
Icenowy Zheng [Mon, 24 Apr 2017 17:39:51 +0000 (01:39 +0800)]
sunxi: fix the default value of CONS_INDEX on non-A23/A33 SUN8I

Only A23/A33 in SUN8I want a default value of CONS_INDEX of 5, for other
chips the default value is 1 like other Allwinner SoCs.

Fix this default value.

The original wrong value has lead to wrong console on H3 Orange Pi
boards.

Fixes: 7095f8641863 ("sunxi: Convert CONS_INDEX to Kconfig")
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: Fix arm64 fdtfile variable
Andreas Färber [Fri, 14 Apr 2017 16:44:47 +0000 (18:44 +0200)]
sunxi: Fix arm64 fdtfile variable

Currently $fdtfile is constructed from CONFIG_DEFAULT_TREE, containing
the filename. However on arm64 that file is located in an allwinner
subdirectory.

To avoid the need for users/distros symlinking the .dtb files, prepend
the vendor directory for ARM64.

This aligns Pine64 with other boards such as Raspberry Pi 3.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Jagan Teki <jagan@openedev.com>
7 years agosunxi: add support for Lichee Pi Zero
Icenowy Zheng [Sat, 8 Apr 2017 07:30:14 +0000 (15:30 +0800)]
sunxi: add support for Lichee Pi Zero

Lichee Pi Zero is a development board with a V3s SoC, which features
64MiB DRAM co-packaged within the SoC, a TF slot, a SPI NOR slot (not
soldered in production batch), a 40-pin RGB LCD connector and some extra
pins available as 2.54mm pins or stamp holes.

Add support for it.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: add DTSI file for V3s
Icenowy Zheng [Sat, 8 Apr 2017 07:30:13 +0000 (15:30 +0800)]
sunxi: add DTSI file for V3s

As we have now V3s support in board code, the V3s DTSI file should also
be added.

Add also some CCU include headers to satisfy the DTSI file.

Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: add basic V3s support
Icenowy Zheng [Sat, 8 Apr 2017 07:30:12 +0000 (15:30 +0800)]
sunxi: add basic V3s support

Basic U-Boot support is now present for V3s.

Some memory addresses are changed specially for V3s, as the original
address map cannot fit into a so small DRAM.

As the DRAM controller code needs a big refactor, the SPL support is
disabled in this version.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: Add clock support for DE2/HDMI/TCON on newer SoCs
Jernej Skrabec [Mon, 27 Mar 2017 17:22:31 +0000 (19:22 +0200)]
sunxi: Add clock support for DE2/HDMI/TCON on newer SoCs

This is needed for HDMI, which will be added later.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: video: Convert lcdc to use struct display_timing
Jernej Skrabec [Mon, 27 Mar 2017 17:22:30 +0000 (19:22 +0200)]
sunxi: video: Convert lcdc to use struct display_timing

Video driver for older Allwinner SoCs uses cfb console framework which
in turn uses struct ctfb_res_modes to hold timing informations. However,
DM video framework uses different structure - struct display_timing.

It makes more sense to convert lcdc to use new timing structure because
all new drivers should use DM video framework and older drivers might be
rewritten to use new framework too.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: video: Split out TCON code
Jernej Skrabec [Mon, 27 Mar 2017 17:22:29 +0000 (19:22 +0200)]
sunxi: video: Split out TCON code

TCON unit has similar layout and functionality also on newer SoCs. This
commit splits out TCON code for easier reuse later.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: Add support for Bananapi M2 Ultra
Chen-Yu Tsai [Fri, 2 Dec 2016 08:12:32 +0000 (16:12 +0800)]
sunxi: Add support for Bananapi M2 Ultra

The Bananapi M2 Ultra is the first publicly available development board
featuring the R40 SoC.

This patch add barebone dtsi/dts files for the R40 and Bananapi M2 Ultra,
as well as a defconfig for it.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: Add PSCI support for R40
Chen-Yu Tsai [Wed, 1 Mar 2017 03:03:15 +0000 (11:03 +0800)]
sunxi: Add PSCI support for R40

The R40's CPU controls are a combination of sun6i and sun7i.

All controls are in the CPUCFG block, and it seems the R40 does not
have a PRCM block. The core reset, power gating and clamp controls
are grouped like sun6i.

Last, the R40 does not have a secure SRAM block.

This patch adds a PSCI implementation for CPU bring-up and hotplug
for the R40.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: Fix CPUCFG address for R40
Chen-Yu Tsai [Wed, 1 Mar 2017 05:52:09 +0000 (13:52 +0800)]
sunxi: Fix CPUCFG address for R40

The R40 has the CPUCFG block at the same address as the A20.
Fix it.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: Enable SPL for R40
Chen-Yu Tsai [Fri, 2 Dec 2016 08:09:49 +0000 (16:09 +0800)]
sunxi: Enable SPL for R40

Now that we can do DRAM initialization for the R40, we can enable
SPL support for it.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: Use H3/A64 DRAM initialization code for R40
Chen-Yu Tsai [Thu, 1 Dec 2016 11:09:57 +0000 (19:09 +0800)]
sunxi: Use H3/A64 DRAM initialization code for R40

The R40 seems to have a variant of the memory controller found in
the H3 and A64 SoCs. Adapt the code for use on the R40. The changes
are based on released DRAM code and comparing register dumps from
boot0.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agogpio: sunxi: Add compatible string for R40 PIO
Chen-Yu Tsai [Wed, 30 Nov 2016 09:23:52 +0000 (17:23 +0800)]
gpio: sunxi: Add compatible string for R40 PIO

The PIO on the R40 SoC is mostly compatible with the A20.
Only a few pin functions for mmc2 were added to the PC
pingroup, to support 8 bit eMMCs.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: Provide defaults for R40 DRAM settings
Chen-Yu Tsai [Wed, 30 Nov 2016 08:58:35 +0000 (16:58 +0800)]
sunxi: Provide defaults for R40 DRAM settings

These values were taken from the Banana Pi M2 Ultra fex file
found in the released vendor BSP. This is the only publicly
available R40 device at the time of this writing.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: Set PLL lock enable bits for R40
Chen-Yu Tsai [Wed, 30 Nov 2016 08:54:34 +0000 (16:54 +0800)]
sunxi: Set PLL lock enable bits for R40

According to the BSP released by Banana Pi, the R40 (sun8iw11p1) has
an extra "PLL lock control" register in the CCU, which controls whether
the individual PLL lock status bits in each PLL's control register work
or not.

This patch enables it for all the PLLs.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: Add mmc[1-3] pinmux settings for R40
Chen-Yu Tsai [Wed, 30 Nov 2016 08:28:34 +0000 (16:28 +0800)]
sunxi: Add mmc[1-3] pinmux settings for R40

The PIO is generally compatible with the A20, except that it routes the
full 8 bits and eMMC reset pins for mmc2.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: Fix watchdog reset function for R40
Chen-Yu Tsai [Wed, 30 Nov 2016 08:27:14 +0000 (16:27 +0800)]
sunxi: Fix watchdog reset function for R40

The watchdog found on the R40 SoC is the older variant found on the A20.
Add the proper "#if defines" to make it work.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: Enable AXP221s in I2C mode with the R40 SoC
Chen-Yu Tsai [Wed, 30 Nov 2016 07:30:30 +0000 (15:30 +0800)]
sunxi: Enable AXP221s in I2C mode with the R40 SoC

The R40 SoC uses the AXP221s in I2C mode to supply power.

Some regulator's common usages have changed, and also the recommended
voltage for existing usages have changed. Update the defaults to match.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: Add initial support for R40
Chen-Yu Tsai [Wed, 30 Nov 2016 06:57:32 +0000 (14:57 +0800)]
sunxi: Add initial support for R40

The R40 is the successor to the A20. It is a hybrid of the A20, A33
and the H3.

The R40's PIO controller is compatible with the A20,
Reuse the A20 UART and I2C muxing code by adding the R40's macro.

The display pipeline is the newer DE 2.0 variant.
Block enabling video on R40 for now.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: Split up long Kconfig lines
Chen-Yu Tsai [Thu, 2 Mar 2017 08:03:06 +0000 (16:03 +0800)]
sunxi: Split up long Kconfig lines

Currently we have some lines in board/sunxi/Kconfig that are very long.
These line either provide default values for a set of SoCs, or limit
some option to a subset of sunxi SoCs.

Fortunately Kconfig makes it easy to split them. The Kconfig language
document states

    If multiple dependencies are defined, they are connected with '&&'.

This means we can split existing dependencies at "&&" symbols. This
applies to both the "depends on" lines and "if" expressions.

This patch splits them up to one symbol per line. This will make it
easier to add, remove, or modify one item at a time.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: Convert CONS_INDEX to Kconfig
Mylène Josserand [Sun, 2 Apr 2017 10:59:11 +0000 (12:59 +0200)]
sunxi: Convert CONS_INDEX to Kconfig

Convert the CONS_INDEX configuration to Kconfig.
Update sunxi's defconfigs to remove SYS_EXTRA_OPTIONS variable not
needed anymore.
Default value is 1 except for sun5i (equals 2) and sun8i (equals 5).

Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
[Maxime: Added a depends on ARCH_SUNXI to avoid build breakages]
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: Convert CONFIG_MACPWR to Kconfig
Mylène Josserand [Sun, 2 Apr 2017 10:59:10 +0000 (12:59 +0200)]
sunxi: Convert CONFIG_MACPWR to Kconfig

Convert the CONFIG_MACPWR to Kconfig and update all the sunxi defconfigs
that used it in SYS_EXTRA_OPTIONS.

Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: Convert CONFIG_SATAPWR to Kconfig
Mylène Josserand [Sun, 2 Apr 2017 10:59:09 +0000 (12:59 +0200)]
sunxi: Convert CONFIG_SATAPWR to Kconfig

Convert the CONFIG_SATAPWR into kconfig.
Thanks to that, many SYS_EXTRA_OPTIONS can be removed from some
defconfigs.

Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: Convert CONFIG_RGMII to Kconfig
Mylène Josserand [Sun, 2 Apr 2017 10:59:08 +0000 (12:59 +0200)]
sunxi: Convert CONFIG_RGMII to Kconfig

Convert CONFIG_RGMII to Kconfig. Thanks to that, it is possible to
update defconfig files of SYS_EXTRA_OPTIONS accordingly and
remove it when it is possible.

Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: Convert SUNXI_EMAC to Kconfig
Mylène Josserand [Sun, 2 Apr 2017 10:59:07 +0000 (12:59 +0200)]
sunxi: Convert SUNXI_EMAC to Kconfig

Convert the SUNXI_EMAC config to Kconfig. Remove it from SYS_EXTRA_OPTIONS
from many sunxi defconfig and renamed it into SUN4I_EMAC to not confuse it
with SUN8I_EMAC.

Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: mk802_defconfig: Remove SYS_EXTRA_OPTIONS
Mylène Josserand [Sun, 2 Apr 2017 10:59:06 +0000 (12:59 +0200)]
sunxi: mk802_defconfig: Remove SYS_EXTRA_OPTIONS

The USB_EHCI configuration is already set in this defconfig
using kconfig's config. This configuration in SYS_EXTRA_OPTIONS
must be removed and so the SYS_EXTRA_OPTIONS.

Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: icnova-a20-swac_defconfig: Remove CMD_BMP from
Mylène Josserand [Sun, 2 Apr 2017 10:59:05 +0000 (12:59 +0200)]
sunxi: icnova-a20-swac_defconfig: Remove CMD_BMP from

This configuration is not necessary in a defconfig file so
it is removed from the SYS_EXTRA_OPTIONS.

Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: icnova-a20-swac_defconfig: Remove AXP209_POWER
Mylène Josserand [Sun, 2 Apr 2017 10:59:04 +0000 (12:59 +0200)]
sunxi: icnova-a20-swac_defconfig: Remove AXP209_POWER

Remove the AXP209_POWER option from SYS_EXTRA_OPTIONS.
As this configuration already exists on Kconfig, we just need
to remove it from defconfig.

Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: Move SUNXI_GMAC to Kconfig
Mylène Josserand [Sun, 2 Apr 2017 10:59:03 +0000 (12:59 +0200)]
sunxi: Move SUNXI_GMAC to Kconfig

Move the SUNXI_GMAC config option to Kconfig, remove it
from SYS_EXTRA_OPTIONS and rename it into SUN7I_GMAC.

Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 years agosunxi: Add maintainer of the NanoPi NEO Air
Jelle van der Waa [Fri, 3 Mar 2017 20:25:10 +0000 (21:25 +0100)]
sunxi: Add maintainer of the NanoPi NEO Air

Add myself as maintainer of the NanoPi NEO Air board.

Signed-off-by: Jelle van der Waa <jelle@vdwaa.nl>
Reviewed-by: Jagan Teki <jagan@openedev.com>
7 years agoPrepare v2017.05-rc2
Tom Rini [Mon, 17 Apr 2017 22:16:49 +0000 (18:16 -0400)]
Prepare v2017.05-rc2

Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agoMerge git://git.denx.de/u-boot-rockchip
Tom Rini [Mon, 17 Apr 2017 02:08:13 +0000 (22:08 -0400)]
Merge git://git.denx.de/u-boot-rockchip

7 years agoMerge git://git.denx.de/u-boot-dm
Tom Rini [Mon, 17 Apr 2017 02:07:52 +0000 (22:07 -0400)]
Merge git://git.denx.de/u-boot-dm

7 years agorockchip: rk3399: spl: add UART0 support for SPL
Philipp Tomsich [Sat, 1 Apr 2017 10:59:25 +0000 (12:59 +0200)]
rockchip: rk3399: spl: add UART0 support for SPL

The RK3399-Q7 ("Puma") SoM exposes UART0 as the Qseven UART (i.e. the
serial line available via standardised pins on the edge connector and
available on a RS232 connector).

To support boards (such as the RK3399-Q7) that require UART0 as a
debug console, we match CONFIG_DEBUG_UART_BASE and add the appropriate
iomux setup to the rk3399 SPL code.

As we are already touching this code, we also move the board-specific
UART setup (i.e. iomux setup) into board_debug_uart_init(). This will
be called from the debug UART init when CONFIG_DEBUG_UART_BOARD_INIT
is set.

As the RK3399 needs to use its board_debug_uart_init() function, we
have Kconfig enable it by default for RK3399 builds.

With everything set up to define CONFIG_BAUDRATE via defconfig and
with to have the SPL debug UART either on UART0 or UART2, the configs
for the RK3399 EVB are then update (the change for the RK3399-Q7 is
left for later to not cause issues on applying the change).

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Acked-by: Simon Glass <sjg@chromium.org>
7 years agorockchip: pmic: Enable RK808 for rk3399 evb
eric.gao@rock-chips.com [Mon, 10 Apr 2017 02:41:46 +0000 (10:41 +0800)]
rockchip: pmic: Enable RK808 for rk3399 evb

For using mipi display, we need to enable lcd3v3
which supplied by rk808,so enable rk808 first.

Signed-off-by: Eric Gao <eric.gao@rock-chips.com>
Acked-by: Simon Glass <sjg@chromium.org>
7 years agorockchip: i2c: Enable i2c for rk3399
eric.gao@rock-chips.com [Mon, 10 Apr 2017 02:17:03 +0000 (10:17 +0800)]
rockchip: i2c: Enable i2c for rk3399

To enable mipi display, we need to enable pmic
rk808 first for lcd3v3 power,which use i2c0 to
communicate with soc. So enable i2c0.

Signed-off-by: Eric Gao <eric.gao@rock-chips.com>
Acked-by: Simon Glass <sjg@chromium.org>
7 years agorockchip: rk3399: Add missing sentinel in syscon
eric.gao@rock-chips.com [Mon, 10 Apr 2017 01:53:31 +0000 (09:53 +0800)]
rockchip: rk3399: Add missing sentinel in syscon

when enable PMIC rk808,the system will halt at very
 early stage,log is shown as bellow.

INFO:    plat_rockchip_pmu_init(1211): pd status 3e
INFO:    BL31: Initializing runtime services
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x200000
INFO:    SPSR = 0x3c9
time 44561b, 0 (<<----Just stop here)

It's caused by the absence of "{ }" in syscon_rk3399.c
,which will lead to memory overflow like below.According
 to Sysmap file ,we can find the function buck_get_value
of rk808 is just follow the compatible struct,the pointer
"of_match" point to "buck_get_value",but it is not a
struct and don't have member of compatible, In this case,
system crash. So,on the face, it looks like that rk808 is
guilty.but he is really innocent.

while (of_match->compatible) { <<----------
    if (!strcmp(of_match->compatible, compat)) {
    *of_idp = of_match;
    return 0;
    }
    of_match++;
}

Signed-off-by: Eric Gao <eric.gao@rock-chips.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Tested-by: Kever Yang <kever.yang@rock-chips.com>
7 years agorockchip: ARM64: split RK3399-Q7 board off the RK3399-EVB board
Klaus Goger [Fri, 7 Apr 2017 17:13:38 +0000 (19:13 +0200)]
rockchip: ARM64: split RK3399-Q7 board off the RK3399-EVB board

The RK3399-Q7 SoM is a Qseven-compatible (70mm x 70mm, MXM-230
connector) system-on-module from Theobroma Systems, featuring the
Rockchip RK3399.

It provides the following feature set:
 * up to 4GB DDR3
 * on-module SPI-NOR flash
 * on-module eMMC (with 8-bit interace)
 * SD card (on a baseboad) via edge connector
 * Gigabit Ethernet w/ on-module Micrel KSZ9031 GbE PHY
 * HDMI/eDP/MIPI displays
 * 2x MIPI-CSI
 * USB
   - 1x USB 3.0 dual-role (direct connection)
   - 2x USB 3.0 host + 1x USB 2.0 (on-module USB 3.0 hub)
 * on-module STM32 Cortex-M0 companion controller, implementing:
   - low-power RTC functionality (ISL1208 emulation)
   - fan controller (AMC6821 emulation)
   - USB<->CAN bridge controller

Note that we use a multi-payload FIT image for booting and have
Cortex-M0 payload in a separate subimage: we thus rely on the FIT
image loader to put it into the SRAM region that ATF expects it in.

Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Fixed build warning on puma-rk3399:
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agorockchip: dts: rk3399-puma: make the DTS dual-licensed
Philipp Tomsich [Fri, 7 Apr 2017 17:09:37 +0000 (19:09 +0200)]
rockchip: dts: rk3399-puma: make the DTS dual-licensed

The RK3399-Q7 (Puma) DTS should (of course) be dual-licensed.
This updates the licensing info in the rk3399-puma.dts.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agorockchip: sysreset: rk3188: Make sure remap is off on warm-resets
Heiko Stübner [Fri, 7 Apr 2017 10:38:52 +0000 (12:38 +0200)]
rockchip: sysreset: rk3188: Make sure remap is off on warm-resets

The warm-reset of rk3188 socs keeps the remap setting as it was, so if
it was enabled, the cpu would start from address 0x0 of the sram instead
of address 0x0 of the bootrom, thus making the reset hang.

Therefore make sure the remap is disabled before attempting a warm reset.

Cold reset is not affected by this at all.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Simon Glass <sjg@chromium.org>
7 years agorockchip: rk3399: do not use lower address
Kever Yang [Fri, 7 Apr 2017 10:12:55 +0000 (18:12 +0800)]
rockchip: rk3399: do not use lower address

The lower address is reserved for ATF, do not use it.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Acked-by: Simon Glass <sjg@chromium.org>
7 years agorockchip: rk3188: enable remap function
Heiko Stübner [Wed, 5 Apr 2017 22:19:36 +0000 (00:19 +0200)]
rockchip: rk3188: enable remap function

Most Rockchip socs have the ability to either map the bootrom or a sram
area to the starting address of the cpu by flipping a bit in the GRF.

Newer socs leave this untouched and mapped to the bootrom but the legacy
loaders on rk3188 and before enabled the remap functionality and the
current smp implementation in the Linux kernel also requires it to be
enabled, to bring up secondary cpus.

So to keep smp working in the kernel, mimic the behaviour of the legacy
bootloaders and enable the remap functionality.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Simon Glass <sjg@chromium.org>
7 years agorockchip: cosmetic: Move rock board to its correct position
Heiko Stübner [Wed, 5 Apr 2017 22:19:18 +0000 (00:19 +0200)]
rockchip: cosmetic: Move rock board to its correct position

Somehow 43b5c78d8d91 ("rockchip: cosmetic: Sort RK3288 boards") moved
the rock board in between some rk3288 board, probably as a result of
rebasing.

So move it back to its original position above all rk3288 boards.

Fixes: 43b5c78d8d91 ("rockchip: cosmetic: Sort RK3288 boards")
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Simon Glass <sjg@chromium.org>
7 years agorockchip: Add USB to the default boot targets
Eddie Cai [Sat, 1 Apr 2017 06:49:54 +0000 (14:49 +0800)]
rockchip: Add USB to the default boot targets

Now that most rockchip SoC based board have usb host support, enable
USB boot targets by default.

Signed-off-by: Eddie Cai <eddie.cai.linux@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
Fixed build errors when CONFIG_CMD_USB not defined:
Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agorockchip: tinker: configs: Add USB, PXE, DHCP to the default boot targets
Eddie Cai [Sat, 1 Apr 2017 06:46:52 +0000 (14:46 +0800)]
rockchip: tinker: configs: Add USB, PXE, DHCP to the default boot targets

tinker board support ethernet and usb host, so enable USB, PXE and DHCP support.

Signed-off-by: Eddie Cai <eddie.cai.linux@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
7 years agorockchip: dts: rk3399-puma: disable 'fifo-mode' in sdmmc
Philipp Tomsich [Wed, 29 Mar 2017 19:20:29 +0000 (21:20 +0200)]
rockchip: dts: rk3399-puma: disable 'fifo-mode' in sdmmc

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Simon Glass <sjg@chromium.org>
7 years agorockchip: spl: rk3399: disable DDR security regions for SPL
Philipp Tomsich [Wed, 29 Mar 2017 19:20:28 +0000 (21:20 +0200)]
rockchip: spl: rk3399: disable DDR security regions for SPL

The RK3399 hangs during DMA of the Designware MMC controller, when
performing DMA-based transactions in SPL due to the DDR security settings
left behind by the BootROM (i.e. accesses to the first MB of DRAM are
restricted... however, the DMA is likely to target this first MB, as it
transfers from/to the stack).

System security is not affected, as the final security configuration is
performed by the ATF, which is executed after the SPL stage.

With this fix in place, we can now drop 'fifo-mode' in the DTS for the
RK3399-Q7 (Puma).

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Acked-by: Simon Glass <sjg@chromium.org>
7 years agoboard: sama5d3_xplained: Enable early debug UART
Wenyou Yang [Fri, 14 Apr 2017 00:51:47 +0000 (08:51 +0800)]
board: sama5d3_xplained: Enable early debug UART

Enable the early debug UART to debug problems when an ICE or other
debug mechanism is not available.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
7 years agoboard: sama5d3_xplained: Clean up code
Wenyou Yang [Fri, 14 Apr 2017 00:51:46 +0000 (08:51 +0800)]
board: sama5d3_xplained: Clean up code

Due to the introduction of the pinctrl and clk driver, and using
device tree files, remove the unneeded hardcoded pin configuration
and clock enabling code from the board file.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
7 years agoboard: sama5d3_xplained: Update to support DM/DT
Wenyou Yang [Fri, 14 Apr 2017 00:51:45 +0000 (08:51 +0800)]
board: sama5d3_xplained: Update to support DM/DT

Update the configuration files to support the device tree and driver
model, so do SPL. The device clock and pins configuration are handled
by the clock and the pinctrl drivers respectively.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Fix build error with sama5d3_xplained_mmc:
Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agoboard: sama5d3xek: Enable early debug UART
Wenyou Yang [Fri, 14 Apr 2017 00:51:44 +0000 (08:51 +0800)]
board: sama5d3xek: Enable early debug UART

Enable the early debug UART to debug problems when an ICE or other
debug mechanism is not available.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
7 years agoboard: sama5d3xek: Clean up code
Wenyou Yang [Fri, 14 Apr 2017 00:51:43 +0000 (08:51 +0800)]
board: sama5d3xek: Clean up code

Due to the introduction of the pinctrl and clk driver, and using
device tree files, remove the unneeded hardcoded pin configuration
and clock enabling code from the board file.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Remove CONFIG_PHY_MICREL as per previous patch:
Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agoboard: sama5d3xek: Update to support DM/DT
Wenyou Yang [Fri, 14 Apr 2017 00:51:42 +0000 (08:51 +0800)]
board: sama5d3xek: Update to support DM/DT

Update the configuration files to support the device tree and
driver model, so do SPL. The device clock and pins configuration
are handled by the clock and the pinctrl drivers respectively.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Add back CONFIG_PHY_MICREL to prevent a build error:
Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agoMerge branch 'master' of git://git.denx.de/u-boot-video
Tom Rini [Sat, 15 Apr 2017 02:05:17 +0000 (22:05 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-video

7 years agodm: led: Add a new 'led' command
Simon Glass [Mon, 10 Apr 2017 17:34:59 +0000 (11:34 -0600)]
dm: led: Add a new 'led' command

When driver model is used for LEDs, provide a command to allow LED access.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ziping Chen <techping.chan@gmail.com>
7 years agoled: Mark existing driver as legacy
Simon Glass [Mon, 10 Apr 2017 17:34:58 +0000 (11:34 -0600)]
led: Mark existing driver as legacy

The existing 'led' command does not support driver model. Rename it to
indicate that it is legacy code.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ziping Chen <techping.chan@gmail.com>
7 years agodm: led: Add support for blinking LEDs
Simon Glass [Mon, 10 Apr 2017 17:34:57 +0000 (11:34 -0600)]
dm: led: Add support for blinking LEDs

Allow LEDs to be blinked if the driver supports it. Enable this for
sandbox so that the tests run.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ziping Chen <techping.chan@gmail.com>
7 years agodm: led: Support toggling LEDs
Simon Glass [Mon, 10 Apr 2017 17:34:56 +0000 (11:34 -0600)]
dm: led: Support toggling LEDs

Add support for toggling an LED into the uclass interface. This can be
efficiently implemented by the driver.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ziping Chen <techping.chan@gmail.com>
7 years agodm: led: Add support for getting the state of an LED
Simon Glass [Mon, 10 Apr 2017 17:34:55 +0000 (11:34 -0600)]
dm: led: Add support for getting the state of an LED

It is useful to be able to read the LED as well as write it. Add this to
the uclass and update the GPIO driver.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ziping Chen <techping.chan@gmail.com>
7 years agodm: led: Adjust the LED uclass
Simon Glass [Mon, 10 Apr 2017 17:34:54 +0000 (11:34 -0600)]
dm: led: Adjust the LED uclass

At present this is very simple, supporting only on and off. We want to
also support toggling and blinking. As a first step, change the name of
the main method and use an enum to indicate the state.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ziping Chen <techping.chan@gmail.com>
7 years agodm: led: Rename struct led_uclass_plat
Simon Glass [Mon, 10 Apr 2017 17:34:53 +0000 (11:34 -0600)]
dm: led: Rename struct led_uclass_plat

These structures are normally named with 'uc' instead of 'uclass'. Change
this one for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ziping Chen <techping.chan@gmail.com>
7 years agodm: led: Add a missing blank line in the Kconfig file
Simon Glass [Mon, 10 Apr 2017 17:34:52 +0000 (11:34 -0600)]
dm: led: Add a missing blank line in the Kconfig file

There should be a blank line between each option. Add one before LED_GPIO.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ziping Chen <techping.chan@gmail.com>
7 years agosandbox: Add some test LEDs
Simon Glass [Mon, 10 Apr 2017 17:34:51 +0000 (11:34 -0600)]
sandbox: Add some test LEDs

Add some LEDs to the standard sandbox device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ziping Chen <techping.chan@gmail.com>
7 years agodm: scsi: fix divide-by-0 error in scsi_scan()
Jean-Jacques Hiblot [Fri, 7 Apr 2017 11:42:08 +0000 (13:42 +0200)]
dm: scsi: fix divide-by-0 error in scsi_scan()

With DM_SCSI enabled, blk_create_devicef() is called with blkz = 0, leading
to a divide-by-0 exception.
scsi_detect_dev() can be used to get the required parameters (block size
and number of blocks) from the drive before calling blk_create_devicef().

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoscsi: move the partition initialization out of the scsi detection
Jean-Jacques Hiblot [Fri, 7 Apr 2017 11:42:07 +0000 (13:42 +0200)]
scsi: move the partition initialization out of the scsi detection

We might want to get information about the scsi device without initializing the partition.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoscsi: make the LUN a parameter of scsi_detect_dev()
Jean-Jacques Hiblot [Fri, 7 Apr 2017 11:42:06 +0000 (13:42 +0200)]
scsi: make the LUN a parameter of scsi_detect_dev()

This is a cosmetic change. target and LUN have kind of the same role in
this function. One of them was passed as a parameter and the other was
embedded in a structure. For consistency, pass both of them as parameters.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoarm: omap: sata: compile out board-level sata code when CONFIG_DM_SCSI is defined
Jean-Jacques Hiblot [Fri, 7 Apr 2017 11:42:01 +0000 (13:42 +0200)]
arm: omap: sata: compile out board-level sata code when CONFIG_DM_SCSI is defined

When CONFIG_DM_SCSI is defined, the SATA initialization will be implemented
in the scsi-uclass driver.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoarm: omap: sata: move enable sata clocks to enable_basic_clocks()
Mugunthan V N [Fri, 7 Apr 2017 11:42:00 +0000 (13:42 +0200)]
arm: omap: sata: move enable sata clocks to enable_basic_clocks()

All the clocks which has to be enabled has to be done in
enable_basic_clocks(), so moving enable sata clock to common
clocks enable function.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agobuildman: Translate more strings to latin-1
Tom Rini [Fri, 14 Apr 2017 14:06:28 +0000 (10:06 -0400)]
buildman: Translate more strings to latin-1

When writing out some of our results we may now have UTF-8 characters
in there as well.  Translate these to latin-1 and ignore any errors (as
this is for diagnostic and given the githash anything else can be
reconstructed by the user.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agoMerge branch 'master' of git://git.denx.de/u-boot-usb
Tom Rini [Fri, 14 Apr 2017 14:58:49 +0000 (10:58 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-usb

7 years agousb: return 0 from usb_stor_get_info even if removable media
Troy Kisky [Tue, 11 Apr 2017 01:23:11 +0000 (18:23 -0700)]
usb: return 0 from usb_stor_get_info even if removable media

This fixes a regression caused by

commit 07b2b78ce4bc8ae25e066c65245eaf58c0d9a67c
    dm: usb: Convert USB storage to use driver-model for block devs

which caused part_init to be called when it was not previously.
Without this patch, the following happens when a USB sd card reader is used.

=> usb start
starting USB...
USB0:   Port not available.
USB1:   USB EHCI 1.00
scanning bus 1 for devices... 3 USB Device(s) found
       scanning usb for storage devices... Device NOT ready
   Request Sense returned 02 3A 00
 ### ERROR ### Please RESET the board ###

This happens because dev_desc->blksz is 0.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
7 years agousb: dwc2: invalidate the dcache before starting the DMA
Eddie Cai [Thu, 6 Apr 2017 03:37:04 +0000 (11:37 +0800)]
usb: dwc2: invalidate the dcache before starting the DMA

We should invalidate the dcache before starting the DMA. In case there are
any dirty lines from the DMA buffer in the cache, subsequent cache-line
replacements may corrupt the buffer in memory while the DMA is still going on.
Cache-line replacement can happen if the CPU tries to bring some other memory
locations into the cache while the DMA is going on.

Signed-off-by: Eddie Cai <eddie.cai.linux@gmail.com>
Reviewed-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
7 years agousb: dwc3: gadget: make cache-maintenance on event buffers more robust
Philipp Tomsich [Thu, 6 Apr 2017 14:58:53 +0000 (16:58 +0200)]
usb: dwc3: gadget: make cache-maintenance on event buffers more robust

Merely using dma_alloc_coherent does not ensure that there is no stale
data left in the caches for the allocated DMA buffer (i.e. that the
affected cacheline may still be dirty).

The original code was doing the following (on AArch64, which
translates a 'flush' into a 'clean + invalidate'):
  # during initialisation:
      1. allocate buffers via memalign
        => buffers may still be modified (cached, dirty)
  # during interrupt processing
      2. clean + invalidate buffers
        => may commit stale data from a modified cacheline
      3. read from buffers

This could lead to garbage info being written to buffers before
reading them during even-processing.

To make the event processing more robust, we use the following sequence
for the cache-maintenance:
  # during initialisation:
      1. allocate buffers via memalign
      2. clean + invalidate buffers
        (we only need the 'invalidate' part, but dwc3_flush_cache()
  always performs a 'clean + invalidate')
  # during interrupt processing
      3. read the buffers
        (we know these lines are not cached, due to the previous
  invalidation and no other code touching them in-between)
      4. clean + invalidate buffers
        => writes back any modification we may have made during event
    processing and ensures that the lines are not in the cache
    the next time we enter interrupt processing

Note that with the original sequence, we observe reproducible
(depending on the cache state: i.e. running dhcp/usb start before will
upset caches to get us around this) issues in the event processing (a
fatal synchronous abort in dwc3_gadget_uboot_handle_interrupt on the
first time interrupt handling is invoked) when running USB mass
storage emulation on our RK3399-Q7 with data-caches on.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agousb: dwc3: ensure consistent types for dwc3_flush_cache
Philipp Tomsich [Thu, 6 Apr 2017 14:58:52 +0000 (16:58 +0200)]
usb: dwc3: ensure consistent types for dwc3_flush_cache

The dwc3_flush_cache() call was declared and used inconsistently:
 * The declaration assumed 'int' for addresses (a potential issue
   when running in a LP64 memory model).
 * The invocation cast the address to 'long'.

This change ensures that both the declaration and usage of this
function consistently uses 'uintptr_t' for correct behaviour even
when the allocated buffers (to be flushed) reside outside of the
lower 32bits of memory.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agousb: gadget: g_dnl: don't set iProduct nor iSerialNumber
Felipe Balbi [Wed, 22 Feb 2017 15:12:41 +0000 (17:12 +0200)]
usb: gadget: g_dnl: don't set iProduct nor iSerialNumber

Both these numbers are calculated in runtime and dynamically assigned
to the device descriptor during bind().

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
7 years agousb: gadget: g_dnl: only set iSerialNumber if we have a serial#
Felipe Balbi [Wed, 22 Feb 2017 15:12:40 +0000 (17:12 +0200)]
usb: gadget: g_dnl: only set iSerialNumber if we have a serial#

We don't want to claim that we support a serial number string and
later return nothing. Because of that, if g_dnl_serial is an empty
string, let's skip setting iSerialNumber to a valid number.

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
7 years agousb: gadget: g_dnl: hold maximum string descriptor
Felipe Balbi [Wed, 22 Feb 2017 15:12:39 +0000 (17:12 +0200)]
usb: gadget: g_dnl: hold maximum string descriptor

A USB String descriptor can be up to 255 characters long and it's not
NULL terminated according to the USB spec. This means our
MAX_STRING_SERIAL should be 256 (to cope with NULL terminator).

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
7 years agovideo: Fix crash when scroll screen
eric.gao@rock-chips.com [Mon, 10 Apr 2017 02:02:20 +0000 (10:02 +0800)]
video: Fix crash when scroll screen

After enabling log printing to lcd, when the screen starts
scrolling, system crashes. Log is shown as bellow:

    "Synchronous Abort" handler, esr 0x96000045
    "Synchronous Abort" handler, esr 0x96000045

Checking the source code, we found that the variable "pixels"
gets a wrong value:

    int pixels = VIDEO_FONT_HEIGHT * vid_priv->line_length;

"pixels" here means the value of pixels for a character, rather
than the bytes for a character. So the variable "pixels" is 4
times bigger than it's exact value, which will cause the memory
overflow when the cpu runs the following code:

    for (i = 0; i < pixels; i++)
        *dst++ = clr; <<----

Signed-off-by: Eric Gao <eric.gao@rock-chips.com>
7 years agoat91: video: DT binding for HLCDC driver
Songjun Wu [Tue, 11 Apr 2017 08:33:31 +0000 (16:33 +0800)]
at91: video: DT binding for HLCDC driver

DT binding documentation for atmel HLCDC driver.

Signed-off-by: Songjun Wu <songjun.wu@microchip.com>
7 years agoMerge branch 'master' of git://git.denx.de/u-boot-socfpga
Tom Rini [Fri, 14 Apr 2017 13:05:57 +0000 (09:05 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-socfpga

7 years agoMerge branch 'master' of git://git.denx.de/u-boot-mmc
Tom Rini [Fri, 14 Apr 2017 13:05:46 +0000 (09:05 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-mmc

7 years agoat91: video: Support driver-model for the HLCD driver
Songjun Wu [Tue, 11 Apr 2017 08:33:30 +0000 (16:33 +0800)]
at91: video: Support driver-model for the HLCD driver

Add driver-model support to this driver.

Signed-off-by: Songjun Wu <songjun.wu@microchip.com>
7 years agousb: dwc2: add support for external vbus supply
Kever Yang [Fri, 10 Mar 2017 04:05:14 +0000 (12:05 +0800)]
usb: dwc2: add support for external vbus supply

Some board do not use the dwc2 internal VBUS_DRV signal, but
use a gpio pin to enable the 5.0V VBUS power, add interface to
enable the power in dwc2 driver.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agoarm: socfpga: sr1500 use environment in common header
Dalon Westergreen [Thu, 13 Apr 2017 14:30:36 +0000 (07:30 -0700)]
arm: socfpga: sr1500 use environment in common header

This removes the default environment from the sr1500 header
and instead uses the common environment provided in
socfpga_common.h which now uses distro boot.

This board has no upstream devicetree in the kernel source,
so set to socfpga_cyclone5_sr1500.dtb.

Signed-off-by: Dalon Westergreen <dwesterg@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>
--
Changes in v2:
 - Remove unneeded CONFIG_BOOTFILE
 - set devicetree name to match socfpga_{fpga model}_{board model}.dts
   pattern

7 years agoarm: socfpga: Socrates use environment in common header
Dalon Westergreen [Thu, 13 Apr 2017 14:30:35 +0000 (07:30 -0700)]
arm: socfpga: Socrates use environment in common header

This removes the default environment from the socrates headers
and instead uses the common environment provided in
socfpga_common.h which now uses distro boot.

Change default devicetree name to match devicetree name in
upstream kernel source.

Signed-off-by: Dalon Westergreen <dwesterg@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>
--
Changes in v2:
 - Remove unneeded CONFIG_BOOTFILE

7 years agoarm: socfpga: SoCKit use environment in common header
Dalon Westergreen [Thu, 13 Apr 2017 14:30:34 +0000 (07:30 -0700)]
arm: socfpga: SoCKit use environment in common header

This removes the default environment from the SoCKit headers
and instead uses the common environment provided in
socfpga_common.h which now uses distro boot.

Change default devicetree name to match devicetree name in
upstream kernel source.

Signed-off-by: Dalon Westergreen <dwesterg@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>
--
Changes in v2:
 - Remove unneeded CONFIG_BOOTFILE

7 years agoarm: socfpga: DE1 use environment in common header
Dalon Westergreen [Thu, 13 Apr 2017 14:30:33 +0000 (07:30 -0700)]
arm: socfpga: DE1 use environment in common header

This removes the default environment from the de1 headers
and instead uses the common environment provided in
socfpga_common.h which now uses distro boot.

This board does not have a devicetree in the upstream kernel
source so set devicetree to socfpga_cyclone5_de1_soc.dtb.

Signed-off-by: Dalon Westergreen <dwesterg@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>
--
Changes in V2:
 - Remove unneeded CONFIG_BOOTFILE
 - set devicetree name to match socfpga_{fpga model}_{board model}.dts
   pattern

7 years agoarm: socfpga: C5 SoCDK use environment in common header
Dalon Westergreen [Thu, 13 Apr 2017 14:30:32 +0000 (07:30 -0700)]
arm: socfpga: C5 SoCDK use environment in common header

This removes the default environment from the C5 SoCDK headers
and instead uses the common environment provided in
socfpga_common.h which now uses distro boot.

In addition to the above, add support to boot from the custom
a2 type partition.

Change default devicetree name to match devicetree name in
upstream kernel source.

Signed-off-by: Dalon Westergreen <dwesterg@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>
--
Changes in v2:
 - Remove unneeded CONFIG_BOOTFILE

7 years agoarm: socfpga: A5 SoCDK use environment in common header
Dalon Westergreen [Thu, 13 Apr 2017 14:30:31 +0000 (07:30 -0700)]
arm: socfpga: A5 SoCDK use environment in common header

This removes the default environment from the A5 socdk headers
and instead uses the common environment provided in
socfpga_common.h which now uses distro boot.

Add support to boot from the custom a2 type partition.

Change default devicetree name to match devicetree name in
upstream kernel source.

Signed-off-by: Dalon Westergreen <dwesterg@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>
--
Changes in v3:
 - Fix small typo in defconfig, missing "C"
Changes in v2:
 - Remove unneeded CONFIG_BOOTFILE
 - Fix dtb name

a5config test

Signed-off-by: Dalon Westergreen <dwesterg@gmail.com>