platform/kernel/u-boot.git
4 years agowandboard: Remove repeated PMIC string
Fabio Estevam [Tue, 10 Dec 2019 09:33:00 +0000 (06:33 -0300)]
wandboard: Remove repeated PMIC string

After the conversion to DM_PMIC the following output is seen:

PMIC:  PMIC:  PFUZE100 ID=0x10

Remove the unnecessary PMIC string from the board file to
avoid the repetead string.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
4 years agowandboard: Fix the DM_PMIC conversion
Fabio Estevam [Tue, 10 Dec 2019 09:32:59 +0000 (06:32 -0300)]
wandboard: Fix the DM_PMIC conversion

Commit ec837c82d709 ("imx6: wandboard: convert to DM_PMIC")
caused the following pmic_get() error:

CPU:   Freescale i.MX6QP rev1.0 at 792 MHz
Reset cause: POR
DRAM:  2 GiB
PMIC:  pmic_get() ret -19
...

and since the PMIC presence is used to determine the board D1 revision,
the following error is seen when booting a board rev D1:

WARNING: Could not determine dtb to use

and the kernel does not boot at all.

Fix the regression by passing "pfuze100@8" as the correct parameter
to the pmic_get() function in the DM case.

Fixes: ec837c82d709 ("imx6: wandboard: convert to DM_PMIC")
Signed-off-by: Fabio Estevam <festevam@gmail.com>
4 years agompc83xx_clk: always treat MPC83XX_CLK_PCI as invalid
Rasmus Villemoes [Thu, 19 Dec 2019 09:46:08 +0000 (09:46 +0000)]
mpc83xx_clk: always treat MPC83XX_CLK_PCI as invalid

The current mpc83xx_clk driver is broken for any board for which
mpc83xx_has_pci() is true, i.e. anything not MPC8308:

When is_clk_valid() reports that MPC83XX_CLK_PCI is valid,
init_all_clks() proceeds to call init_single_clk(), but that doesn't
know about either MPC83XX_CLK_PCI or has any handling of the
TYPE_SCCR_ONOFF mode correctly returned by retrieve_mode(). Hence
init_single_clk() ends up returning -EINVAL, and the whole board hangs
in serial_init().

The quickest fix is to simply pretend that clock is invalid for
all, since nobody can have been relying on it. Adding proper support
seems to be a bit more involved than just handling TYPE_SCCR_ONOFF:

- The power-on-reset value of SCCR[PCICM] is 0, so
  mpc83xx_clk_enable() would probably need to be tought to enable the
  clock.

- The frequency of PCI_SYNC_OUT is either SYS_CLK_IN or SYS_CLK_IN/2
  depending on the CFG_CLKIN_DIV configuration input, but that can't
  be read from software, so to properly fill out
  ->speed[MPC83XX_CLK_PCI] I think one would need guidance from
  Kconfig or dtb.

Partially fixes: 07d538d281 clk: Add MPC83xx clock driver

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Mario Six <mario.six@gdsys.cc>
4 years agompc83xx: set MPC83XX_GPIO_CTRLRS to 2 for MPC8309
Rasmus Villemoes [Thu, 12 Dec 2019 09:18:52 +0000 (09:18 +0000)]
mpc83xx: set MPC83XX_GPIO_CTRLRS to 2 for MPC8309

The MPC8309 has two gpio controllers (which is already correctly
reflected in its struct immap definition).

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Mario Six <mario.six@gdsys.cc>
4 years agompc83xx: immap_83xx: add spi8xxx_t in immap for mpc8309
Rasmus Villemoes [Thu, 12 Dec 2019 08:35:49 +0000 (08:35 +0000)]
mpc83xx: immap_83xx: add spi8xxx_t in immap for mpc8309

Allow drivers/spi/mpc8xxx_spi.c to be built for an mpc8309 target.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Mario Six <mario.six@gdsys.cc>
4 years agopowerpc: mpc83xx: convert CONFIG_FSL_ELBC to Kconfig
Rasmus Villemoes [Thu, 12 Dec 2019 08:11:46 +0000 (08:11 +0000)]
powerpc: mpc83xx: convert CONFIG_FSL_ELBC to Kconfig

This complements commit 068789773d0 which did the conversion for
mpc85xx.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Mario Six <mario.six@gdsys.cc>
4 years agompc83xx: make ARCH_MPC8309 select SYS_FSL_ERRATUM_ESDHC111
Rasmus Villemoes [Wed, 11 Dec 2019 09:39:36 +0000 (09:39 +0000)]
mpc83xx: make ARCH_MPC8309 select SYS_FSL_ERRATUM_ESDHC111

The mpc8309 is also affected by the "Manual Asynchronous CMD12 abort
operation causes protocol violations" erratum, though it is enumerated
as eSDHC16 in the errata sheet for mpc8309.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Mario Six <mario.six@gdsys.cc>
4 years agolog: Include missing header for log.h
Sean Anderson [Wed, 25 Dec 2019 04:54:54 +0000 (23:54 -0500)]
log: Include missing header for log.h

log.h references cmd_tbl_t but command.h was not included

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agodm: Add a debug message when devices are skipped pre-reloc
Sean Anderson [Wed, 25 Dec 2019 04:52:01 +0000 (23:52 -0500)]
dm: Add a debug message when devices are skipped pre-reloc

