platform/kernel/u-boot.git
4 years agocrypto/fsl: fix unaligned access
Michael Walle [Thu, 4 Jun 2020 19:05:33 +0000 (21:05 +0200)]
crypto/fsl: fix unaligned access

On aarch64 running with dcache off, will result in an unaligned access
exception:

   => dcache off
   => hash sha1 $kernel_addr_r 100
   "Synchronous Abort" handler, esr 0x96000061
   elr: 00000000960317d8 lr : 00000000960316a4 (reloc)
   elr: 00000000fbd787d8 lr : 00000000fbd786a4
   [..]

The compiler emits a "stur x1, [x0, #12]". x1 is might just be 32 bit
aligned pointer. Remove the unused u64 element from the union to drop
the minimal alignment to 32 bit. Also remove the union, because it is
no more needed.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoI2C: ls1043a, ls1046a: enable SYS_I2C_MXC
Biwen Li [Thu, 4 Jun 2020 10:42:14 +0000 (18:42 +0800)]
I2C: ls1043a, ls1046a: enable SYS_I2C_MXC

This enables SYS_I2C_MXC to fix a bug that
failed to boot from sd card with
image u-boot-with-spl-pbl.bin

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoarmv8: layerscape: rework spin table
Michael Walle [Mon, 1 Jun 2020 19:53:36 +0000 (21:53 +0200)]
armv8: layerscape: rework spin table

There are two issues:

 (1) The spin table doesn't convert the endianness of the jump address.
     Although there is code for it, the result isn't used at all (x0).
 (2) If something goes wrong, the function returns. But that doesn't
     make sense at all.

Use the actual converted jump address as destination to fix. If
there is an error, jump to a trap loop. And rearrange the code exception
level switching code to make it smaller and clearer.

This reduces the size of the spin table code section from 696 bytes to
424 bytes. If CONFIG_ARMV8_SWITCH_TO_EL1 the code size reduced from 696
bytes to 632 bytes.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoarmv8: layerscape: relocate spin table if EFI_LOADER is enabled
Michael Walle [Mon, 1 Jun 2020 19:53:35 +0000 (21:53 +0200)]
armv8: layerscape: relocate spin table if EFI_LOADER is enabled

On ARM64, a 64kb region is reserved for the runtime services code.
Unfortunately, this code overlaps with the spin table code, which also
needs to be reserved. Thus now that the code is relocatable, allocate a
new page from EFI, copy the spin table code into it, update any pointers
to the old region and the start the secondary CPUs.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoarmv8: layerscape: clean exported symbols in spintable.S
Michael Walle [Mon, 1 Jun 2020 19:53:34 +0000 (21:53 +0200)]
armv8: layerscape: clean exported symbols in spintable.S

Add a new variable secondary_boot_code_start, which holds a pointer to
the start of the spin table code. This will help to relocate the code
section. While at it, move the size variable from the end to the
beginning so there is a common section for the variables. Remove any
other symbols.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoarmv8: layerscape: drop first .ltorg directive in spintable.S
Michael Walle [Mon, 1 Jun 2020 19:53:33 +0000 (21:53 +0200)]
armv8: layerscape: drop first .ltorg directive in spintable.S

Now that the spin table is in a separate module, this is no longer
necessary. Drop it.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoarmv8: layerscape: make wake_secondary_core_n() static
Michael Walle [Mon, 1 Jun 2020 19:53:32 +0000 (21:53 +0200)]
armv8: layerscape: make wake_secondary_core_n() static

This function is not used outside the module. Make it static.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoarmv8: layerscape: simplify get_spin_tbl_addr() calls
Michael Walle [Mon, 1 Jun 2020 19:53:31 +0000 (21:53 +0200)]
armv8: layerscape: simplify get_spin_tbl_addr() calls

There is no need to cast around. Assign the address to the local
variable and use it.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoarmv8: layerscape: remove determine_mp_bootpg()
Michael Walle [Mon, 1 Jun 2020 19:53:30 +0000 (21:53 +0200)]
armv8: layerscape: remove determine_mp_bootpg()

Only the PowerPC architecture needs this function. Remove it.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoarmv8: layerscape: fix alignment for spin table
Michael Walle [Mon, 1 Jun 2020 19:53:29 +0000 (21:53 +0200)]
armv8: layerscape: fix alignment for spin table

Fix the alignment so it will match the comments. The spin table has to
be 8 byte aligned, so ".align 3" is enough.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoarmv8: layerscape: load function pointer using ADR
Michael Walle [Mon, 1 Jun 2020 19:53:28 +0000 (21:53 +0200)]
armv8: layerscape: load function pointer using ADR

Don't use LDR to load a pointer to a function. This will generate a
literal which cannot be relocated. Use ADR which is PC-relative and
therefore can easily be relocated.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoarmv8: layerscape: move spin table into own module
Michael Walle [Mon, 1 Jun 2020 19:53:27 +0000 (21:53 +0200)]
armv8: layerscape: move spin table into own module

Move it out of lowlevel.S into spintable.S. On layerscape, the secondary
CPUs are brought up in main u-boot. This will make it possible to only
compile the spin table code for the main u-boot and omit it in SPL.

This saves about 720 bytes in the SPL.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoarmv8: layerscape: properly use CPU_RELEASE_ADDR
Michael Walle [Mon, 1 Jun 2020 19:53:26 +0000 (21:53 +0200)]
armv8: layerscape: properly use CPU_RELEASE_ADDR

