platform/kernel/u-boot.git
5 years agoARM: vybrid: Provide pinctrl driver for Vybrid (vf610)
Lukasz Majewski [Mon, 19 Nov 2018 23:38:06 +0000 (00:38 +0100)]
ARM: vybrid: Provide pinctrl driver for Vybrid (vf610)

This implementation comply with other iMX devices pinctrl drivers already
available in U-boot.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
5 years agospl: introduce function prototypes
Peng Fan [Sat, 17 Nov 2018 09:10:31 +0000 (09:10 +0000)]
spl: introduce function prototypes

Introduce function prototypes for board_spl_fit_size_align and
board_spl_fit_post_load

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoSPL: Add HAB image authentication to FIT
Ye Li [Sat, 17 Nov 2018 09:10:25 +0000 (09:10 +0000)]
SPL: Add HAB image authentication to FIT

Introduce two board level callback functions to FIT image loading process, and
a SPL_FIT_FOUND flag to differentiate FIT image or RAW image.

Implement functions in imx common SPL codes to call HAB funtion
to authenticate the FIT image. Generally, we have to sign multiple regions
in FIT image:
1. Sign FIT FDT data (configuration)
2. Sign FIT external data (Sub-images)

Because the CSF supports to sign multiple memory blocks, so that we can use one
signature to cover all regions in FIT image and only authenticate once.
The authentication should be done after the entire FIT image is loaded into
memory including all sub-images.
We use "-p" option to generate FIT image to reserve a space for FIT IVT
and FIT CSF, also this help to fix the offset of the external data (u-boot-nodtb.bin,
ATF, u-boot DTB).

The signed FIT image layout is as below:
--------------------------------------------------
|     |     |     |   |           |     |        |
| FIT | FIT | FIT |   | U-BOOT    | ATF | U-BOOT |
| FDT | IVT | CSF |   | nodtb.bin |     |   DTB  |
|     |     |     |   |           |     |        |
--------------------------------------------------

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoimx: bootaux: fix stack and pc assignment on 64-bit platforms
Gary Bisson [Wed, 14 Nov 2018 16:55:29 +0000 (17:55 +0100)]
imx: bootaux: fix stack and pc assignment on 64-bit platforms

Using ulong is wrong as its size depends on the Host CPU architecture
(32-bit vs. 64-bit) although the Cortex-M4 is always 32-bit.

Without this patch, the stack and PC are obviously wrong and it
generates an abort when used on 64-bit processors such as the i.MX8MQ.

Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
5 years agoimx: mx8m: add memory mapping for CAAM and TCM
Gary Bisson [Wed, 14 Nov 2018 16:55:28 +0000 (17:55 +0100)]
imx: mx8m: add memory mapping for CAAM and TCM

Otherwise can't boot the M4 core as it is impossible to load its
firmware into the TCM memory.

Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
5 years agotools: improve portability of imx_cntr_image.sh
Martin Husemann [Fri, 9 Nov 2018 13:30:14 +0000 (14:30 +0100)]
tools: improve portability of imx_cntr_image.sh

Replace non-portable operator == with =

The operator == in sh(1) / test(1) is non-POSIX and only implemented by
some shells (like bash). It is equivalent to the standard defined operator =.

5 years agoembestmx6boards: Add SPL support
Fabien Lahoudere [Thu, 8 Nov 2018 10:28:05 +0000 (11:28 +0100)]
embestmx6boards: Add SPL support

In order to boot faster with falcon mode, we need to add SPL
support to riotboard.

Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
5 years agoimx: imx8qxp_mek: imximage: remove config.h
Peng Fan [Mon, 5 Nov 2018 10:01:34 +0000 (10:01 +0000)]
imx: imx8qxp_mek: imximage: remove config.h

config.h is not needed, remove it.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agodoc: imx: fix typos in mxsimage.txt
Michael Heimpold [Fri, 2 Nov 2018 22:12:02 +0000 (23:12 +0100)]
doc: imx: fix typos in mxsimage.txt

This fixes two small typos in mxsimage.txt.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
Reviewed-by: Breno Lima <breno.lima@nxp.com>
5 years agodoc: imx: fix typo in imximage.txt
Michael Heimpold [Fri, 2 Nov 2018 22:11:49 +0000 (23:11 +0100)]
doc: imx: fix typo in imximage.txt

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
Reviewed-by: Breno Lima <breno.lima@nxp.com>
5 years agoconfigs: mx23_olinuxino_defconfig: disable bootefi command
Michael Heimpold [Mon, 29 Oct 2018 19:21:52 +0000 (20:21 +0100)]
configs: mx23_olinuxino_defconfig: disable bootefi command

CONFIG_CMD_BOOTEFI is enabled by Kconfig default, but rarely
used on this board/platform.
So let's disable it for the boards default config.
This also saves around 16 KiB in the final u-boot.sb.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
5 years agoconfigs: mx23_olinuxino_defconfig: fix status led definition
Michael Heimpold [Mon, 29 Oct 2018 19:21:51 +0000 (20:21 +0100)]
configs: mx23_olinuxino_defconfig: fix status led definition

While migrating individual status led usages to Kconfig stuff,
a (random) value was introduced for this board which does not
work but produces the following error message during boot:

__led_init: failed requesting GPIO59!

Since Kconfig does not seem to accept a define as this point,
but the mxs gpio driver requires not only a simple integer value,
we need to use the plain value of MX23_PAD_SSP1_DETECT__GPIO_2_1.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
Fixes: 2d8d190c8394 ("status_led: Kconfig migration")

5 years agow1: Add driver for i.MX bus master controller
Martin Fuzzey [Wed, 24 Oct 2018 08:21:18 +0000 (10:21 +0200)]
w1: Add driver for i.MX bus master controller

Two variants of controllers are supported:
V1 (bitwise only) found in
i.MX21, i.MX27, i.MX31, i.MX51
V2 (byte operations) found in
i.MX25, i.MX35, i.MX50, i.MX53

Only tested on i.MX53 hardware but in both modes
(by modifying the device tree).

Signed-off-by: Martin Fuzzey <martin.fuzzey@flowbird.group>
5 years agowatchdog: imx: add config to disable wdog reset
Xiaoliang Yang [Thu, 18 Oct 2018 10:27:46 +0000 (18:27 +0800)]
watchdog: imx: add config to disable wdog reset

Add Kconfig option WATCHDOG_RESET_DISABLE to disable watchdog reset
in imx_watchdog driver, so that the watchdog will not be fed in
u-boot if CONFIG_WATCHDOG_RESET_DISABLE is enabled.

Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
5 years agowatchdog: driver support for fsl-lsch2
Xiaoliang Yang [Thu, 18 Oct 2018 10:27:45 +0000 (18:27 +0800)]
watchdog: driver support for fsl-lsch2