This adds a message to lists_bind_fdt when it skips initializing a device
pre-relocation. I've had a couple errors where a device didn't initialize
properly because one of its dependencies was missing.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agoInclude missing headers for fdt_support.h
Sean Anderson [Wed, 18 Dec 2019 02:21:54 +0000 (21:21 -0500)]
Include missing headers for fdt_support.h

fdt_support.h is missing declarations for bd_t. Including asm/u-boot.h
pulls in the definition.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
4 years agobinman: fix default filename of u-boot-with-ucode-ptr in documentation
Masahiro Yamada [Sat, 14 Dec 2019 04:47:26 +0000 (13:47 +0900)]
binman: fix default filename of u-boot-with-ucode-ptr in documentation

The suffix should be ".bin" instead of ".dtb" .

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agodm: devres: Add a new OFDATA phase
Simon Glass [Mon, 30 Dec 2019 04:19:28 +0000 (21:19 -0700)]
dm: devres: Add a new OFDATA phase

Since the ofdata_to_platdata() method can allocate resources, add it as a
new devres phase.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agodm: devres: Use an enum for the allocation phase
Simon Glass [Mon, 30 Dec 2019 04:19:27 +0000 (21:19 -0700)]
dm: devres: Use an enum for the allocation phase

At present we only support two phases where devres can be used:
bind and probe. This is handled with a boolean. We want to add a new
phase (platdata), so change this to an enum.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agodm: devres: Add tests
Simon Glass [Mon, 30 Dec 2019 04:19:26 +0000 (21:19 -0700)]
dm: devres: Add tests

The devres functionality has very few users in U-Boot, but it still should
have tests. Add a few basic tests of the main functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agodm: test: Add a test driver for devres
Simon Glass [Mon, 30 Dec 2019 04:19:25 +0000 (21:19 -0700)]
dm: test: Add a test driver for devres

Add a driver which does devres allocations so that we can write tests for
devres.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agodm: devres: Convert to use logging
Simon Glass [Mon, 30 Dec 2019 04:19:24 +0000 (21:19 -0700)]
dm: devres: Convert to use logging

At present when CONFIG_DEBUG_DEVRES is enabled, U-Boot prints log messages
to the console with every devres allocation/free event. This causes most
tests to fail since the console output is not as expected.

In particular this prevents us from adding a device to sandbox which uses
devres in its bind method.

Move devres over to use U-Boot's logging feature instead, and add a new
category for devres.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agotest: Add functions to find the amount of allocated memory
Simon Glass [Mon, 30 Dec 2019 04:19:23 +0000 (21:19 -0700)]
test: Add functions to find the amount of allocated memory

The malloc() implementations provides a way of finding out the approximate
amount of memory that is allocated. Add helper functions to make it easier
to access this and see changes over time. This is useful for tests that
want to check if memory has been allocated or freed.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agodm: devres: Create a new devres header file
Simon Glass [Mon, 30 Dec 2019 04:19:22 +0000 (21:19 -0700)]
dm: devres: Create a new devres header file

At present these functions are lumped in with the core device functions.
They have their own #ifdef to control their availability, so it seems
better to split them out.

Move them into their own header file.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agodm: core: Add a new flag to track platform data
Simon Glass [Mon, 30 Dec 2019 04:19:21 +0000 (21:19 -0700)]
dm: core: Add a new flag to track platform data

We want to avoid allocating platform data twice. This could happen if
device_probe() is called after device_ofdata_to_platdata() for the same
device.

Add a flag to track whether device_ofdata_to_platdata() has been called on
a device. Check the flag to make sure it doesn't happen twice, and clear
the flag when the data is freed.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agodm: core: Export a new function to read platdata
Simon Glass [Mon, 30 Dec 2019 04:19:20 +0000 (21:19 -0700)]
dm: core: Export a new function to read platdata

Add a new internal function, device_ofdata_to_platdata() to handle
allocating private space associated with each device and reading the
platform data from the device tree.

Call this new function from device_probe().

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agodm: core: Add a comment for DM_FLAG_OF_PLATDATA
Simon Glass [Mon, 30 Dec 2019 04:19:19 +0000 (21:19 -0700)]
dm: core: Add a comment for DM_FLAG_OF_PLATDATA

This flag is missing a comment. Add one.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agodm: core: Allocate parent data separate from probing parent
Simon Glass [Mon, 30 Dec 2019 04:19:18 +0000 (21:19 -0700)]
dm: core: Allocate parent data separate from probing parent

At present the parent is probed before the child's ofdata_to_platdata()
method is called. Adjust the logic slightly so that probing parents is
not done until afterwards.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agodm: core: Move ofdata_to_platdata() call earlier
Simon Glass [Mon, 30 Dec 2019 04:19:17 +0000 (21:19 -0700)]
dm: core: Move ofdata_to_platdata() call earlier

This method is supposed to extract platform data from the device tree. It
should be done before the device itself is probed. Move it earlier in the
device_probe() function.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agodm: core: Don't clear active flag twice when probe() fails
Simon Glass [Mon, 30 Dec 2019 04:19:16 +0000 (21:19 -0700)]
dm: core: Don't clear active flag twice when probe() fails

Remove this duplicated code, since the 'fail' label does this immediately.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agoaspeed: ast2500: Read clock ofdata in the correct method
Simon Glass [Mon, 30 Dec 2019 04:19:15 +0000 (21:19 -0700)]
aspeed: ast2500: Read clock ofdata in the correct method