The generic armv8 code already has support to bring up the secondary
cores. Thus, don't hardcode the jump in the layerscape lowlevel_init to
the spin table code; instead just return early and let the common armv8
code handle the jump. This way we can actually use the CPU_RELEASE_ADDR
feature.

Signed-off-by: Michael Walle <michael@walle.cc>
[Rebased, Removed kontron_sl28.h change as file does not exist]
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoarmv8: layerscape: pretty print info about SMP cores
Michael Walle [Mon, 1 Jun 2020 19:53:25 +0000 (21:53 +0200)]
armv8: layerscape: pretty print info about SMP cores

Make the print of the starting address a debug output and pretty print
the info about online cores.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoarmv8: layerscape: fix spin-table support
Michael Walle [Mon, 1 Jun 2020 19:53:24 +0000 (21:53 +0200)]
armv8: layerscape: fix spin-table support

Spin tables are broken with bootefi. This is because - in contrast to
the booti call chain - there is no call to smp_kick_all_cpus(). Due to
this missing call the secondary CPUs are never released from their "wait
for interrupt state", see secondary_boot_func() in lowlevel.S.

Originally, this "wait for interrupt" is there to make sure, the spin
table is cleared before the secondary cores read it for the first time.
But the boot flow for the layerscape architecture is different from
that. The CPUs are release from their BootROM _after_ U-Boot's
spin-table is cleared, see fsl_layerscape_wake_seconday_cores() in mp.c.
Thus, there is no need to wait for this interrupt and no need for
kicking all cores on cpu_release. An atomic 64bit write to the
spin-table and a "sev" is sufficient.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agonet: pfe_eth: Use spi_flash_read API to access flash memory
Kuldeep Singh [Thu, 28 May 2020 06:12:53 +0000 (11:42 +0530)]
net: pfe_eth: Use spi_flash_read API to access flash memory

Current PFE firmware access spi-nor memory directly. New spi-mem
framework does not support direct memory access. So, let's use
spi_flash_read API to access memory instead of directly using it.

Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agodm: armv8: gpio: include <asm/arch/gpio.h> for fsl-layerscape
hui.song [Wed, 20 May 2020 10:40:19 +0000 (18:40 +0800)]
dm: armv8: gpio: include <asm/arch/gpio.h> for fsl-layerscape

Enable the gpio feature on fsl-layerscape platform.

Signed-off-by: hui.song <hui.song_1@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoarmv8: gpio: add gpio feature
hui.song [Wed, 20 May 2020 10:40:18 +0000 (18:40 +0800)]
armv8: gpio: add gpio feature

add one struct mpc8xxx_gpio_plat to enable gpio feature.

Signed-off-by: hui.song <hui.song_1@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoconfigs: ls1088ardb: Add support for usb boot target
Era Tiwari [Fri, 15 May 2020 07:18:39 +0000 (12:48 +0530)]
configs: ls1088ardb: Add support for usb boot target

LS1088A-RDB has MMC, SCSI, DHCP as boot targets,
but the USB support was missing.
Add support for USB as Boot_targets_devices.

Signed-off-by: Era Tiwari <era.tiwari@nxp.com>
Signed-off-by: Pramod Kumar <pramod.kumar_1@nxp.com>
[Rebased]
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoarmv8: ls1028a: move FSL_LAYERSCAPE to kconfig
Michael Walle [Sat, 9 May 2020 23:20:11 +0000 (01:20 +0200)]
armv8: ls1028a: move FSL_LAYERSCAPE to kconfig

CONFIG_FSL_LAYERSCAPE is available in kconfig. There is no need to
define it per board; the ls1028a_common.h is really board dependent and
only fits to the NXP eval boards. Instead select CONFIG_FSL_LAYERSCAPE
when ARCH_LS1028A is selected.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agofsl_dspi: Introduce DT bindings for CS-SCK and SCK-CS delays
Vladimir Oltean [Mon, 4 May 2020 08:24:26 +0000 (11:24 +0300)]
fsl_dspi: Introduce DT bindings for CS-SCK and SCK-CS delays

Communication with some SPI slaves just won't cut it if these delays
(before the beginning, and after the end of a transfer) are not added to
the Chip Select signal.

These are a straight copy from Linux:
Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt
drivers/spi/spi-fsl-dspi.c

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
[Rebased]
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agobinman: Re-enable concurrent tests
Simon Glass [Fri, 10 Jul 2020 00:39:34 +0000 (18:39 -0600)]
binman: Re-enable concurrent tests

With the change to absolute imports the concurrent tests feature
unfortunately broke. Fix it.

We cannot easy add a warning, since the output messes up tests which check
the output.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Don't change the descriptor in tests
Simon Glass [Sat, 25 Jul 2020 21:11:19 +0000 (15:11 -0600)]
binman: Don't change the descriptor in tests

At present testPackX86RomMeNoDesc removes the contents of the
descriptor.bin file and testPackX86RomMeMissingDesc removes the file
completely.

If a test that relies on this file happens to run after it is removed, it
will not work. Since we have no control over the selecting of tests that
run in parallel and series, we must avoid changing the files.

Update this tests to use separate files instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agoenv: mmc: add redundancy support in mmc_offset_try_partition
Patrick Delaunay [Mon, 15 Jun 2020 08:38:57 +0000 (10:38 +0200)]
env: mmc: add redundancy support in mmc_offset_try_partition