Support watchdog driver for fsl-lsch2. It's disabled in default.
If you want to use it, please enable CONFIG_IMX_WATCHDOG.
Define CONFIG_WATCHDOG_TIMEOUT_MSECS to set watchdog timeout.

Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
5 years agoboard: ge: Move VPD reading to the vpd_reader
Denis Zalevskiy [Wed, 17 Oct 2018 08:33:30 +0000 (10:33 +0200)]
board: ge: Move VPD reading to the vpd_reader

Merge functionality duplicated in bx50v3 and mx53ppd: the logic
is the same except that process_vpd is called at different phases.
Also read_vpd could end up in error, so there is no VPD data in this
case - it shouldn't be processed.

Signed-off-by: Denis Zalevskiy <denis.zalevskiy@ge.com>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
5 years agoboard: ge: Move VPD EEPROM configuration to the defconfig
Denis Zalevskiy [Wed, 17 Oct 2018 08:33:27 +0000 (10:33 +0200)]
board: ge: Move VPD EEPROM configuration to the defconfig

Use standard configuration logic to define EEPROM constants.
Names are based on VPD_EEPROM_ prefix because EEPROM_ is already
used by i2c_eeprom driver.

Signed-off-by: Denis Zalevskiy <denis.zalevskiy@ge.com>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
5 years agoboard: ge: Remove EEPROM bus param from read_vpd()
Denis Zalevskiy [Wed, 17 Oct 2018 08:33:26 +0000 (10:33 +0200)]
board: ge: Remove EEPROM bus param from read_vpd()

The bus is statically defined, so remove redundant parameters
from read_vpd() for PPD and Bx50v3.

Signed-off-by: Denis Zalevskiy <denis.zalevskiy@ge.com>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
5 years agowarp7: configs: add CONFIG_FIT option
Pierre-Jean Texier [Sat, 29 Sep 2018 12:05:01 +0000 (14:05 +0200)]
warp7: configs: add CONFIG_FIT option

This enable FIT image support.