At present the clock driver reads its ofdata in the probe() method. This
is not correct although it is often harmless.

However in this case it causes a problem, something like this:

- ast_get_scu() is called (from somewhere) to get the SCI address
- this probes the clock
   - first sets up ofdata (which does nothing at present)
   - DM marks clock device as active
   - DM calls pinctrl
      - pinctrl probes and calls ast_get_scu() in ast2500_pinctrl_probe()
      - ast_get_scu() probes the clock, but sees it already marked as
           probed
      - ast_get_scu() accesses the clock's private data, with scu as NULL
   - DM calls clock probe function ast2500_clk_probe() which reads scu

By putting the read of scu into the correct method, scu is read as part of
ofdata setup, and everything is OK.

Note: This problem did not matter until now since DM always probed all
parents before reading a child's ofdata. The fact that pinctrl is a child
of clock seems to trigger this strange bug.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
4 years agopci: Print a warning if the bus is accessed before probing
Simon Glass [Mon, 30 Dec 2019 04:19:14 +0000 (21:19 -0700)]
pci: Print a warning if the bus is accessed before probing

It is not possible to access a device on a PCI bus that has not yet been
probed, since the bus number is not known. Add a warning to catch this
error.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agox86: apl: Avoid accessing the PCI bus before it is probed
Simon Glass [Mon, 30 Dec 2019 04:19:13 +0000 (21:19 -0700)]
x86: apl: Avoid accessing the PCI bus before it is probed

The PCI bus is not actually probed by the time the ofdata_to_platdata()
method is called since that happens in the uclass's post_probe() method.
Update the PMC and P2SB drivers to access the bus in its probe() method.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agousb: Drop use of BUG_ON() and WARN_ON()
Simon Glass [Mon, 30 Dec 2019 04:19:12 +0000 (21:19 -0700)]
usb: Drop use of BUG_ON() and WARN_ON()

These macros use __FILE__ which inserts the full path of the object file
into U-Boot, thus increasing file size. Drop these usages.

An older version of this patch was submitted here:

http://patchwork.ozlabs.org/patch/1205784/

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agodm: core: Use assert_noisy() in devres
Simon Glass [Mon, 30 Dec 2019 04:19:11 +0000 (21:19 -0700)]
dm: core: Use assert_noisy() in devres

Use this macros instead of the linux ones, as the output is smaller.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agocommon: Add a noisy assert()
Simon Glass [Mon, 30 Dec 2019 04:19:10 +0000 (21:19 -0700)]
common: Add a noisy assert()

Some U-Boot code uses BUG_ON() and WARN_ON() macros. These use __FILE__
which can include quite a large path, depending on how U-Boot is built.

The existing assert() is only checked if DEBUG is enabled. Add a new one
which is always checked, and prints a (smaller) error in that case.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agoefi_selftest: unit test for EFI_RNG_PROTOCOL
Heinrich Schuchardt [Sat, 28 Dec 2019 14:40:40 +0000 (15:40 +0100)]
efi_selftest: unit test for EFI_RNG_PROTOCOL

Provide a unit test for the EFI_RNG_PROTOCOL.

The list of algorithms is read. Two random numbers are generated. The test
checks that the two numbers differ.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_rng_protocol: Install the efi_rng_protocol on the root node
Sughosh Ganu [Sat, 28 Dec 2019 18:31:06 +0000 (00:01 +0530)]
efi_rng_protocol: Install the efi_rng_protocol on the root node

Install the EFI_RNG_PROTOCOL implementation for it's subsequent use by
the kernel for features like kaslr.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi: qemu: arm64: Add efi_rng_protocol implementation for the platform
Sughosh Ganu [Sat, 28 Dec 2019 18:31:05 +0000 (00:01 +0530)]
efi: qemu: arm64: Add efi_rng_protocol implementation for the platform

Add support for the EFI_RNG_PROTOCOL routines for the qemu arm64
platform. EFI_RNG_PROTOCOL is an uefi boottime service which is
invoked by the efi stub in the kernel for getting random seed for
kaslr.

The routines are platform specific, and use the virtio-rng device on
the platform to get random data.