Manage 2 copy at the end of the partition selected by config
"u-boot,mmc-env-partition" to save the U-Boot environment,
with CONFIG_ENV_SIZE and 2*CONFIG_ENV_SIZE offset.

This patch allows to support redundancy (CONFIG_ENV_OFFSET_REDUND).

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoenv: mmc: correct the offset returned by mmc_offset_try_partition
Patrick Delaunay [Mon, 15 Jun 2020 08:38:56 +0000 (10:38 +0200)]
env: mmc: correct the offset returned by mmc_offset_try_partition

The output of the function mmc_offset_try_partition must be a
byte offset in mmc and not a multiple of blksz.

This function is used in mmc_offset(), called by mmc_get_env_addr()
and the offset is used in write_env(), erase_env() and read_env().

In these function, blk_start = offset / mmc->read_bl_len
or /write_bl_len so this offset is not a multiple of blksz.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoenv: mmc: allow support of mmc_get_env_dev with OF_CONTROL
Patrick Delaunay [Mon, 15 Jun 2020 08:38:55 +0000 (10:38 +0200)]
env: mmc: allow support of mmc_get_env_dev with OF_CONTROL

Use the weak function mmc_get_env_dev in mmc_offset_try_partition
function to allow dynamic selection of mmc device to use
and no more use directly the define CONFIG_SYS_MMC_ENV_DEV.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agotest: env: add test for env info sub-command
Patrick Delaunay [Fri, 19 Jun 2020 12:03:37 +0000 (14:03 +0200)]
test: env: add test for env info sub-command

Add a pytest for testing the env info sub-command:

test_env_info: test command with several option that
can be executed on real hardware device without assumption

test_env_info_sandbox: test the result on sandbox
with a known ENV configuration: ready & default & persistent

The quiet option '-q' is used for support in shell test;
for example:
  if env info -p -d -q; then env save; fi

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
4 years agoconfigs: sandbox: Enable sub command 'env info'
Patrick Delaunay [Fri, 19 Jun 2020 12:03:36 +0000 (14:03 +0200)]
configs: sandbox: Enable sub command 'env info'

Enable support for sub command 'env info' in sandbox
with CONFIG_CMD_NVEDIT_INFO. This is aimed primarily
at adding unit test.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agocmd: env: check real location for env info command
Patrick Delaunay [Fri, 19 Jun 2020 12:03:35 +0000 (14:03 +0200)]
cmd: env: check real location for env info command

Check the current ENV location, dynamically provided by the weak
function env_get_location to be sure that the environment can be
persistent.

The compilation flag ENV_IS_IN_DEVICE is not enough when the board
dynamically select the available storage location (according boot
device for example).

This patch solves issue for stm32mp1 platform, when the boot device
is USB.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocmd: env: add option for quiet output on env info
Patrick Delaunay [Fri, 19 Jun 2020 12:03:34 +0000 (14:03 +0200)]
cmd: env: add option for quiet output on env info

The "env info" can be use for test with -d and -p parameter,
in scripting case the output of the command is not needed.

This patch allows to deactivate this output with a new option "-q".

For example, we can save the environment if default
environment is used and persistent storage is managed with:
  if env info -p -d -q; then env save; fi

Without the quiet option, I have the unnecessary traces
First boot:
      Default environment is used
      Environment can be persisted
      Saving Environment to EXT4... File System is consistent

Next boot:
      Environment was loaded from persistent storage
      Environment can be persisted

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agoenv: add failing trace in env_save
Patrick Delaunay [Wed, 24 Jun 2020 08:17:50 +0000 (10:17 +0200)]
env: add failing trace in env_save

Add trace in env save to indicate any errors to end user and avoid
silent output when the command 'env save' is not executed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoenv: correct overflow check of env_has_init size
Patrick Delaunay [Wed, 24 Jun 2020 07:27:25 +0000 (09:27 +0200)]
env: correct overflow check of env_has_init size

Correct the overflow check of the bit-field env_has_init with
the max value of env_location= ENVL_COUNT and no more with the
size of env_locations.

This bit-field is indexed by this enumerate and not by the position in
the env_locations (only used in env_get_location) and the
2 values are different, depending of thea ctivated CONFIG_ENV_IS_ options.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoenv/fat.c: allow loading from a FAT partition on the MMC boot device
David Woodhouse [Fri, 19 Jun 2020 22:07:17 +0000 (23:07 +0100)]
env/fat.c: allow loading from a FAT partition on the MMC boot device

I don't want to have to specify the device; only the partition.

This allows me to use the same image on internal eMMC or SD card for
Banana Pi R2, and it finds its own environment either way.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
[trini: Add #if/#else/#endif logic around CONFIG_SYS_MMC_ENV_DEV usage,
        whitespace changes]
Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agotreewide: convert devfdt_get_addr() to dev_read_addr()
Masahiro Yamada [Fri, 17 Jul 2020 05:36:48 +0000 (14:36 +0900)]
treewide: convert devfdt_get_addr() to dev_read_addr()

When you enable CONFIG_OF_LIVE, you will end up with a lot of
conversions.

To generate this commit, I used coccinelle excluding drivers/core/,
include/dm/, and test/