Signed-off-by: Pierre-Jean Texier <pjtexier@koncepto.io>
5 years agoMerge branch 'master' of git://git.denx.de/u-boot-i2c
Tom Rini [Thu, 13 Dec 2018 14:36:55 +0000 (09:36 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-i2c

5 years agoMerge branch '2018-12-12-master-imports'
Tom Rini [Thu, 13 Dec 2018 00:45:07 +0000 (19:45 -0500)]
Merge branch '2018-12-12-master-imports'

- Various small TI platform updates
- Two unit test fixes
- qemu-arm updates

5 years agoam3517_evm: Use ttyS2 instead of ttyO2
Adam Ford [Mon, 10 Dec 2018 20:56:36 +0000 (14:56 -0600)]
am3517_evm: Use ttyS2 instead of ttyO2

The serial driver in the kernel moved from ttyOx to ttySx a while
ago.  This patch updates the console parameter to align with the
kernel change.

Signed-off-by: Adam Ford <aford173@gmail.com>
5 years agofirmware: psci: introduce SPL_ARM_PSCI_FW
Peng Fan [Sun, 9 Dec 2018 12:45:45 +0000 (12:45 +0000)]
firmware: psci: introduce SPL_ARM_PSCI_FW

Introduce a new macro SPL_ARM_PSCI_FW

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Stefano Babic <sbabic@denx.de>
5 years agotest: overlay: NULL passed as fdt
Heinrich Schuchardt [Sat, 8 Dec 2018 08:53:05 +0000 (09:53 +0100)]
test: overlay: NULL passed as fdt

The uts created in do_ut_overlay() is not the one used in
cmd_ut_category(). Currently all tests are therefore called with
uts->priv = NULL and fail.

Using a static variable is the easiest fix here.

Fixes: e93232e15ec9 ("test: overlay: Use cmd_ut_category()")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoARM: omap3logic: Remove legacy USB code in favor of DM_USB
Adam Ford [Fri, 7 Dec 2018 23:28:03 +0000 (17:28 -0600)]
ARM: omap3logic: Remove legacy USB code in favor of DM_USB

With the defconfig options enabling DM_USB, the legacy code
can be removed.

Signed-off-by: Adam Ford <aford173@gmail.com>
5 years agoARM: omap3_logic/omap35_logic: Move to DM_USB
Adam Ford [Fri, 7 Dec 2018 20:38:33 +0000 (14:38 -0600)]
ARM: omap3_logic/omap35_logic: Move to DM_USB

The existing config is setup as a gadget but it doesn't use
DM_USB.  This patch converts all boards to DM_USB, but as host.

As host, it is able to mount USB drives and browse them.

Signed-off-by: Adam Ford <aford173@gmail.com>
5 years agoarm: am335x-pdu001: Move from embedded to separate DTB
Felix Brack [Fri, 7 Dec 2018 14:01:55 +0000 (15:01 +0100)]
arm: am335x-pdu001: Move from embedded to separate DTB

There is no need for an embedded device tree for this board so let the
build process generate a separate u-boot.dtb file instead.

Signed-off-by: Felix Brack <fb@ltec.ch>
5 years agospl: fix build failure with !CONFIG_SPL_PCI_SUPPORT
Sekhar Nori [Thu, 6 Dec 2018 10:10:08 +0000 (15:40 +0530)]
spl: fix build failure with !CONFIG_SPL_PCI_SUPPORT

Building U-Boot with CONFIG_PCI and CONFIG_DM_PCI enabled, but
CONFIG_SPL_PCI_SUPPORT disabled, results in following linker
error:

lib/built-in.o: In function `fdtdec_get_pci_bar32':
lib/fdtdec.c:305: undefined reference to `dm_pci_read_bar32'
fdtdec.c:305:(.text.fdtdec_get_pci_bar32+0x24): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `dm_pci_read_bar32'

This is because reference to dm_pci_read_bar32() remains in lib/fdtdec.c
while SPL build does not descend into drivers/pci directory in
drivers/Makefile if CONFIG_SPL_PCI_SUPPORT is not enabled.

Fix this by applying appropriate #define guards in lib/fdtdec.c.
It looks like ns16550.c has the same problem, so fixed that too.

To simplify this, CONFIG_SPL_PCI_SUPPORT is renamed to CONFIG_SPL_PCI
(enables use of CONFIG_IS_ENABLED() macro).

Suggested-by: Vignesh R <vigneshr@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agodefconfigs: am335x_hs_evm: Sync HS and non-HS defconfigs
Andrew F. Davis [Wed, 5 Dec 2018 18:33:33 +0000 (12:33 -0600)]
defconfigs: am335x_hs_evm: Sync HS and non-HS defconfigs

Sync new additions to non-HS defconfig with HS defconfig.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agofdt: Add warning about CONFIG_OF_EMBED
Simon Glass [Wed, 5 Dec 2018 13:57:08 +0000 (06:57 -0700)]
fdt: Add warning about CONFIG_OF_EMBED

This option has crept into use with some boards. Add a warning to try to
prevent this.

As an example:
   https://lists.denx.de/pipermail/u-boot/2017-September/304966.html

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agoblk: Rework guard around part_init call
Tom Rini [Wed, 5 Dec 2018 13:23:38 +0000 (08:23 -0500)]
blk: Rework guard around part_init call

The function part_init() will only be built when we have both
CONFIG_PARTITIONS and CONFIG_HAVE_BLOCK_DEVICE set.  Protect the call to
this function with both of these tests now.

Cc: Simon Glass <sjg@chromium.org>
Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: York Sun <york.sun@nxp.com>
Cc: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
Cc: Mingkai Hu <mingkai.hu@nxp.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Marek BehĂșn <marek.behun@nic.cz>
Cc: Vanessa Maegima <vanessa.maegima@nxp.com>
Cc: Eugen Hristev <eugen.hristev@microchip.com>
Cc: Adam Ford <aford173@gmail.com>
Cc: Jagan Teki <jagan@amarulasolutions.com>
Cc: Tom Warren <twarren@nvidia.com>
Cc: Stephen Warren <swarren@nvidia.com>
Cc: Vitaly Andrianov <vitalya@ti.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agotest: hexdump: fix misplaced return
Simon Goldschmidt [Tue, 4 Dec 2018 20:30:08 +0000 (21:30 +0100)]
test: hexdump: fix misplaced return

One of the hexdump tests in test/lib/hexdump.c returns right at the
start of the function without testing anything.

Fix this by moving the 'return 0;' statement to the end of the function.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agoqemu-arm: Add persistent environment support
Sumit Garg [Mon, 26 Nov 2018 11:20:17 +0000 (16:50 +0530)]
qemu-arm: Add persistent environment support

Currently on qemu-arm platforms environment is kept in RAM. Instead
use pflash device 1 to provide persistent environment support across
device reset.

Also (optionally) provide support for persistent environment across
qemu machine OFF/ON using following instructions:

- Create envstore.img using qemu-img:
    qemu-img create -f raw envstore.img 64M
- Add a pflash drive parameter to the command line:
    -drive if=pflash,format=raw,index=1,file=envstore.img

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
5 years agoqemu-arm: Enable VirtIO distro target
Sumit Garg [Tue, 13 Nov 2018 04:51:24 +0000 (10:21 +0530)]
qemu-arm: Enable VirtIO distro target

With -device virtio-blk-device,drive=hd0, it could detect distro boot
target.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Alexander Graf <agraf@suse.de>
5 years agoi2c: tegra: Fix regression by implementing a dummy probe_chip() callback
Jean-Jacques Hiblot [Tue, 11 Dec 2018 18:56:34 +0000 (19:56 +0100)]
i2c: tegra: Fix regression by implementing a dummy probe_chip() callback

Commit f32a8007ef0f ("dm: i2c: Make i2c_get_chip_for_busnum() fail if the
chip is not detected") introduced a regression for the NVIDIA Jetson TX2.

For some reason the xfer callback of the tegra i2c driver doesn't support
probing the I2C devices with a 0-length message.
Fixing the regression by providing a dummy implementation of probe_chip()
that does nothing.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
5 years agoARM: davinci: Orphan Spectrum Digital AM18xx EVM
Adam Ford [Tue, 11 Dec 2018 13:41:03 +0000 (07:41 -0600)]
ARM: davinci: Orphan Spectrum Digital AM18xx EVM

I had requested the da850 boards because their previous maintainer
had an invalid e-mail address.  I work at Logic PD who makes
the da850-evm kits, so I have access to various boards of theirs.

The Spectrum Digital AM18xx board is based on the Logic PD
da850 EVM, but it's not the same company.  Since I don't have the
hardware to test/verify changes, I would prefer to not be
responsible for this board.

Signed-off-by: Adam Ford <aford173@gmail.com>
5 years agotravis: Add check for configs without MAINTAINERS entries
Tom Rini [Thu, 6 Dec 2018 21:39:43 +0000 (16:39 -0500)]
travis: Add check for configs without MAINTAINERS entries

The genboardscfg.py script will emit a WARNING message if we have new
defconfig files that are not listed in a MAINTAINERS file.  Make new
cases of this a failure we catch in Travis-CI.

Signed-off-by: Tom Rini <trini@konsulko.com>
5 years agoMerge tag 'fsl-qoriq-for-v2019.01-rc2' of git://git.denx.de/u-boot-fsl-qoriq
Tom Rini [Mon, 10 Dec 2018 22:12:52 +0000 (17:12 -0500)]
Merge tag 'fsl-qoriq-for-v2019.01-rc2' of git://git.denx.de/u-boot-fsl-qoriq

Add TFA boot flow for some Layerscape platforms
Add support for lx2160a SoC

[trini: Add a bunch of missing MAINTAINERS entries]
Signed-off-by: Tom Rini <trini@konsulko.com>
5 years agoMerge tag 'mips-fixes-for-2019.01' of git://git.denx.de/u-boot-mips
Tom Rini [Mon, 10 Dec 2018 22:12:28 +0000 (17:12 -0500)]
Merge tag 'mips-fixes-for-2019.01' of git://git.denx.de/u-boot-mips

- mips: bcm: disable CONFIG_SWAP_IO_SPACE to force native endianess in readl() & co.
  this fixes 09ace9161b95ad3a04b33d1d6a65a929901d28c8
- mips: bcm6838: fix device tree warning

5 years agobmips: bcm6838: fix device tree warning
Álvaro Fernåndez Rojas [Mon, 10 Dec 2018 16:42:58 +0000 (17:42 +0100)]
bmips: bcm6838: fix device tree warning

Signed-off-by: Álvaro Fernåndez Rojas <noltari@gmail.com>
5 years agobmips: swapping IO space isn't required
Álvaro Fernåndez Rojas [Sun, 9 Dec 2018 09:41:27 +0000 (10:41 +0100)]
bmips: swapping IO space isn't required

Signed-off-by: Álvaro Fernåndez Rojas <noltari@gmail.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
5 years agoMerge tag 'for-master-20181210' of git://git.denx.de/u-boot-rockchip
Tom Rini [Mon, 10 Dec 2018 15:19:09 +0000 (10:19 -0500)]
Merge tag 'for-master-20181210' of git://git.denx.de/u-boot-rockchip

Improvements:
- init DRAM for RK322x in SPL
- add FAN53555 PMIC/regulator driver
- update MicroCrystal RV3029 driver to Kconfig and sync from Linux
- add bootcount uclass and first DM-driver for bootcount

5 years agoMerge branch 'master' of git://git.denx.de/u-boot-i2c
Tom Rini [Mon, 10 Dec 2018 12:16:33 +0000 (07:16 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-i2c

- DM_I2C_COMPAT removal for all ti platforms from Jean-Jacques Hiblot
- Fix in i2c command help output from Chirstoph Muellner.

5 years agoMerge branch 'master' of git://git.denx.de/u-boot-sh
Tom Rini [Mon, 10 Dec 2018 12:15:55 +0000 (07:15 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-sh

5 years agoMerge branch 'master' of git://git.denx.de/u-boot-socfpga
Tom Rini [Mon, 10 Dec 2018 12:15:41 +0000 (07:15 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-socfpga

5 years agoMerge branch 'master' of git://git.denx.de/u-boot-usb
Tom Rini [Mon, 10 Dec 2018 12:15:12 +0000 (07:15 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-usb

- DWC3 and UDC cleanup

5 years agoMerge git://git.denx.de/u-boot-x86
Tom Rini [Mon, 10 Dec 2018 12:14:48 +0000 (07:14 -0500)]
Merge git://git.denx.de/u-boot-x86

- Enable RTC for Intel Tangier
- Wrap the call to 8259 PIC with Kconfig options for old targets without
  8259
- Warp the call to USB init with Kconfg options for coreboot & EFI
  payload

5 years agorockchip: rk3399-puma: enable fan53555 regulators in DTS
Philipp Tomsich [Fri, 30 Nov 2018 19:00:10 +0000 (20:00 +0100)]
rockchip: rk3399-puma: enable fan53555 regulators in DTS

Now that we have FAN53555 support, we can enable the regulators in our
DTS.  To make these easier to identify on the U-Boot commandline, we
rename them to the names of the voltage rails they control.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
5 years agorockchip: rk3399-puma: defconfig: enable FAN53555 regulator driver
Philipp Tomsich [Fri, 30 Nov 2018 19:00:09 +0000 (20:00 +0100)]
rockchip: rk3399-puma: defconfig: enable FAN53555 regulator driver

With a driver for the FAN53555 regulator family available, let's
enable it for the RK3399-Q7 (which has two of these devices
on-module).

We enable this for the full U-Boot stage only, as these regulators
provide a suitable default voltage and supply non-critical (i.e.
for booting up) power rails only.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
5 years agopower: add FAN53555 family support
Philipp Tomsich [Fri, 30 Nov 2018 19:00:08 +0000 (20:00 +0100)]
power: add FAN53555 family support

This adds a driver for the FAN53555 family of regulators and wraps it
in a PMIC implementation.

While these devices support a 'normal' and 'suspend' mode (controlled
via an external pin) to switch between two programmable voltages, this
incarnation of the driver assumes that the device is always operating
in 'normal' mode.

Only setting/reading the programmed voltage is supported at this time
and the following device functionality remains unsupported:
  - switching the selected voltage (via a GPIO)
  - disabling the voltage output via software-control
This matches the functionality of the Linux driver.

Tested on a RK3399-Q7 (with 'option 5' devices): setting voltages from
the U-Boot shell and verifying output voltages on the board.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Tested-by: Klaus Goger <klaus.goger@theobroma-systems.com>
5 years agobootcount: add a DM RTC backing store for bootcount
Philipp Tomsich [Tue, 27 Nov 2018 22:00:19 +0000 (23:00 +0100)]
bootcount: add a DM RTC backing store for bootcount

This implements a driver using a RTC-based backing store for the DM
bootcount implementation.  The node configuring this feature will be
compatible with 'u-boot,bootcount-rtc' and the underlying RTC device
shall be reference through the property 'rtc'. An offset into the RTC
device's register space can be provided through the 'offset' property.

Tested on a RK3399-Q7 on a Flamingo carrier board using the SRAM area
of the carrier board's RV3029 RTC.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
5 years agobootcount: add uclass for bootcount
Philipp Tomsich [Tue, 27 Nov 2018 22:00:18 +0000 (23:00 +0100)]
bootcount: add uclass for bootcount

The original bootcount methods do not provide an interface to DM and
rely on a static configuration for I2C devices (e.g. bus, chip-addr,
etc. are configured through defines statically).  On a modern system
that exposes multiple devices in a DTS-configurable way, this is less
than optimal and a interface to DM-based devices will be desirable.

This adds a simple driver that is DM-aware and configurable via DTS.
If ambiguous (i.e. multiple bootcount-devices are present) the
/chosen/u-boot,bootcount-device property can be used to select one
bootcount device.

Initially, this provides support for the following DM devices:
 * RTC devices

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Tested-by: Klaus Goger <klaus.goger@theobroma-systems.com>
5 years agorockchip: rk322x: ram: enable DRAM init in SPL instead of TPL
Kever Yang [Tue, 4 Dec 2018 09:49:58 +0000 (17:49 +0800)]
rockchip: rk322x: ram: enable DRAM init in SPL instead of TPL

Patch for rk322x TPL is not merged, and only SPL is available now,
enable the sdram driver in SPL first. We should update back to TPL
after TPL is enabled for rk322x.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
5 years agocmd: i2c: Fix help output of i2c command.
Christoph Muellner [Tue, 4 Dec 2018 10:27:18 +0000 (11:27 +0100)]
cmd: i2c: Fix help output of i2c command.

In case SYS_I2C or DM_I2C are defined, then the "i2c " prefix
of the "i2c crc32" command is missing.
This patch addresses this, so that users can't get confused
by the "crc32" command.

Without the patch we get

    => i2c help
    i2c - I2C sub-system

    Usage:
    i2c bus [muxtype:muxaddr:muxchannel] - show I2C bus info
    crc32 chip address[.0, .1, .2] count - compute CRC32 checksum
    i2c dev [dev] - show or set current I2C bus
    [...]

With the patch we get

    => i2c help
    i2c - I2C sub-system

    Usage:
    i2c bus [muxtype:muxaddr:muxchannel] - show I2C bus info
    i2c crc32 chip address[.0, .1, .2] count - compute CRC32 checksum
    i2c dev [dev] - show or set current I2C bus
    ...

Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agodra7: Allow selecting a new dtb after board detection.
Jean-Jacques Hiblot [Fri, 7 Dec 2018 13:50:55 +0000 (14:50 +0100)]
dra7: Allow selecting a new dtb after board detection.

The DRA7 platforms requires that the dtb used in the SPL really matches the
platform  to have the best MMC performances.
To detect the board type/version an I2C EEPROM is read. This requires that
DM is initialized before the detection. As a consequence we must reset the
DM after the board detection is a new dtb would better match the platform.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agodrivers: core: nullify gd->dm_root after dm_uninit()
Jean-Jacques Hiblot [Fri, 7 Dec 2018 13:50:54 +0000 (14:50 +0100)]
drivers: core: nullify gd->dm_root after dm_uninit()

To reset the DM after a new dtb is loaded, we need to call dm_uninit()
and then dm_init(). This fails however because gd->dm_root is not nullified
by dm_uninit().
Fixing it by setting gd->dm_root in dm_uninit().

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agodrivers: core: Add the option SPL_DM_DEVICE_REMOVE to the Kconfig
Jean-Jacques Hiblot [Fri, 7 Dec 2018 13:50:53 +0000 (14:50 +0100)]
drivers: core: Add the option SPL_DM_DEVICE_REMOVE to the Kconfig

It is currently not possible to include the support to remove devices in
the SPL. This is however needed by platforms that re-select their dtb after
DM is initialized; they need to remove all the previously bound devices
before triggering a scan of the new DT.

Add a Kconfig option to be able to include the support for device removal
in the SPL.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Seeries-changes:3
- update commit message
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agolib: fdtdec: Add function re-setup the fdt more effeciently
Jean-Jacques Hiblot [Fri, 7 Dec 2018 13:50:52 +0000 (14:50 +0100)]
lib: fdtdec: Add function re-setup the fdt more effeciently

In some cases it may be useful to be able to change the fdt we have been
using and use another one instead. For example, the TI platforms uses an
EEPROM to store board information and, based on the type of board,
different dtbs are used by the SPL. When DM_I2C is used, a first dtb must
be used before the I2C is initialized and only then the final dtb can be
selected.
To speed up the process and reduce memory usage, introduce a new function
fdtdec_setup_best_match() that re-use the DTBs loaded in memory by
fdtdec_setup() to select the best match.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agoconfigs: dra7xx-evm: increase the size of the malloc's pool before relocation
Jean-Jacques Hiblot [Fri, 7 Dec 2018 13:50:51 +0000 (14:50 +0100)]
configs: dra7xx-evm: increase the size of the malloc's pool before relocation

This is required to take advantage of MULTI_DTB_FIT before relocation.
If it is too low, DM will be initialized only after relocation has
taken place. That is too late for the DRA7 because I2C DM is used before
the relocation to setup the voltages required, among other things, to
properly initialize the DRAM.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agoam57xx: remove non-DM I2C code
Jean-Jacques Hiblot [Fri, 7 Dec 2018 13:50:50 +0000 (14:50 +0100)]
am57xx: remove non-DM I2C code

am57xx configs uses DM_I2C both in SPL and u-boot.
Remove code for non-DM I2C support.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agoti: remove usage of DM_I2C_COMPAT and don't disable DM_I2C in SPL
Jean-Jacques Hiblot [Fri, 7 Dec 2018 13:50:49 +0000 (14:50 +0100)]
ti: remove usage of DM_I2C_COMPAT and don't disable DM_I2C in SPL

DM_I2C_COMPAT is a compatibility layer that allows using the non-DM I2C
API when DM_I2C is used. The goal is to eventually remove DM_I2C_COMPAT
when all I2C "clients" have been migrated to use the DM API.
This a step in that direction for the TI based platforms.
Build tested with buildman:
buildman -dle am33xx ti omap3 omap4 omap5 davinci keystone

boot tested with:
am335x_evm, am335x_boneblack, am335x_boneblack_vboot (DM version),
am57xx_evm, dra7xx_evm, k2g_evm, am437x_evm

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agoconfigs: am335x_pdu001: remove CONFIG_DM_I2C_COMPAT
Jean-Jacques Hiblot [Fri, 7 Dec 2018 13:50:48 +0000 (14:50 +0100)]
configs: am335x_pdu001: remove CONFIG_DM_I2C_COMPAT

Remove the last call to the non-DM I2C API.
Also remove the #undef CONFIG_DM_I2C_COMPAT because it is not defined
in the common header file anymore.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Felix Brack <fb@ltec.ch>
Tested-by: Felix Brack <fb@ltec.ch>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agoti: common: board_detect: Allow DM I2C without CONFIG_DM_I2C_COMPAT
Andreas Dannenberg [Fri, 7 Dec 2018 13:50:47 +0000 (14:50 +0100)]
ti: common: board_detect: Allow DM I2C without CONFIG_DM_I2C_COMPAT

The EEPROM reading in the board detection code is done through legacy
I2C functions which on platforms using DM_I2C this functionality is
provided via the CONFIG_DM_I2C_COMPAT layer. To allow newer platforms
to use the board detection code without relying on CONFIG_DM_I2C_COMPAT
go ahead and add an I2C handling implementation that directly uses the
I2C DM functionality.

Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agopower: make most tps drivers and the twl4030 driver compatible with DM_I2C
Jean-Jacques Hiblot [Fri, 7 Dec 2018 13:50:46 +0000 (14:50 +0100)]
power: make most tps drivers and the twl4030 driver compatible with DM_I2C

Those driver are not DM drivers per se (not using the PMIC/regulator
framework) and are using the legacy I2C API. Make them compatible with
the DM_I2C API.

This impacts the following drivers:
- palmas (used by am57xx/dra7xx evms)
- tps65218 (used by am43xx evms)
- tps65217 and tps65910 (used by am335x evms and am335x boneblack vboot)
- twl4030 (used by omap3_logicpd)
- tps65217 (used by brppt1)
- twl6030

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agoomap: detect the board after DM is available
Jean-Jacques Hiblot [Fri, 7 Dec 2018 13:50:45 +0000 (14:50 +0100)]
omap: detect the board after DM is available

In order to use DM_I2C, we need to move the board detection after the
early SPL initialization.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agodts: am43x: omap5: Add node for I2C in SPL
Jean-Jacques Hiblot [Fri, 7 Dec 2018 13:50:44 +0000 (14:50 +0100)]
dts: am43x: omap5: Add node for I2C in SPL

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agoam335x: Register the I2C controllers if DM_I2C is used.
Jean-Jacques Hiblot [Fri, 7 Dec 2018 13:50:43 +0000 (14:50 +0100)]
am335x: Register the I2C controllers if DM_I2C is used.

If DM_I2C is used , the I2C controllers must be registered as U_BOOT_DEVICE
because OF_CONTROL is not used in the SPL.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agoi2c: omap24xx_i2c: Use platdata to probe the device
Jean-Jacques Hiblot [Fri, 7 Dec 2018 13:50:42 +0000 (14:50 +0100)]
i2c: omap24xx_i2c: Use platdata to probe the device

This allows the driver to be used without OF_CONTROL.
AM335x support DM_SPL but does not use SPL_OF_CONTROL. Enabling DM_I2C in
SPL thus requires that the omap I2C can be passed platdata.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agoi2c: omap24xx_i2c: Move away from SoC specific headers for reg offset
Vignesh R [Fri, 7 Dec 2018 13:50:41 +0000 (14:50 +0100)]
i2c: omap24xx_i2c: Move away from SoC specific headers for reg offset

Move away from SoC specific headers to handle different register layout.
Instead use driver data to get appropriate register layouts like in the
kernel. While at it, perform some mostly cosmetic alignment/cleanup in
the functions being updated.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agoconfigs: am335x: am57x: dra7x: Enable CONFIG_SPL_DM_SEQ_ALIAS
Jean-Jacques Hiblot [Fri, 7 Dec 2018 13:50:40 +0000 (14:50 +0100)]
configs: am335x: am57x: dra7x: Enable CONFIG_SPL_DM_SEQ_ALIAS

Those platforms need CONFIG_SPL_DM_SEQ_ALIAS because they enable both
DM_I2C and SPL_DM. Without CONFIG_SPL_DM_SEQ_ALIAS, it is not possible to
get the I2C bus with i2c_get_chip_for_busnum().

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Felix Brack <fb@ltec.ch>
Tested-by: Felix Brack <fb@ltec.ch>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agodm: device: Allow using uclass_find_device_by_seq() without OF_CONTROL
Jean-Jacques Hiblot [Fri, 7 Dec 2018 13:50:39 +0000 (14:50 +0100)]
dm: device: Allow using uclass_find_device_by_seq() without OF_CONTROL

If OF_CONTROL is not enabled and DM_SEQ_ALIAS is enabled, we must
assign an alias (requested sequence number) to devices that belongs to a
class with the DM_UC_FLAG_SEQ_ALIAS flag. Otherwise
uclass_find_device_by_seq() cannot be used to get/probe a device. In
particular i2c_get_chip_for_busnum() cannot be used.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agodm: i2c: Make i2c_get_chip_for_busnum() fail if the chip is not detected
Jean-Jacques Hiblot [Fri, 7 Dec 2018 13:50:38 +0000 (14:50 +0100)]
dm: i2c: Make i2c_get_chip_for_busnum() fail if the chip is not detected

i2c_get_chip_for_busnum() really should check the presence of the chip on
the bus. Most of the users of this function assume that this is done.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agocmd: Kconfig: Do not include EEPROM if DM_I2C is used without DM_I2C_COMPAT
Jean-Jacques Hiblot [Fri, 7 Dec 2018 13:50:37 +0000 (14:50 +0100)]
cmd: Kconfig: Do not include EEPROM if DM_I2C is used without DM_I2C_COMPAT

The implementation of the EEPROM commands does not support the DM I2C API.
Prevent compilation breakage by not enabling it if the non-DM API is not
available (if DM_I2C is used without DM_I2C_COMPAT)

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agoefi: payload: only init usb if necessary
Bin Meng [Fri, 30 Nov 2018 04:07:13 +0000 (20:07 -0800)]
efi: payload: only init usb if necessary

Up until now the call to initialize the USB subsystem was hardcoded
for U-Boot running as an EFI payload. This was used to enable the
use of a USB keyboard in the U-Boot shell. However not all boards
might need this functionality. As initializing the USB subsystem can
take a considerable amount of time (several seconds on some boards),
we now initialize the USB subsystem only if U-Boot is configured to
use USB keyboards.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
5 years agocoreboot: only init usb if necessary
Thomas RIENOESSL [Fri, 30 Nov 2018 04:07:12 +0000 (20:07 -0800)]
coreboot: only init usb if necessary

Up until now the call to initialize the USB subsystem was hardcoded
for U-Boot running as a coreboot payload. This was used to enable
the use of a USB keyboard in the U-Boot shell. However not all boards
might need this functionality. As initializing the USB subsystem can
take a considerable amount of time (several seconds on some boards),
we now initialize the USB subsystem only if U-Boot is configured to
use USB keyboards.

Signed-off-by: Thomas RIENOESSL <thomas.rienoessl@bachmann.info>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
5 years agox86: kconfig: Allow board defconfig file to disable 8259 and APIC
Bin Meng [Fri, 30 Nov 2018 03:57:22 +0000 (19:57 -0800)]
x86: kconfig: Allow board defconfig file to disable 8259 and APIC

At present the Kconfig options (CONFIG_I8259_PIC and CONFIG_APIC)
do not include a prompt message, which makes it impossible to
be disabled from a board defconfig file.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agox86: Wrap calls to 8259 with CONFIG_I8259_PIC
Bin Meng [Fri, 30 Nov 2018 03:57:21 +0000 (19:57 -0800)]
x86: Wrap calls to 8259 with CONFIG_I8259_PIC

mask_irq(), unmask_irq() and specific_eoi() are provided by the
i8259 PIC driver and should be wrapped with CONFIG_I8259_PIC.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Hannes Schmelzer <oe5hpm@oevsv.at>
5 years agox86: make the LAPIC / IOAPIC construct switchable with Kconfig
Hannes Schmelzer [Sun, 18 Nov 2018 22:19:43 +0000 (23:19 +0100)]
x86: make the LAPIC / IOAPIC construct switchable with Kconfig

There are still systems running which do not have any LAPIC or even
IOAPIC. Responsible MSRs for those do not exist and the systems are
crashing on trying to setup LAPIC.

This commit makes the APIC stuff able to switch off for those boards
which dont' have an LAPIC / IOAPIC.

Signed-off-by: Hannes Schmelzer <oe5hpm@oevsv.at>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: acpi: Fix indentation in Intel Tangier ASL code
Andy Shevchenko [Sat, 10 Nov 2018 15:37:02 +0000 (17:37 +0200)]
x86: acpi: Fix indentation in Intel Tangier ASL code

Make the indentation aligned with what used elsewhere in U-Boot.

No functional change intended.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: acpi: Enable RTC for Intel Tangier
Andy Shevchenko [Sat, 10 Nov 2018 15:37:01 +0000 (17:37 +0200)]
x86: acpi: Enable RTC for Intel Tangier

Intel Tangier SoC has RTC inside. So, enable it in ACPI.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agoARM: mvebu: restore license information in mv_ddr_plat.{c,h}
Chris Packham [Sun, 9 Dec 2018 21:41:15 +0000 (10:41 +1300)]
ARM: mvebu: restore license information in mv_ddr_plat.{c,h}

This was unintentionally removed when syncing with upstream.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
5 years agoMerge git://git.denx.de/u-boot-marvell
Tom Rini [Sun, 9 Dec 2018 13:40:49 +0000 (08:40 -0500)]
Merge git://git.denx.de/u-boot-marvell

- Sync DDR training with Marvell code for Armada 38x by Chris
- Misc updates to Armada 38x Helios4 board by Aditya

5 years agoRoll CRC16-CCITT into the hash infrastructure
Philipp Tomsich [Sun, 25 Nov 2018 18:22:19 +0000 (19:22 +0100)]
Roll CRC16-CCITT into the hash infrastructure

The CRC16-CCITT checksum function is useful for space-constrained
applications (such as obtaining a checksum across a 2KBit or 4KBit
EEPROM) in boot applications. It has not been accessible from boot
scripts until now (due to not having a dedicated command and not being
supported by the hash infrstructure) limiting its applicability
outside of custom commands.

This adds the CRC16-CCITT (poly 0x1021, init 0x0) algorithm to the
list of available hashes and adds a new crc16_ccitt_wd_buf() to make
this possible.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
[trini: Fix building crc16.o for SPL/TPL]
Signed-off-by: Tom Rini <trini@konsulko.com>
5 years agolib: merge CRC16-CCITT into u-boot/crc.h
Philipp Tomsich [Sun, 25 Nov 2018 18:22:18 +0000 (19:22 +0100)]
lib: merge CRC16-CCITT into u-boot/crc.h

This merges the CRC16-CCITT headers into u-boot/crc.h to prepare for
rolling CRC16 into the hash infrastructure.  Given that CRC8, CRC32
and CRC32-C already have their prototypes in a single header file, it
seems a good idea to also include CRC16-CCITT in the same.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
5 years agoarm: mvebu: helios4: Reset uSOM onboard phy during board init
Aditya Prayoga [Tue, 4 Dec 2018 16:57:25 +0000 (00:57 +0800)]
arm: mvebu: helios4: Reset uSOM onboard phy during board init

Similar to Clearfog rev 2.1, GPIO 19 also used to reset onboard ethernet
PHY.

This patch depend on
net: mvneta: Add GPIO configuration support
[URL: https://patchwork.ozlabs.org/patch/1007736/]

Signed-off-by: Aditya Prayoga <aditya@kobol.io>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-By: Dennis Gilmore <dgilmore@redhat.com>
Reviewed-By: Dennis Gilmore <dgilmore@redhat.com>
Signed-off-by: Stefan Roese <sr@denx.de>
5 years agoarm: mvebu: helios4: Enable SPI flash support
Aditya Prayoga [Tue, 4 Dec 2018 16:57:24 +0000 (00:57 +0800)]
arm: mvebu: helios4: Enable SPI flash support

Enable SPI flash support under U-Boot and SPL. The ENV size and offset,
ported from U-Boot 2013.01 Marvell version: 2015_T1.0p16

To create U-Boot image for SPI flash, user would need to replace
* CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC with CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI
* CONFIG_ENV_IS_IN_MMC with CONFIG_ENV_IS_IN_SPI_FLASH

Signed-off-by: Aditya Prayoga <aditya@kobol.io>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-By: Dennis Gilmore <dgilmore@redhat.com>
Reviewed-By: Dennis Gilmore <dgilmore@redhat.com>
Signed-off-by: Stefan Roese <sr@denx.de>
5 years agoarm: mvebu: helios4: Reduce U-Boot image size
Aditya Prayoga [Tue, 4 Dec 2018 16:57:23 +0000 (00:57 +0800)]
arm: mvebu: helios4: Reduce U-Boot image size

Remove unused I2C support in SPL and use simple_malloc functions to
reduce SPL image size.
Since Helios4 does not have any PCIe allocated on SerDes, remove PCI
support. MTD layer on top of SPI flash is not needed, remove it also.

Signed-off-by: Aditya Prayoga <aditya@kobol.io>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-By: Dennis Gilmore <dgilmore@redhat.com>
Reviewed-By: Dennis Gilmore <dgilmore@redhat.com>
Signed-off-by: Stefan Roese <sr@denx.de>
5 years agoarm: mvebu: helios4: Enable mvebu GPIO
Aditya Prayoga [Tue, 4 Dec 2018 16:57:22 +0000 (00:57 +0800)]
arm: mvebu: helios4: Enable mvebu GPIO

Make use of U-Boot's GPIO DM to control native GPIO and I2C IO expander.

Signed-off-by: Aditya Prayoga <aditya@kobol.io>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-By: Dennis Gilmore <dgilmore@redhat.com>
Reviewed-By: Dennis Gilmore <dgilmore@redhat.com>
Signed-off-by: Stefan Roese <sr@denx.de>
5 years agoarm: mvebu: helios4: Enable I2C and IO Expander
Aditya Prayoga [Tue, 4 Dec 2018 16:57:21 +0000 (00:57 +0800)]
arm: mvebu: helios4: Enable I2C and IO Expander

Enable Marvell I2C driver and I2C IO expander. Set default bus to
external I2C bus. Define I2C aliases in device tree so it can be
recognized by the driver.

Signed-off-by: Aditya Prayoga <aditya@kobol.io>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-By: Dennis Gilmore <dgilmore@redhat.com>
Reviewed-By: Dennis Gilmore <dgilmore@redhat.com>
Signed-off-by: Stefan Roese <sr@denx.de>
5 years agoarm: mvebu: helios4: mmc: move environment before 1M
Aditya Prayoga [Tue, 4 Dec 2018 16:57:20 +0000 (00:57 +0800)]
arm: mvebu: helios4: mmc: move environment before 1M

Store the environment before 1M into the block device.
This constant is easier to remember, saves a little space,
and is in line with what SolidRun's 2018.01-based fork does for the
clearfog.

Signed-off-by: Josua Mayer <josua.mayer97@gmail.com>
[ Aditya Prayoga:
* Port forward]
Signed-off-by: Aditya Prayoga <aditya@kobol.io>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-By: Dennis Gilmore <dgilmore@redhat.com>
Reviewed-By: Dennis Gilmore <dgilmore@redhat.com>
Signed-off-by: Stefan Roese <sr@denx.de>
5 years agoARM: mvebu: a38x: sync ddr training code with mv_ddr-armada-18.09.02
Chris Packham [Mon, 3 Dec 2018 01:26:49 +0000 (14:26 +1300)]
ARM: mvebu: a38x: sync ddr training code with mv_ddr-armada-18.09.02

This syncs drivers/ddr/marvell/a38x/ with the mv_ddr-armada-18.09 branch
of https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell.git.
Specifically this syncs with commit 99d772547314 ("Bump mv_ddr to
release armada-18.09.2").

The complete log of changes is best obtained from the mv-ddr-marvell.git
repository but some relevant highlights are:

  ddr3: add missing txsdll parameter
  ddr3: fix tfaw timimg parameter
  ddr3: fix trrd timimg parameter
  merge ddr3 topology header file with mv_ddr_topology one
  mv_ddr: a38x: fix zero memory size scrubbing issue

The upstream code is incorporated omitting the portions not relevant to
Armada-38x and DDR3. After that a semi-automated step is used to drop
unused features with unifdef

    find drivers/ddr/marvell/a38x/ -name '*.[ch]' | \
        xargs unifdef -m -UMV_DDR -UMV_DDR_ATF -UCONFIG_DDR4 \
                 -UCONFIG_APN806 -UCONFIG_MC_STATIC \
                 -UCONFIG_MC_STATIC_PRINT -UCONFIG_PHY_STATIC \
                 -UCONFIG_64BIT -UCONFIG_A3700 -UA3900 -UA80X0 \
                 -UA70X0

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Stefan Roese <sr@denx.de>
5 years agoMerge branch 'master' of git://git.denx.de/u-boot-sunxi
Tom Rini [Sat, 8 Dec 2018 00:02:01 +0000 (19:02 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-sunxi

- Various axp209 fixes
- Fixes for OLinuXino-A20-Lime2 / OLinuXino-A20-Lime2-eMMC

5 years agoMerge tag 'u-boot-amlogic-20181207' of git://git.denx.de/u-boot-amlogic
Tom Rini [Sat, 8 Dec 2018 00:01:09 +0000 (19:01 -0500)]
Merge tag 'u-boot-amlogic-20181207' of git://git.denx.de/u-boot-amlogic

Two fixes for the Amlogic Pinctrl driver :
- bad usage of clrsetbits_le32
- bad pin definition for AXG Family

5 years agosunxi: update README.sunxi64
Andre Przywara [Thu, 6 Dec 2018 01:25:57 +0000 (01:25 +0000)]
sunxi: update README.sunxi64

Now that the Allwinner port in the official mainline ARM Trusted
Firmware repository has reached feature parity with the "legacy" ATF
port, let's use the opportunity to update the Allwinner 64-bit build
instructions. This changes:
- Update ATF build instructions to use the mainline repo.
- Add quick command lines for TL;DR people.
- Mention Allwinner H6 build target.
- Mention pre-built FEL binaries.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
5 years agoarm: sunxi: Reduce inrush current on Olimex OLinuXino-A20-Lime2-eMMC
Priit Laes [Wed, 21 Nov 2018 18:05:33 +0000 (20:05 +0200)]
arm: sunxi: Reduce inrush current on Olimex OLinuXino-A20-Lime2-eMMC

The lime2 features a too large capacitor on the LDO3 output, which
causes the PMIC to shutdown when enabling power. To be able to still
boot up however, we must gradually enable power on LDO3 for this board.

We do this by enabling both the inrush quirk and the maximum slope the
AXP209 supports.

Signed-off-by: Priit Laes <plaes@plaes.org>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
5 years agoarm: sunxi: Reduce inrush current on Olimex OLinuXino-A20-Lime2
Olliver Schinagl [Wed, 21 Nov 2018 18:05:32 +0000 (20:05 +0200)]
arm: sunxi: Reduce inrush current on Olimex OLinuXino-A20-Lime2

The lime2 features a too large capacitor on the LDO3 output, which
causes the PMIC to shutdown when enabling power. To be able to still
boot up however, we must gradually enable power on LDO3 for this board.

We do this by enabling both the inrush quirk and the maximum slope the
AXP209 supports.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Signed-off-by: Priit Laes <plaes@plaes.org>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
5 years agopower: axp209: Limit inrush current for broken boards
Olliver Schinagl [Wed, 21 Nov 2018 18:05:31 +0000 (20:05 +0200)]
power: axp209: Limit inrush current for broken boards

Some boards feature a capacitance on LDO3's output that is too large,
causing inrush currents which as a result, shut down the AXP209. This
has been reported before, without knowing the actual cause.

A fix appeared to be done with
commit 0e6e34ac8dbb ("sunxi: Olimex A20 boards: Enable LDO3 and LDO4 regulators").

The description there is a bit misleading, the kernel does not hang
during AXP209 initialization, the PMIC shuts down, causing voltages to
drop and thus the whole system freezes.

While the AXP209 does have the ability to ramp up the voltage slowly, to
reduce these inrush currents, the voltage rate control (VRC) however is
not applicable when switching on the LDO3 output. Only when going from
an enabled lower voltage setting, to a higher voltage setting is the VRC
in effect.

To work around this problem, we set LDO3 to the lowest possible setting
of 0.7 V if it was not yet enabled, and then let the VRC (if enabled) do
its thing. It should be noted, that for some undocumented reason, there
is a short delay needed between setting the LDO3 voltage register and
enabling the power. One would expect that this delay ought to be just
after enabling the output power at 0.7 V, but this did not work.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Signed-off-by: Priit Laes <plaes@plaes.org>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
5 years agopower: axp209: Add support for voltage rate control on LDO3
Olliver Schinagl [Wed, 21 Nov 2018 18:05:30 +0000 (20:05 +0200)]
power: axp209: Add support for voltage rate control on LDO3

The AXP209 LDO3 regulator supports voltage rate control, or can set a
slew rate.

This allows for the power to gradually rise up to the desired voltage,
instead of spiking up as fast as possible. Reason to have this can be
to reduce the inrush currents for example.

There are 3 slopes to choose from, the default, 'none' is a voltage rise
of 0.0167 V/uS, a 1.6 mV/uS and a 0.8 mV/uS voltage rise.

In ideal world (where vendors follow the recommended design guidelines)
this setting should not be enabled by default. Unless of course AXP209
crashes instead of reporting overcurrent condition as it normally should
do in this case.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Signed-off-by: Priit Laes <plaes@plaes.org>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
5 years agopower: axp209: Reduce magic values by adding defines for LDO[234]
Olliver Schinagl [Wed, 21 Nov 2018 18:05:29 +0000 (20:05 +0200)]
power: axp209: Reduce magic values by adding defines for LDO[234]

The AXP209 has a few 'magisc-ish' values that are better served with
clear defines.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Signed-off-by: Priit Laes <plaes@plaes.org>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
5 years agopower: axp209: Define the chip version mask
Olliver Schinagl [Wed, 21 Nov 2018 18:05:28 +0000 (20:05 +0200)]
power: axp209: Define the chip version mask

Use a define for the chip version mask on the axp209.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Signed-off-by: Priit Laes <plaes@plaes.org>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>