The feature can be enabled through the following config
CONFIG_EFI_RNG_PROTOCOL

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Changed SPDX header to use /* instead of //.
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agocmd: add rng command
Heinrich Schuchardt [Tue, 24 Dec 2019 21:17:37 +0000 (22:17 +0100)]
cmd: add rng command

For the RNG uclass we currently only have a test working on the sandbox.

Provide a command to test the hardware random number generator on
non-sandbox systems.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agovirtio: rng: Add a random number generator(rng) driver
Sughosh Ganu [Sun, 29 Dec 2019 10:00:14 +0000 (15:30 +0530)]
virtio: rng: Add a random number generator(rng) driver

Add a driver for the virtio-rng device on the qemu platform. The
device uses pci as a transport medium. The driver can be enabled with
the following configs

CONFIG_VIRTIO
CONFIG_DM_RNG
CONFIG_VIRTIO_PCI
CONFIG_VIRTIO_RNG

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
4 years agotest: rng: Add basic test for random number generator(rng) uclass
Sughosh Ganu [Sat, 28 Dec 2019 18:28:33 +0000 (23:58 +0530)]
test: rng: Add basic test for random number generator(rng) uclass

Add a unit test for testing the rng uclass functionality using the
sandbox rng driver.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoconfigs: sandbox: Enable random number generator(rng) device
Sughosh Ganu [Sat, 28 Dec 2019 18:28:32 +0000 (23:58 +0530)]
configs: sandbox: Enable random number generator(rng) device

Enable support for random number generator on sandbox configs. This is
aimed primarily at adding unit test support for rng uclass.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agosandbox: rng: Add a random number generator(rng) driver
Sughosh Ganu [Sat, 28 Dec 2019 18:28:31 +0000 (23:58 +0530)]
sandbox: rng: Add a random number generator(rng) driver

Add a sandbox driver for random number generation. Mostly aimed at
providing a unit test for rng uclass.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoconfigs: stm32mp15: Enable random number generator(rng) device
Sughosh Ganu [Sat, 28 Dec 2019 18:28:30 +0000 (23:58 +0530)]
configs: stm32mp15: Enable random number generator(rng) device

Enable support for the rng device on the stm32mp15 configs.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agostm32mp1: rng: Add a driver for random number generator(rng) device
Sughosh Ganu [Sat, 28 Dec 2019 18:28:29 +0000 (23:58 +0530)]
stm32mp1: rng: Add a driver for random number generator(rng) device

Add a driver for the rng device found on stm32mp1 platforms. The
driver provides a routine for reading the random number seed from the
hardware device.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Remove a superfluous blank line
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoclk: stm32mp1: Add a clock entry for RNG1 device
Sughosh Ganu [Sat, 28 Dec 2019 18:28:28 +0000 (23:58 +0530)]
clk: stm32mp1: Add a clock entry for RNG1 device

Add an entry for allowing clock enablement for the random number
generator peripheral, RNG1.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agodm: rng: Add random number generator(rng) uclass
Sughosh Ganu [Sat, 28 Dec 2019 18:28:27 +0000 (23:58 +0530)]
dm: rng: Add random number generator(rng) uclass

Add a uclass for reading a random number seed from a random number
generator device.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agotest/py: Create a test for launching UEFI binaries from FIT images
Cristian Ciocaltea [Mon, 30 Dec 2019 01:34:27 +0000 (03:34 +0200)]
test/py: Create a test for launching UEFI binaries from FIT images

This test verifies the implementation of the 'bootm' extension that
handles UEFI binaries inside FIT images (enabled via CONFIG_BOOTM_EFI).

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agodoc: uefi.rst: Document launching UEFI binaries from FIT images
Cristian Ciocaltea [Tue, 24 Dec 2019 16:05:41 +0000 (18:05 +0200)]
doc: uefi.rst: Document launching UEFI binaries from FIT images

This patch adds a new section "Launching a UEFI binary from a FIT image"
documenting the usage of the CONFIG_BOOTM_EFI extension to bootm command
that offers a verified boot alternative for UEFI binaries such as GRUB2.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agodoc: Add sample uefi.its image description file
Cristian Ciocaltea [Tue, 24 Dec 2019 16:05:40 +0000 (18:05 +0200)]
doc: Add sample uefi.its image description file

This patch adds an example FIT image description file demonstrating
the usage of bootm command to securely launch UEFI binaries.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agobootm: Add a bootm command for type IH_OS_EFI
Cristian Ciocaltea [Tue, 24 Dec 2019 16:05:39 +0000 (18:05 +0200)]
bootm: Add a bootm command for type IH_OS_EFI

Add support for booting EFI binaries contained in FIT images.
A typical usage scenario is chain-loading GRUB2 in a verified
boot environment.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoimage: Add IH_OS_EFI for EFI chain-load boot
Cristian Ciocaltea [Tue, 24 Dec 2019 16:05:38 +0000 (18:05 +0200)]
image: Add IH_OS_EFI for EFI chain-load boot

Add a new OS type to be used for chain-loading an EFI compatible
firmware or boot loader like GRUB2, possibly in a verified boot
scenario.

Bellow is sample ITS file that generates a FIT image supporting
secure boot. Please note the presence of 'os = "efi";' line, which
identifies the currently introduced OS type:

/ {
    #address-cells = <1>;

    images {
        efi-grub {
            description = "GRUB EFI";
            data = /incbin/("bootarm.efi");
            type = "kernel_noload";
            arch = "arm";
            os = "efi";
            compression = "none";
            load = <0x0>;
            entry = <0x0>;
            hash-1 {
                algo = "sha256";
            };
        };
    };

    configurations {
        default = "config-grub";
        config-grub {
            kernel = "efi-grub";
            signature-1 {
                algo = "sha256,rsa2048";
                sign-images = "kernel";
            };
        };
    };
};

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agocmd: efidebug: capitalize UEFI
Heinrich Schuchardt [Tue, 7 Jan 2020 06:48:15 +0000 (07:48 +0100)]
cmd: efidebug: capitalize UEFI

%s/uefi/UEFI/g

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agocmd: efidebug: new sub-command tables
Heinrich Schuchardt [Tue, 7 Jan 2020 04:57:47 +0000 (05:57 +0100)]
cmd: efidebug: new sub-command tables

Provide sub-command for efidebug to list configuration tables.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agocmd: efidebug: simplify get_guid_text()
Heinrich Schuchardt [Tue, 7 Jan 2020 05:02:33 +0000 (06:02 +0100)]
cmd: efidebug: simplify get_guid_text()

When we hit a matching GUID we can directly return the text. There is no
need for a check after the loop.

efi_guid_t is defined as 8 byte aligned but GUIDs in packed structures do
not follow this alignment. Do not require the argument of get_guid_text()
to be correctly aligned.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: define all known warning status codes
Heinrich Schuchardt [Fri, 3 Jan 2020 21:47:19 +0000 (22:47 +0100)]
efi_loader: define all known warning status codes

Of all warning status codes up to now only EFI_WARN_DELETE_FAILURE is
defined.

The patch adds the missing definitions for later usage.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: free load options after execution
Heinrich Schuchardt [Fri, 3 Jan 2020 21:53:42 +0000 (22:53 +0100)]
efi_loader: free load options after execution

When be launch a binary via bootefi the bootargs environment variable is
used to set the load options in the loaded image protocol.

Free memory allocated for load options when the UEFI binary exits.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: Add guidcpy function
Sughosh Ganu [Sat, 28 Dec 2019 18:31:04 +0000 (00:01 +0530)]
efi_loader: Add guidcpy function

Add guidcpy function to copy the source guid to the destination
guid. Use this function instead of memcpy for copying to the
destination guid.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Use void * instead of efi_guid_t * for arguments to allow copying unaligned
GUIDs. The GUIDs of configuration tables are __packed.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: __cyg_profile_func_enter/_exit
Heinrich Schuchardt [Wed, 1 Jan 2020 12:19:12 +0000 (13:19 +0100)]
efi_loader: __cyg_profile_func_enter/_exit

U-Boot can be compiled with function tracing enabled.

When compiling with FTRACE __cyg_profile_func_enter() is called when a
function is entered and __cyg_profile_func_exit() when the function is
left.

To avoid a crash we have to define these function for the free-standing
UEFI binaries.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agopart: efi: comment for GPT_HEADER_SIGNATURE_UBOOT
Heinrich Schuchardt [Tue, 24 Dec 2019 07:11:01 +0000 (08:11 +0100)]
part: efi: comment for GPT_HEADER_SIGNATURE_UBOOT

Add a comment indicating that the value of GPT_HEADER_SIGNATURE_UBOOT
equals the ASCII string 'EFI PART'.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: clear screen should move cursor to home
Heinrich Schuchardt [Sun, 22 Dec 2019 07:15:55 +0000 (07:15 +0000)]
efi_loader: clear screen should move cursor to home

On a VT100 terminal <ESC>[2J should be enough to both clear the whole
screen and set the cursor to position (1, 1). But the Linux console does
not behave like this. So send an extra <ESC>[H. For reference see the
console_codes(4) man page.

Add a function description.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agotest/py: describe env__efi_loader_helloworld_file
Heinrich Schuchardt [Thu, 19 Dec 2019 12:39:30 +0000 (13:39 +0100)]
test/py: describe env__efi_loader_helloworld_file

Describe the components of environment variable
env__efi_loader_helloworld_file.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: git ignore helloworld_efi.S
Heinrich Schuchardt [Mon, 16 Dec 2019 11:05:58 +0000 (12:05 +0100)]
efi_loader: git ignore helloworld_efi.S

Add *.S to .gitignore.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_selftest: Update .gitignore
Sughosh Ganu [Mon, 16 Dec 2019 06:31:32 +0000 (12:01 +0530)]
efi_selftest: Update .gitignore

Add the following file to .gitignore
 efi_miniapp_file_image_exception.h

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Use efi_miniapp_*.h instead of file enumeration.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: export efi_install_fdt()
Heinrich Schuchardt [Sun, 8 Dec 2019 00:07:01 +0000 (01:07 +0100)]
efi_loader: export efi_install_fdt()

Use a pointer to addressable memory instead of a "physical" address in the
virtual address space of the sandbox to efi_install_fdt().

Export the efi_install_fdt() function.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: carve out efi_run_image()
Heinrich Schuchardt [Sat, 7 Dec 2019 19:51:06 +0000 (20:51 +0100)]
efi_loader: carve out efi_run_image()

Provide public function efi_run_imager() which can be used to run an UEFI
image from memory.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: use hardware device tree by default
Heinrich Schuchardt [Wed, 4 Dec 2019 11:31:12 +0000 (12:31 +0100)]
efi_loader: use hardware device tree by default

If the bootefi command is called without passing the address of a device
tree, the internal device tree is used. For devices with a hardware device
tree it is preferable to used the hardware device tree in this case.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: pass address to efi_install_fdt()
Heinrich Schuchardt [Thu, 28 Nov 2019 05:46:09 +0000 (06:46 +0100)]
efi_loader: pass address to efi_install_fdt()

As part of moving the parsing of command line arguments to do_bootefi()
call efi_install_fdt() with the address of the device tree instead of a
string.

If the address is EFI_FDT_USE_INTERNAL (= 0), the internal device tree
is used.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: adjust file system info
Heinrich Schuchardt [Sun, 8 Dec 2019 09:02:37 +0000 (10:02 +0100)]
efi_loader: adjust file system info

When the GetInfo() method of the EFI_FILE_PROTOCOL is called to retrieve
the file system info we claim that the volume is read only and has no free
space. This leads to failures in programs that check this information
before writing to the volume like SCT's InstallSct.efi.

Currently there is no function to determine these parameters in U-Boot. So
let's return optimistic values:

Return that the volume is writable.

Return the volume size as free space.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: imply USB_KEYBOARD_FN_KEYS
Heinrich Schuchardt [Wed, 4 Dec 2019 21:58:58 +0000 (22:58 +0100)]
efi_loader: imply USB_KEYBOARD_FN_KEYS

UEFI applications like GRUB and SCT assume that function keys are enabled
on the keyboard.

Let EFI_LOADER imply USB_KEYBOARD_FN_KEYS.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoinclude: pe.h: add signature-related definitions
AKASHI Takahiro [Tue, 26 Nov 2019 00:51:05 +0000 (09:51 +0900)]
include: pe.h: add signature-related definitions

The index (IMAGE_DIRECTORY_ENTRY_SECURITY) in a table points to
a region containing authentication information (image's signature)
in PE format.

WIN_CERTIFICATE structure defines an embedded signature format.

Those definitions will be used in my UEFI secure boot patch.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoconfigs: qemu: enable FIT images on qemu_arm(64)_defconfig
Heinrich Schuchardt [Sun, 29 Dec 2019 11:06:29 +0000 (12:06 +0100)]
configs: qemu: enable FIT images on qemu_arm(64)_defconfig

For testing UEFI FIT images we need FIT image support on QEMU.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agotest/py: Fix broken 'notbuildconfigspec' marker
Cristian Ciocaltea [Tue, 24 Dec 2019 15:19:12 +0000 (17:19 +0200)]
test/py: Fix broken 'notbuildconfigspec' marker

Consider the following test sample:

@pytest.mark.buildconfigspec('fit')
@pytest.mark.notbuildconfigspec('generate_acpi_table')
def test_sample(u_boot_console):

Whatever the argument of the 'notbuildconfigspec' is,
the test ends up being skipped with the message:

('/uboot/test/py/conftest.py', 463,
 'Skipped: .config feature "fit" enabled')

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agobdinfo: show multi_dtb_fit
Heiko Schocher [Sat, 9 Nov 2019 03:56:10 +0000 (04:56 +0100)]
bdinfo: show multi_dtb_fit

if MULTI_DTB_FIT is enabled it is helpful to display
the value of gd->multi_dtb_fit in bdinfo.

Signed-off-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agocmd_ut: add a parameter prefix to the function cmd_ut_category
Philippe Reynes [Tue, 17 Dec 2019 18:07:04 +0000 (19:07 +0100)]
cmd_ut: add a parameter prefix to the function cmd_ut_category

There is black magic in the file conftest.py that list
all the test unit. Then, all those test unit are called
in pytest. This call is done with the end of the name
(for example checksum if the full name is bloblist_test_checksum).

The result is that only test for dm are really executed.
by pytest, all others tests are listed but never executed.

This behaviour happens because the dm test unit only check
the end of the name and others tests checks the full name.

To fix this issue, I've added a prefix to the function
cmd_ut_category, and this prefix is removed when looking
for the unit test.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agopower: regulator: support off-on-delay-us
Peng Fan [Mon, 4 Nov 2019 09:27:23 +0000 (09:27 +0000)]
power: regulator: support off-on-delay-us

off-on-delay-us has been supported by Linux, so let's use it.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agoremoteproc: stm32: load resource table from firmware
Fabien Dessenne [Wed, 30 Oct 2019 13:38:33 +0000 (14:38 +0100)]
remoteproc: stm32: load resource table from firmware

Load the optional resource table from the firmware, and write its
address in the dedicated backup register.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agostm32mp1: remove copro_state environment variable
Fabien Dessenne [Wed, 30 Oct 2019 13:38:32 +0000 (14:38 +0100)]
stm32mp1: remove copro_state environment variable

Since the coprocessor state is tracked in a backup register, there is
no more need for tracking it in an environment variable : remove it.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoremoteproc: stm32: track the coprocessor state in a backup register
Fabien Dessenne [Wed, 30 Oct 2019 13:38:31 +0000 (14:38 +0100)]
remoteproc: stm32: track the coprocessor state in a backup register

Update the dedicated backup register to track the coprocessor state and
rely on that register to compute the .is_running() value (which expects
a return value of 0 -not 1- if the processor is running).

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agostm32mp1: reset coprocessor status at cold boot
Fabien Dessenne [Wed, 30 Oct 2019 13:38:30 +0000 (14:38 +0100)]
stm32mp1: reset coprocessor status at cold boot

Reset ResourceTableAddress and CoprocessorState at cold boot, preserve
these values at standby wakeup.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agostm32mp1: declare backup registers for coprocessor
Fabien Dessenne [Wed, 30 Oct 2019 13:38:29 +0000 (14:38 +0100)]
stm32mp1: declare backup registers for coprocessor

Use the backup register #17 as coprocessor resource table address and
backup register #18 as coprocessor state.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoremoteproc: elf_loader: Add elf resource table load support
Fabien Dessenne [Wed, 30 Oct 2019 13:38:28 +0000 (14:38 +0100)]
remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
4 years agospl: fit: Allow the board to tell if more images must be loaded from FIT
Jean-Jacques Hiblot [Tue, 22 Oct 2019 14:39:22 +0000 (16:39 +0200)]
spl: fit: Allow the board to tell if more images must be loaded from FIT

spl_fit_get_image_name() is used to get the names of the images that the
SPL must load from the FIT. It relies on the content of a property present
in the FIT. The list of images is thus statically defined in the FIT.
With this scheme, it quickly becomes hard to manage combinations of more
than a handful of images.
To address this problem, give the board driver code the opportunity to
add to the list of images. The images from the FIT property are loaded
first, and then the board_get_fit_loadable() is called to get more image
names.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agodts: Add support for adding DT overlays in u-boot.img
Jean-Jacques Hiblot [Tue, 22 Oct 2019 14:39:21 +0000 (16:39 +0200)]
dts: Add support for adding DT overlays in u-boot.img

If u-boot.img is a FIT image, CONFIG_OF_OVERLAY_LIST can be used to add
DT overlays to u-boot.img.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoinclude: board: provide empty stubs when the BOARD option is not selected
Jean-Jacques Hiblot [Tue, 22 Oct 2019 14:39:20 +0000 (16:39 +0200)]
include: board: provide empty stubs when the BOARD option is not selected

Useful to avoid #ifdef throughout the code that uses the board driver API.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agodrivers: board: Add get_fit_loadable()
Jean-Jacques Hiblot [Tue, 22 Oct 2019 14:39:19 +0000 (16:39 +0200)]
drivers: board: Add get_fit_loadable()

This function will be used by the SPL to get the names of images to load
from the FIT. This allows to load different images based on runtime HW
detection.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agodrivers: board: Make the board drivers available in SPL
Jean-Jacques Hiblot [Tue, 22 Oct 2019 14:39:18 +0000 (16:39 +0200)]
drivers: board: Make the board drivers available in SPL

Make the board driver available in the SPL too. The board driver is a way
to provide useful information about the board and that can be useful in
the SPL too.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agospl: fit: constify the output parameter of spl_fit_get_image_name()
Jean-Jacques Hiblot [Tue, 22 Oct 2019 14:39:17 +0000 (16:39 +0200)]
spl: fit: constify the output parameter of spl_fit_get_image_name()

There is no need for it to be non-constant. Making it constant, allows to
return constant string without warning.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoMakefile.lib: include /__symbols__ in dtb if SPL_LOAD_FIT_APPLY_OVERLAY is enabled
Jean-Jacques Hiblot [Tue, 22 Oct 2019 14:39:16 +0000 (16:39 +0200)]
Makefile.lib: include /__symbols__ in dtb if SPL_LOAD_FIT_APPLY_OVERLAY is enabled

In order to apply an overlay to a DTB. The DTB must have been generated
with the option '-@'.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agospl: fit: be more verbose when an error occurs when applying the overlays
Jean-Jacques Hiblot [Tue, 22 Oct 2019 14:39:15 +0000 (16:39 +0200)]
spl: fit: be more verbose when an error occurs when applying the overlays

There are many ways the overlay application can fail.
2 of them are probably the most common:
- the application itself failed. Usually this is comes from an unresolved
  reference
- DTBO not available in FIT (could be because of a typo)

In both case it is good to be more explicit about the error and at least
show which overlay is failing.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agospl: fit: Do not fail immediately if an overlay is not available
Jean-Jacques Hiblot [Tue, 22 Oct 2019 14:39:14 +0000 (16:39 +0200)]
spl: fit: Do not fail immediately if an overlay is not available

If one overlay that must be applied cannot be found in the FIT, the current
implementation stops applying the overlays. Let's make it skip only the
failing overlay instead.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agospl: fit: allocate a temporary buffer to load the overlays
Jean-Jacques Hiblot [Tue, 22 Oct 2019 14:39:13 +0000 (16:39 +0200)]
spl: fit: allocate a temporary buffer to load the overlays

If the node describing an overlay does not specify a load address, it will
be loaded at the address previously used.
Fixing it by allocating a temporary buffer that will be used as a
default load address. By default, the size of the buffer is 64kB which
should be plenty for most use cases.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agospl: fit: Make room in the FDT before applying overlays
Jean-Jacques Hiblot [Tue, 22 Oct 2019 14:39:12 +0000 (16:39 +0200)]
spl: fit: Make room in the FDT before applying overlays

Make room in the FDT before applying the overlay, otherwise it may fail if
the overlay is big. As the exact added size is not known in advance, just
add the size of the overlay.
Move after the end of the application of the overlays, the resize  of the
FDT for the injection of the details on the loadables.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agospl: fit: Add support for applying DT overlay
Michal Simek [Tue, 22 Oct 2019 14:39:11 +0000 (16:39 +0200)]
spl: fit: Add support for applying DT overlay

doc/uImage.FIT/overlay-fdt-boot.txt is describing how to create FIT
image with DT overlays in it.
Add support for this feature to SPL.

Here is the ZynqMP fragment where dtb points to full DT and dtbo is
overlay which should be applied on the top of dtb.
config {
        description = "ATF with full u-boot overlay";
        firmware = "atf";
        loadables = "uboot";
        fdt = "dtb", "dtbo";
};

The whole feature depends on OF_LIBFDT_OVERLAY which is adding +4kB code
and 0 for platforms which are not enabling this feature.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agospl: fit: don't load the firmware twice
Jean-Jacques Hiblot [Tue, 22 Oct 2019 14:39:10 +0000 (16:39 +0200)]
spl: fit: don't load the firmware twice

When u-boot.img is a FIT image generated automatically by mkimage, the
configuration node has the following structure:
conf-1 {
   description = "k3-am654-base-board";
   firmware = "firmware-1";
   loadables = "firmware-1";
   fdt = "fdt-1";
};

The firmware is referenced twice. Once by the 'firmware' property and
once by the 'loadables' property. Currently this result in the firmware
being loaded twice. This is not a big problem but has an impact on the
boot time.
Fixing it by not loading a loadable image if it is also the firmware image.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Andreas Dannenberg <dannenberg@ti.com>
4 years agotools: dumpimage: Fall-though to print usage for help command
Andrew F. Davis [Tue, 17 Sep 2019 21:09:35 +0000 (17:09 -0400)]
tools: dumpimage: Fall-though to print usage for help command

This has the same result but some compilers will warn about this
fall-through if there are statements as part of the label block.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
4 years agotools: fit_image: Use fit_image_get_data_and_size for getting offset/size
Andrew F. Davis [Tue, 17 Sep 2019 21:09:34 +0000 (17:09 -0400)]
tools: fit_image: Use fit_image_get_data_and_size for getting offset/size

This is very similar to fit_image_get_data but has the benefit of working
on FIT images with external data unlike fit_image_get_data. This is
useful for extracting sub-images from type of FIT image as this would
previously just silently fail. Add an error message also so if this
still fails it is easier to find out why.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
4 years agotools: dumpimage: Provide more feedback on internal errors
Andrew F. Davis [Tue, 17 Sep 2019 21:09:33 +0000 (17:09 -0400)]
tools: dumpimage: Provide more feedback on internal errors

The dumpimage utility errors out in a number of places without providing
sufficient feedback to allow the user to easily determine what has gone
wrong. Add additional error messages to make the cause of the failure
more obvious.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
4 years agoboard: amlogic: select PWRSEQ for all amlogic platform
Anand Moon [Thu, 26 Dec 2019 11:33:53 +0000 (11:33 +0000)]
board: amlogic: select PWRSEQ for all amlogic platform

commit a10388dc6982 ("mmc: meson-gx: add support for mmc-pwrseq-emmc")
introduce CONFIG_PWRSEQ for power sequence for eMMC module on
amlogic platform, so enable this to all amlogic boards.

Signed-off-by: Anand Moon <linux.amoon@gmail.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
4 years agoconfigs: meson64: enable GIC support for G12A/G12B
Anand Moon [Thu, 26 Dec 2019 11:33:52 +0000 (11:33 +0000)]
configs: meson64: enable GIC support for G12A/G12B

Enable GIC support for G12A/G12B platform.

Signed-off-by: Anand Moon <linux.amoon@gmail.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
4 years agoboards: amlogic: add Khadas VIM3L support
Christian Hewitt [Wed, 11 Dec 2019 09:20:54 +0000 (13:20 +0400)]
boards: amlogic: add Khadas VIM3L support

Khadas VIM3L uses the same board layout as VIM3, but with an S905D3 chip
instead of A311D. Board config is derived from khadas-vim3_defconfig and
sei610_defconfig. README is based on README.khadas-vim3; the difference
is that VIM3L uses FIP files from the g12a folder in vendor sources not
the g12b folder.

Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
[narmstrong: added vim3l readme into w400 MAINTAINERS]

4 years agoMerge tag 'u-boot-imx-20200107' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
Tom Rini [Tue, 7 Jan 2020 13:45:43 +0000 (08:45 -0500)]
Merge tag 'u-boot-imx-20200107' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

New for 2020.04
---------------

- New boards
Embedded Artists COM board
Xea Board
- Switch to DM:
Aristainetos boards
Toradex colibri (DM_ETH)
iCubox
GE bx50v3
mx7dsabre (DM_ETH)
cx9020
- New features:
Bootaux with elf files
Default SYS_THUMB_BUILD for i.MX6/7
- Fixes:
DHCOM i.MX6 PDK
Engicam
i.MX8M tools (imx8m_image)

Travis: https://travis-ci.org/sbabic/u-boot-imx/builds/633679664

4 years agoMerge tag 'u-boot-atmel-2020.04-a' of https://gitlab.denx.de/u-boot/custodians/u...
Tom Rini [Tue, 7 Jan 2020 13:44:56 +0000 (08:44 -0500)]
Merge tag 'u-boot-atmel-2020.04-a' of https://gitlab.denx.de/u-boot/custodians/u-boot-atmel

First set of u-boot-atmel features for 2020.04 cycle

This feature set is a patch series from Tudor Ambarus which includes
parsing of the spi flash SFDP parser for SST flashes, and using those
tables to retrieve unique saved per device MAC address. This is then
used as base mac address on the SAMA5D2 Wireless SOM EK board.

4 years agoddr: socfpga: Enable ARM64 Non-Secure SDRAM ECC Access
Thor Thayer [Fri, 6 Dec 2019 19:47:32 +0000 (13:47 -0600)]
ddr: socfpga: Enable ARM64 Non-Secure SDRAM ECC Access

The ECC registers in the SDRAM HMC Adapter should always
be accessible (both when ECC is enabled and disabled).
Currently, the registers are accessible only when ECC is enabled.

The ECC Enabled bit is used to determine the status of
ECC by later OSes so always allow access.

Signed-off-by: Thor Thayer <thor.thayer@linux.intel.com>
Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com>
4 years agoarm: socfpga: stratix10: Enable SMMU access
Thor Thayer [Fri, 6 Dec 2019 19:47:31 +0000 (13:47 -0600)]
arm: socfpga: stratix10: Enable SMMU access

Enable TCU access through the Stratix10 CCU so that the
SMMU can access the SDRAM.

Signed-off-by: Thor Thayer <thor.thayer@linux.intel.com>
Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com>