The semantic patch that makes this change is as follows:

  <smpl>
  @@
  expression dev;
  @@
  -devfdt_get_addr(dev)
  +dev_read_addr(dev)
  </smpl>

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
4 years agotreewide: remove (phys_addr_t) casts from devfdt_get_addr()
Masahiro Yamada [Fri, 17 Jul 2020 05:36:47 +0000 (14:36 +0900)]
treewide: remove (phys_addr_t) casts from devfdt_get_addr()

This cast is unneeded.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
4 years agotreewide: convert (void *)devfdt_get_addr() to dev_read_addr_ptr()
Masahiro Yamada [Fri, 17 Jul 2020 05:36:46 +0000 (14:36 +0900)]
treewide: convert (void *)devfdt_get_addr() to dev_read_addr_ptr()

Use the _ptr suffixed variant instead of casting. Also, convert it to
dev_read_addr_ptr(), which is safe to CONFIG_OF_LIVE.

One curious part is an error check like follows in
drivers/watchdog/omap_wdt.c:

    priv->regs = (struct wd_timer *)devfdt_get_addr(dev);
    if (!priv->regs)
            return -EINVAL;

devfdt_get_addr() returns FDT_ADDR_T_NONE (i.e. -1) on error.
So, this code does not catch any error in DT parsing.

dev_read_addr_ptr() returns NULL on error, so this error check
will work.

I generated this commit by the following command:

 $ find . -name .git -prune -o -name '*.[ch]' -type f -print | \
   xargs sed -i -e 's/([^*)]*\*)devfdt_get_addr(/dev_read_addr_ptr(/'

I manually fixed drivers/usb/host/ehci-mx6.c

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
4 years agofdt_support: skip MTD node with "disabled" in fdt_fixup_mtdparts()
Masahiro Yamada [Fri, 17 Jul 2020 01:46:19 +0000 (10:46 +0900)]
fdt_support: skip MTD node with "disabled" in fdt_fixup_mtdparts()

Currently, fdt_fixup_mtdparts() only checks the compatible property.
It is pointless to fix up the disabled node.

Skip the node if it has the property:

  status = "disabled"

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agofdt_support: call mtdparts_init() after finding MTD node to fix up
Masahiro Yamada [Fri, 17 Jul 2020 01:46:18 +0000 (10:46 +0900)]
fdt_support: call mtdparts_init() after finding MTD node to fix up

Platform code can call fdt_fixup_mtdparts() in order to hand U-Boot's
MTD partitions over to the Linux device tree.

Currently, fdt_fixup_mtdparts() calls mtdparts_init() in its entry.
If no target MTD device is found, an error message like follows is
displayed:

    Device nand0 not found!

This occurs when the same code (e.g. arch/arm/mach-uniphier/fdt-fixup.c)
is shared among several boards, but not all of them support an MTD device.

Parse the DT first, then call mtdparts_init() only when the target MTD
node is found.

Yet, you still need to call mtdparts_init() before device_find().

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agotest/dm: check if devices exist
Heinrich Schuchardt [Thu, 16 Jul 2020 22:20:14 +0000 (00:20 +0200)]
test/dm: check if devices exist

Running 'ut dm' on the sandbox without -D or -d results in segmentation
faults due to NULL pointer dereferences.

Check that device pointers are non-NULL before using them.

Use ut_assertnonnull() for pointers instead of ut_assert().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Tested-by: Philippe Reynes <philippe.reynes@softathome.com>
4 years agoarm: mach-k3: Use SOC driver for device identification
Dave Gerlach [Thu, 16 Jul 2020 04:40:04 +0000 (23:40 -0500)]
arm: mach-k3: Use SOC driver for device identification

Make use of UCLASS_SOC to find device family and revision for
print_cpuinfo.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
4 years agoconfigs: j721e_evm: Enable CONFIG_SOC_DEVICE and CONFIG_SOC_DEVICE_TI_K3
Dave Gerlach [Thu, 16 Jul 2020 04:40:03 +0000 (23:40 -0500)]
configs: j721e_evm: Enable CONFIG_SOC_DEVICE and CONFIG_SOC_DEVICE_TI_K3

Enable CONFIG_SOC_DEVICE and CONFIG_SOC_DEVICE_TI_K3 so the TI K3 SoC
driver can be used for SoC detection.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
4 years agoconfigs: am65x_evm: Enable CONFIG_SOC_DEVICE and CONFIG_SOC_DEVICE_TI_K3
Dave Gerlach [Thu, 16 Jul 2020 04:40:02 +0000 (23:40 -0500)]
configs: am65x_evm: Enable CONFIG_SOC_DEVICE and CONFIG_SOC_DEVICE_TI_K3

Enable CONFIG_SOC_DEVICE and CONFIG_SOC_DEVICE_TI_K3 so the TI K3 SoC
driver can be used for SoC detection.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
4 years agoarm: dts: k3-j721e-mcu-wakeup: Introduce chipid node
Dave Gerlach [Thu, 16 Jul 2020 04:40:01 +0000 (23:40 -0500)]
arm: dts: k3-j721e-mcu-wakeup: Introduce chipid node

Introduce a chipid node to provide a UCLASS_SOC driver to identify TI K3
SoCs.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
4 years agoarm: dts: k3-am65-wakeup: Introduce chipid node
Dave Gerlach [Thu, 16 Jul 2020 04:40:00 +0000 (23:40 -0500)]
arm: dts: k3-am65-wakeup: Introduce chipid node

Introduce a chipid node to provide a UCLASS_SOC driver to identify TI K3
SoCs.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
4 years agodm: soc: Introduce soc_ti_k3 driver for TI K3 SoCs
Dave Gerlach [Thu, 16 Jul 2020 04:39:59 +0000 (23:39 -0500)]
dm: soc: Introduce soc_ti_k3 driver for TI K3 SoCs

Introduce an soc_ti_k3_driver that allows identification and selection
of SoC specific data based on the JTAG ID register for device
identification, as described for AM65x[0] and J721E[1] devices.

[0] http://www.ti.com/lit/ug/spruid7e/spruid7e.pdf
[1] http://www.ti.com/lit/ug/spruil1a/spruil1a.pdf

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
4 years agotest: Add tests for SOC uclass
Dave Gerlach [Thu, 16 Jul 2020 04:39:58 +0000 (23:39 -0500)]
test: Add tests for SOC uclass

Add a sandbox SOC driver, and some tests for the SOC uclass.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
4 years agodm: soc: Introduce UCLASS_SOC for SOC ID and attribute matching
Dave Gerlach [Thu, 16 Jul 2020 04:39:57 +0000 (23:39 -0500)]
dm: soc: Introduce UCLASS_SOC for SOC ID and attribute matching

Introduce UCLASS_SOC to be used for SOC identification and attribute
matching based on the SoC ID info. This allows drivers to be provided
for SoCs to retrieve SoC identifying information and also for matching
device attributes for selecting SoC specific data.

This is useful for other device drivers that may need different
parameters or quirks enabled depending on the specific device variant in
use.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
4 years agodoc: Add new doc for soc ID driver model
Dave Gerlach [Thu, 16 Jul 2020 04:39:56 +0000 (23:39 -0500)]
doc: Add new doc for soc ID driver model

Add a new documentation file for UCLASS_SOC and its usage to describe
the SoC Device ID framework that allows SoC identification and device
data matching.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agofdt_support: add static to fdt_node_set_part_info()
Masahiro Yamada [Wed, 15 Jul 2020 10:35:47 +0000 (19:35 +0900)]
fdt_support: add static to fdt_node_set_part_info()

This function is only called from fdt_fixup_mtdpart() in the same file.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agopatman: When no tracking branch is provided, tell the user
Nicolas Boichat [Mon, 13 Jul 2020 02:50:01 +0000 (10:50 +0800)]
patman: When no tracking branch is provided, tell the user

The user can either count the number of patches, or provide a
tracking branch.

Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agopatman: Make sure sendemail.suppresscc is (un)set correctly
Nicolas Boichat [Mon, 13 Jul 2020 02:50:00 +0000 (10:50 +0800)]
patman: Make sure sendemail.suppresscc is (un)set correctly

Setting sendemail.suppresscc to all or cccmd leads to --cc-cmd
parameter being ignored, and emails going either nowhere, or
just to the To: line maintainer.

Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoRevert "lib: fdt: Split fdtdec_setup_mem_size_base()"
Michal Simek [Fri, 10 Jul 2020 11:16:50 +0000 (13:16 +0200)]
Revert "lib: fdt: Split fdtdec_setup_mem_size_base()"

This reverts commit 3ebe09d09a407f93022d945a205c5318239eb3f6.

There is no user of this split function that's why remove it.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoRevert "lib: fdt: Split fdtdec_setup_memory_banksize()"
Michal Simek [Fri, 10 Jul 2020 11:16:49 +0000 (13:16 +0200)]
Revert "lib: fdt: Split fdtdec_setup_memory_banksize()"

This reverts commit 118f4d4559a4386fa87a1e2509e84a1986b24a34.

There is no user of this split function that's why remove it.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoARM: rmobile: Switch back to fdtdec_setup_memory/banksize_fdt()
Michal Simek [Fri, 10 Jul 2020 11:16:48 +0000 (13:16 +0200)]
ARM: rmobile: Switch back to fdtdec_setup_memory/banksize_fdt()

The commit 361377dbdbc9 ("ARM: rmobile: Merge prior-stage firmware DT
fragment into U-Boot DT on Gen3") reverted changes introduced by commit
175f5027345c ("ARM: renesas: Configure DRAM size from ATF DT fragment")
that's why there is no reason to use functions with _fdt() suffix because
parameter is gd->fdt_blob as is already for functions without _fdt()
suffix.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoAdd information for skipped commit options
Patrick Delaunay [Thu, 2 Jul 2020 17:52:54 +0000 (19:52 +0200)]
Add information for skipped commit options

The unsupported Commit-xxx option are silently skipped
and removed as 're_remove=Commit-\w*', this patch adds
warning message in this case to detect misspelled issue
for the 2 supported options:
  Commit-notes:
  Commit-changes:

For example: the final 's' is missing (Commit-note:)

NB: no issue for Series-xxx option as only the supported
    options are accepted (see valid_series in series.py)

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agolib: libfdt: fdt_region: avoid NULL pointer access
Philippe Reynes [Thu, 2 Jul 2020 17:31:29 +0000 (19:31 +0200)]
lib: libfdt: fdt_region: avoid NULL pointer access

The function fdt_find_regions look in the exclude list for each
property, even if the name is NULL. It could happen if the fit
image is corrupted. On sandbox, it generates a segfault.

To avoid this issue, if the name of a property is NULL, we report
an error and avoid looking in the exclude list.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agopatman: Detect unexpected END
Patrick Delaunay [Thu, 2 Jul 2020 17:08:24 +0000 (19:08 +0200)]
patman: Detect unexpected END

Detect unexpected 'END' line when a section is not detected.

This patch detect issue when tag name for section start is misspelled,
for example 'Commit-note:' for 'Commit-notes:'

  Commit-note:
  ....
  END

Then 'Commit-note:' is removed silently by re_remove = "Commit-\w*:"
but 'END' is kept in commit message.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agocpu: Convert the methods to use a const udevice *
Simon Glass [Mon, 27 Jan 2020 05:06:27 +0000 (22:06 -0700)]
cpu: Convert the methods to use a const udevice *

These functions should not modify the device. Convert them to const so
that callers don't need to cast if they have a const udevice *.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Add support for generating a FIT
Simon Glass [Fri, 10 Jul 2020 00:39:45 +0000 (18:39 -0600)]
binman: Add support for generating a FIT

FIT (Flat Image Tree) is the main image format used by U-Boot. In some
cases scripts are used to create FITs within the U-Boot build system. This
is not ideal for various reasons:

- Each architecture has its own slightly different script
- There are no tests
- Some are written in shell, some in Python

To help address this, add support for FIT generation to binman. This works
by putting the FIT source directly in the binman definition, with the
ability to adjust parameters, etc. The contents of each FIT image come
from sub-entries of the image, as is normal with binman.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agodtoc: Allow adding variable-sized data to a dtb
Simon Glass [Fri, 10 Jul 2020 00:39:44 +0000 (18:39 -0600)]
dtoc: Allow adding variable-sized data to a dtb

Add a method for adding a property containing arbitrary bytes. Make sure
that the tree can expand as needed in this case.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agomkimage: Allow updating the FIT timestamp
Simon Glass [Fri, 10 Jul 2020 00:39:43 +0000 (18:39 -0600)]
mkimage: Allow updating the FIT timestamp

Normally the FIT timestamp is created the first time mkimage is run on a
FIT, when converting the source .its to the binary .fit file. This
corresponds to using the -f flag. But if the original input to mkimage is
a binary file (already compiled) then the timestamp is assumed to have
been set previously.

Add a -t flag to allow setting the timestamp in this case.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agobinman: Allow zero-length entries to overlap
Simon Glass [Fri, 10 Jul 2020 00:39:42 +0000 (18:39 -0600)]
binman: Allow zero-length entries to overlap

Some binary blobs unfortunately obtain their position in the image from
other binary blobs, such as Intel's 'descriptor'. In this case we cannot
rely on packing to work. It is not possible to produce a valid image in
any case, due to the missing blobs.

Allow zero-length overlaps so that this does not cause any problems.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agobinman: Allow missing Intel blobs
Simon Glass [Fri, 10 Jul 2020 00:39:41 +0000 (18:39 -0600)]
binman: Allow missing Intel blobs

Update the Intel blob entries to support missing binaries.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agobinman: Detect when valid images are not produced
Simon Glass [Fri, 10 Jul 2020 00:39:40 +0000 (18:39 -0600)]
binman: Detect when valid images are not produced

When external blobs are missing, show a message indicating that the images
are not functional.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agopatman: Update errors and warnings to use stderr
Simon Glass [Fri, 10 Jul 2020 00:39:39 +0000 (18:39 -0600)]
patman: Update errors and warnings to use stderr

When warnings and errors are produced by tools they should be written to
stderr. Update the tout implementation to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agobinman: Allow external binaries to be missing
Simon Glass [Fri, 10 Jul 2020 00:39:38 +0000 (18:39 -0600)]
binman: Allow external binaries to be missing

Sometimes it is useful to build an image even though external binaries are
not present. This allows the build system to continue to function without
these files, albeit not producing valid images.

U-Boot does with with ATF (ARM Trusted Firmware) today.

Add a new flag to binman to request this behaviour.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agobinman: Convert existing binary blobs to blob_ext
Simon Glass [Fri, 10 Jul 2020 00:39:37 +0000 (18:39 -0600)]
binman: Convert existing binary blobs to blob_ext

Many of the existing blobs rely on external binaries which may not be
available. Move them over to use blob_ext to indicate this.

Unfortunately cros-ec-rw cannot use this class because it inherits
another. So set the 'external' value for that class.

While we are here, drop the import of Entry since it is not used (and
pylint3 complains).

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Add an etype for external binary blobs
Simon Glass [Fri, 10 Jul 2020 00:39:36 +0000 (18:39 -0600)]
binman: Add an etype for external binary blobs

It is useful to be able to distinguish between ordinary blobs such as
u-boot.bin and external blobs that cannot be build by the U-Boot build
system. If the external blobs are not available for some reason, then we
know that a value image cannot be built.

Introduce a new 'blob-ext' entry type for that.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agobinman: Use super() instead of specifying parent type
Simon Glass [Fri, 10 Jul 2020 00:39:35 +0000 (18:39 -0600)]
binman: Use super() instead of specifying parent type

It is easier and less error-prone to use super() when the parent type is
needed. Update binman to remove the type names.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agonet: dc2114x: Add DM support
Marek Vasut [Wed, 8 Jul 2020 05:26:14 +0000 (07:26 +0200)]
net: dc2114x: Add DM support

With all the changes in place, add support for DM into the
dc2114x driver.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
4 years agoARM: rmobile: Add Beacon EmbeddedWorks RZG2M Dev Kit
Adam Ford [Tue, 30 Jun 2020 14:30:11 +0000 (09:30 -0500)]
ARM: rmobile: Add Beacon EmbeddedWorks RZG2M Dev Kit

The Beacon EmbeddedWorks kit is based on the R8A774A1 SoC also
known as the RZ/G2M.

The kit consists of a SOM + Baseboard and supports microSD,
eMMC, Ethernet, a couple celular radios, two CAN interfaces,
Bluetooth and WiFi.

Signed-off-by: Adam Ford <aford173@gmail.com>
4 years agonet: dc2114x: Split common parts of non-DM functions out
Marek Vasut [Wed, 8 Jul 2020 05:20:14 +0000 (07:20 +0200)]
net: dc2114x: Split common parts of non-DM functions out

Split the common code from the non-DM code, so it can be reused by
the DM code later. As always, the recv() function had to be split
into the actual receiving part and free_pkt part to fit with the
DM.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
4 years agonet: dc2114x: Split RX path
Marek Vasut [Wed, 8 Jul 2020 05:12:58 +0000 (07:12 +0200)]
net: dc2114x: Split RX path

Split the RX data check from the rest of the RX function, so that
the check can be performed separately from the processing of the
packet and the release of the received packet once the processing
is finished.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
4 years agonet: dc2114x: Add RX/TX rings into the private data
Marek Vasut [Wed, 8 Jul 2020 05:01:32 +0000 (07:01 +0200)]
net: dc2114x: Add RX/TX rings into the private data

The RX/TX DMA descriptor rings are per-device-instance private data,
so move them into the private data.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
4 years agonet: dc2114x: Pass PCI BDF into phys_to_bus()
Marek Vasut [Wed, 8 Jul 2020 04:50:41 +0000 (06:50 +0200)]
net: dc2114x: Pass PCI BDF into phys_to_bus()

This is a trick in preparation for adding DM support. By passing in
the PCI BDF into the phys_to_bus() macros and calling that dev, we
can substitute dev with udevice when DM support lands and do minor
adjustment to the macros to support both DM and non-DM operation.
No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
4 years agonet: dc2114x: Pass private data around
Marek Vasut [Wed, 8 Jul 2020 04:46:09 +0000 (06:46 +0200)]
net: dc2114x: Pass private data around

This patch replaces the various uses of struct eth_device for accessing
device private data with struct dc2114x_priv, which is compatible both
with DM and non-DM operation.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
4 years agonet: dc2114x: Introduce private data
Marek Vasut [Wed, 8 Jul 2020 04:42:07 +0000 (06:42 +0200)]
net: dc2114x: Introduce private data

Introduce dc2114x_priv, which is a super-structure around eth_device
and tracks per-device state and the device IO address.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
4 years agonet: dc2114x: Use standard I/O accessors
Marek Vasut [Wed, 8 Jul 2020 04:31:54 +0000 (06:31 +0200)]
net: dc2114x: Use standard I/O accessors

The current dc21x4x driver accesses its memory mapped registers directly
instead of using the standard I/O accessors. This can cause problems on
some systems as the accesses can get out of order. So convert the direct
volatile dereferences to use the normal in/out macros.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
4 years agonet: dc2114x: Drop update_srom()
Marek Vasut [Sat, 20 Jun 2020 15:54:53 +0000 (17:54 +0200)]
net: dc2114x: Drop update_srom()

This code is never used, remove it.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
4 years agonet: dc2114x: Add Kconfig entries
Marek Vasut [Sat, 20 Jun 2020 15:43:29 +0000 (17:43 +0200)]
net: dc2114x: Add Kconfig entries

Add Kconfig entries for the dc2114x driver and convert various boards.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
4 years agonet: dc2114x: Support all DC2114x
Marek Vasut [Sat, 20 Jun 2020 15:39:21 +0000 (17:39 +0200)]
net: dc2114x: Support all DC2114x

For the usage in this driver, the chips are identical,
so support all of them.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
4 years agonet: dc2114x: Use PCI_DEVICE() to define PCI device compat list
Marek Vasut [Sat, 20 Jun 2020 15:36:42 +0000 (17:36 +0200)]
net: dc2114x: Use PCI_DEVICE() to define PCI device compat list

Use this macro to fully fill the PCI device ID table. This is mandatory
for the DM PCI support, which checks all the fields.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
4 years agommc: renesas-sdhi: Enable support for R8A774A1
Adam Ford [Tue, 30 Jun 2020 14:30:10 +0000 (09:30 -0500)]
mmc: renesas-sdhi: Enable support for R8A774A1

The r8a774a1 is compatible with the generic rcar-gen3-sdhi controller.
This patch adds the compatibilty flag, to support the SDHI controller.

Signed-off-by: Adam Ford <aford173@gmail.com>
4 years agopinctrl: renesas: Enable R8A774A1 PFC tables
Adam Ford [Tue, 30 Jun 2020 14:30:09 +0000 (09:30 -0500)]
pinctrl: renesas: Enable R8A774A1 PFC tables

The PFC tables for the R8A774A1 are already available, but they
not enabled.

This patch adds the Kconfig option and builds the corresponding file
when PINCTRL_PFC_R8A774A1 is enabled.

Signed-off-by: Adam Ford <aford173@gmail.com>
4 years agoclk: renesas: Add R8A774A1 clock tables
Adam Ford [Tue, 30 Jun 2020 14:30:08 +0000 (09:30 -0500)]
clk: renesas: Add R8A774A1 clock tables

This sync's the clock tables with the official release from
Linux 5.8-RC2 and update r8a774a1_mstp_table from Ref Manual
v1.00.

Signed-off-by: Adam Ford <aford173@gmail.com>
4 years agoARM: dts: r8a774a1: Import DTS from Linux 5.8-rc1
Adam Ford [Tue, 30 Jun 2020 14:30:07 +0000 (09:30 -0500)]
ARM: dts: r8a774a1: Import DTS from Linux 5.8-rc1

This patch imports the device tree and required bindings to permit
the device tree to build for the R8Z774A1 (RZ/G2M).

Signed-off-by: Adam Ford <aford173@gmail.com>
4 years agoARM: renesas: Add basic R8A774A1 Support
Adam Ford [Tue, 30 Jun 2020 14:30:06 +0000 (09:30 -0500)]
ARM: renesas: Add basic R8A774A1 Support

In order to build boards based on the R8A774A1, there needs to
be a config option from which to enable other drivers and/or flags
for this SoC.

Signed-off-by: Adam Ford <aford173@gmail.com>
4 years agobinman: Adjust pylibfdt for incremental build
Simon Glass [Fri, 10 Jul 2020 00:39:33 +0000 (18:39 -0600)]
binman: Adjust pylibfdt for incremental build

If the pylibfdt shared-object file is detected, then Python assumes that
the libfdt.py file exists also.

Sometimes when an incremental build aborts, the shared-object file is
built but the libfdt.py is not. The only way out at this point is to use
'make mkproper', or similar.

Fix this by removing the .so file before it is built. This seems to make
Python rebuild everything.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agobinman: Fix a few typos in the entry docs
Simon Glass [Fri, 10 Jul 2020 00:39:32 +0000 (18:39 -0600)]
binman: Fix a few typos in the entry docs

Some typos have been fixed in the generated entry docs but the code was
not updated. Fix this.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Add support for calling mkimage
Simon Glass [Fri, 10 Jul 2020 00:39:31 +0000 (18:39 -0600)]
binman: Add support for calling mkimage

As a first step to integrating mkimage into binman, add a new entry type
that feeds data into mkimage for processing and incorporates that output
into the image.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Set a default toolpath
Simon Glass [Fri, 10 Jul 2020 00:39:30 +0000 (18:39 -0600)]
binman: Set a default toolpath

When binman is run from 'make check' it is given a toolpath so that the
latest tools (e.g. mkimage) are used. When run manually with no toolpath,
it relies on the system mkimage. But this may be missing or old.

Make some effort to find the built-from-soruce version by looking in the
current directory and in the builds created by 'make check'.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Specify the toolpath when running test coverage
Simon Glass [Fri, 10 Jul 2020 00:39:29 +0000 (18:39 -0600)]
binman: Specify the toolpath when running test coverage

At present binman's test coverage runs without a toolpath set. This means
that the system tools will be used. That may not be correct if they are
out of date or missing and this can result in a reduction in test coverage
below 100%.

Provide the toolpath to binman in this case.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Correct the search patch for pylibfdt
Simon Glass [Fri, 10 Jul 2020 00:39:28 +0000 (18:39 -0600)]
binman: Correct the search patch for pylibfdt

Now that binman uses tools/ as its base directory for importing modules,
the path to the pylibfdt build by U-Boot is incorrect. Fix it with a new
path.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agobinman: cbfs: Fix IFWI typo
Simon Glass [Fri, 10 Jul 2020 00:39:27 +0000 (18:39 -0600)]
binman: cbfs: Fix IFWI typo

This comment references the wrong thing. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agobinman: Output errors to stderr
Simon Glass [Fri, 10 Jul 2020 00:39:26 +0000 (18:39 -0600)]
binman: Output errors to stderr

At present binman outputs errors to stdout which means that fails are
effectively silent when printed by buildman, for example. Fix this by
outputing errors to stderr.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years ago.gitignore: Ignore Python 3 cache directories
Simon Glass [Fri, 10 Jul 2020 00:39:25 +0000 (18:39 -0600)]
.gitignore: Ignore Python 3 cache directories

These can appear when moving between branches that have different tools
in the tree. Ignore them.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agodm: core Fix long line in device_bind_common()
Simon Glass [Fri, 10 Jul 2020 00:39:24 +0000 (18:39 -0600)]
dm: core Fix long line in device_bind_common()

Fix an over-length line in this function.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agopatman: Add a -D option to enable debugging
Simon Glass [Mon, 6 Jul 2020 03:41:59 +0000 (21:41 -0600)]
patman: Add a -D option to enable debugging

Most users don't want to see traceback errors. Add an option to enable
them for debugging. Disable them by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agopatman: Support collecting response tags in Patchstream
Simon Glass [Mon, 6 Jul 2020 03:41:57 +0000 (21:41 -0600)]
patman: Support collecting response tags in Patchstream

Collect response tags such as 'Reviewed-by' while parsing the stream.
This allows us to see what tags are present.

Add a new 'Fixes' tag also, since this is now quite common.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agopatman: Allow disabling 'bright' mode with Print output
Simon Glass [Mon, 6 Jul 2020 03:41:56 +0000 (21:41 -0600)]
patman: Allow disabling 'bright' mode with Print output

At present all text is marked bright, which makes it stand out on the
terminal. Add a way to disable that, as is done with the Color class.

Signed-off-by: Simon Glass <sjg@chromium.org>