]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
3 years agoconfigs: sei510/610: android bootflow via abootimg
Guillaume La Roque [Thu, 5 Aug 2021 15:17:28 +0000 (17:17 +0200)]
configs: sei510/610: android bootflow via abootimg

Activate the following Kconfig options:
* AVB       for Android Verified Boot support
* ADTIMG    for merging DTBOs
* ABOOTIMG  for extracting Android boot image

Also rework the partitioning tables:
- add a misc partition to handle BCB messages
- add a dtbo partition to store various DTBOs
- add a vbmeta partition for AVB hashes
- Merge vendor and system into the "super" partition

Note: avb support is disables by default. To activate it:
 => setenv force_avb 1;
 => saveenv;

Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agoconfigs: sei510/sei610: don't use hard-coded gpt uuids
Mattijs Korpershoek [Thu, 5 Aug 2021 15:17:27 +0000 (17:17 +0200)]
configs: sei510/sei610: don't use hard-coded gpt uuids

doc/README.gpt states:

> The fields 'uuid' and 'uuid_disk' are optional if CONFIG_RANDOM_UUID is
> enabled. A random uuid will be used if omitted or they point to an empty/
> non-existent environment variable. The environment variable will be
> set to the generated UUID.  The 'gpt guid' command reads the current
> value of the uuid_disk from the GPT.

Since we have CONFIG_RANDOM_UUID=y, remove the hard-coded uuids
and use meaningful variable names instead.

Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agoconfigs: sei510/sei610: reformat PARTS_default
Mattijs Korpershoek [Thu, 5 Aug 2021 15:17:26 +0000 (17:17 +0200)]
configs: sei510/sei610: reformat PARTS_default

There is a mix of spaces and tabs at the leading \. This makes updating
theses lines harder.

Add a single space before each \ for some consistency.

Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agoconfigs: meson64_android: boot android via abootimg
Guillaume La Roque [Thu, 5 Aug 2021 15:17:25 +0000 (17:17 +0200)]
configs: meson64_android: boot android via abootimg

Since Android 10, we are required to use a "dtbo" partition which
includes the various device-tree overlays [1].
It's also possible to provide a "dtb" partition.

This is supported via the "abootimg" command.

On Yukawa, the assumption is that we have only a "dtbo" partition, which
includes all board dtbs and their dtbos [2]

[1] https://source.android.com/devices/architecture/dto/partitions
[2] https://android.googlesource.com/device/amlogic/yukawa/+/refs/heads/master/build/tasks/dtimages.mk#16
Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agoconfigs: meson64_android: define BOOT_CMD macro
Mattijs Korpershoek [Thu, 5 Aug 2021 15:17:24 +0000 (17:17 +0200)]
configs: meson64_android: define BOOT_CMD macro

BOOT_CMD might be different based on CONFIG_CMD_ABOOTIMG.

To prepare for abootimg support, extract the boot command
to a dedicated macro.

Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agoconfigs: meson64_android: implement A/B slot support
Mattijs Korpershoek [Thu, 5 Aug 2021 15:17:23 +0000 (17:17 +0200)]
configs: meson64_android: implement A/B slot support

Implement A/B slot selection using the U-Boot ab_select command.

Keep support for non A/B.

Not: We need to redefine the recovery partition label, as RecoveryOS
is included in the boot image for A/B systems [1]

[1] https://source.android.com/devices/tech/ota/ab/ab_implement#recovery
Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agoconfigs: meson64_android: implement AVB support
Mattijs Korpershoek [Thu, 5 Aug 2021 15:17:22 +0000 (17:17 +0200)]
configs: meson64_android: implement AVB support

AVB (Android Verified Boot) is well supported in U-Boot already.
Add support for it in meson64_android.

This is controlled by the "force_avb" environment variable and the
CONFIG_CMD_AVB option.

Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agoconfigs: meson64_android: increase SYS_MALLOC_LEN to 128M for AVB
Mattijs Korpershoek [Thu, 5 Aug 2021 15:17:21 +0000 (17:17 +0200)]
configs: meson64_android: increase SYS_MALLOC_LEN to 128M for AVB

To prepare for AVB support, increase SYS_MALLOC_LEN to 128M.
This value has been found by testing the following on khadas vim3l:
  => avb init
  => avb verify

Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agoconfigs: meson64: permit redefining SYS_MALLOC_LEN
Mattijs Korpershoek [Thu, 5 Aug 2021 15:17:20 +0000 (17:17 +0200)]
configs: meson64: permit redefining SYS_MALLOC_LEN

Permit redefining SYS_MALLOC_LEN for board specific configs.
This is especially useful for Android with AVB, which requires a malloc
length of 128M.

Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agoboard: amlogic: odroid-n2: fix fdtfile suffix for n2-plus
Christian Hewitt [Wed, 4 Aug 2021 11:01:07 +0000 (11:01 +0000)]
board: amlogic: odroid-n2: fix fdtfile suffix for n2-plus

The N2+ dtb is meson-g12b-odroid-n2-plus.dtb, not n2_plus, so
correct the suffix provided in the board file. Also align the
board ident string shown during boot to match.

Fixes: 8bc780106c13 ("board: amlogic: odroid: add runtime detection of the N2/N2+/C4/HC4 variants")
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agoRevert "ARM: meson: Add support for fastboot_set_reboot_flag()"
Mattijs Korpershoek [Fri, 30 Jul 2021 12:28:12 +0000 (14:28 +0200)]
Revert "ARM: meson: Add support for fastboot_set_reboot_flag()"

With the introduction of a generic reboot flag implemented in commit
a362ce214f ("fastboot: Implement generic fastboot_set_reboot_flag"), we
no longer need the custom PSCI implementation to handle the reboot reason.

This reverts commit 9a34dedfae0ebb031a45324c2fed8c39b2c6fcf2.

Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agoconfigs: sei610/sei510: set CONFIG_CMD_BCB=y
Mattijs Korpershoek [Fri, 30 Jul 2021 12:28:11 +0000 (14:28 +0200)]
configs: sei610/sei510: set CONFIG_CMD_BCB=y

SEI-610 and SEI-510 are both for Android boards based on Yukawa[1]

Enable the BCB command to enable the standard Android boot flow.

[1] https://android.googlesource.com/device/amlogic/yukawa/
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agoconfigs: meson64_android: reboot to fastbootd from bootloader
Mattijs Korpershoek [Fri, 30 Jul 2021 12:28:10 +0000 (14:28 +0200)]
configs: meson64_android: reboot to fastbootd from bootloader

Whenever we test for boot-fastboot in the BCB, it means that Android
wants us to boot into recovery with a special mode (fastbootd).

Force reboot into recovery in that case.

Note: we don't erase the bcb on purpose here: recoveryOS needs to read
the BCB as well to know if it boots into regular recovery mode or
fastbootd mode.

Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agoconfigs: meson64_android: implement recovery boot via BCB
Mattijs Korpershoek [Fri, 30 Jul 2021 12:28:09 +0000 (14:28 +0200)]
configs: meson64_android: implement recovery boot via BCB

Right now meson64_android does not know how to boot into Android
Recovery: it simply falls back to "fastboot" mode in the bootloader.

Implement the boot to recovery.
While at it, use the standard BCB way instead of a sm for consistency.

Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agoconfigs: meson64_android: use BCB for reboot to bootloader
Mattijs Korpershoek [Fri, 30 Jul 2021 12:28:08 +0000 (14:28 +0200)]
configs: meson64_android: use BCB for reboot to bootloader

As of today, we use a "vendor specific" secure monitor call for the
reboot reason (sm).

We should not need this. Android uses the BCB (Bootloader Control Block)
to communicate with the bootloader.

Implement "reboot into bootloader" using the standard BCB way instead of
using sm calls.

Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agoconfigs: meson64_android: don't set console bootargs
Mattijs Korpershoek [Thu, 29 Jul 2021 07:21:13 +0000 (09:21 +0200)]
configs: meson64_android: don't set console bootargs

The console bootargs are already set from the kernel commandline.
On Android, this is done in yukawa at [1]

Don't set it in the bootloader since it's overridden by the kernel anyways.

[1] https://android-review.googlesource.com/c/device/amlogic/yukawa/+/1112994
Signed-off-by: Guillaume La Roque <mkorpershoek@baylibre.com>
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agoconfigs: meson64_android: use logo part label instead of index
Mattijs Korpershoek [Thu, 29 Jul 2021 07:21:12 +0000 (09:21 +0200)]
configs: meson64_android: use logo part label instead of index

To display the bootup logo, we read the gpt and assume that the
partition with index "2" will be the "logo" partition.

This might not always be the case, and it's very error-prone.

Load the logo partition by label instead of by index.

Signed-off-by: Guillaume La Roque <mkorpershoek@baylibre.com>
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agoconfigs: meson64_android: use boot part label instead of index
Mattijs Korpershoek [Thu, 29 Jul 2021 07:21:11 +0000 (09:21 +0200)]
configs: meson64_android: use boot part label instead of index

To boot Android, we read the gpt and assume that the partition with
index "1" will be the "boot" partition.

This might not always be the case, as there are no requirements from
Android on the partition order.

However, Android does seem to use the "boot" label quite a lot on their
public documentation [1]

Load the boot partition by label instead of by index

[1] https://source.android.com/devices/bootloader/partitions
Signed-off-by: Guillaume La Roque <mkorpershoek@baylibre.com>
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agoconfigs: meson64_android: use CONFIG_FASTBOOT_USB_DEV
Mattijs Korpershoek [Thu, 29 Jul 2021 07:21:10 +0000 (09:21 +0200)]
configs: meson64_android: use CONFIG_FASTBOOT_USB_DEV

Right now, when running fastboot we use a hard-coded "0" for the
device number.

Use the Kconfig option named CONFIG_FASTBOOT_USB_DEV instead.

Signed-off-by: Guillaume La Roque <mkorpershoek@baylibre.com>
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agoconfigs: meson64_android: fix bad indent in EXTRA_ENV_SETTINGS
Mattijs Korpershoek [Thu, 29 Jul 2021 07:21:09 +0000 (09:21 +0200)]
configs: meson64_android: fix bad indent in EXTRA_ENV_SETTINGS

both lines seem to be joined together which is not the case for the
meson64.h EXTRA_ENV_SETTINGS.

Add a newline for consistency.

Signed-off-by: Guillaume La Roque <mkorpershoek@baylibre.com>
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agoconfigs: sei610: fix typo in header comment
Mattijs Korpershoek [Thu, 29 Jul 2021 07:21:08 +0000 (09:21 +0200)]
configs: sei610: fix typo in header comment

s/510/610/

Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agoMerge branch '2021-07-28-build-improvements'
Tom Rini [Wed, 28 Jul 2021 22:51:16 +0000 (18:51 -0400)]
Merge branch '2021-07-28-build-improvements'

- Assorted Makefile cleanups
- A few code / build cleanups

3 years agoMakefile: Move drivers/i2c/ into drivers/Makefile
Simon Glass [Sun, 11 Jul 2021 03:14:37 +0000 (21:14 -0600)]
Makefile: Move drivers/i2c/ into drivers/Makefile

This rule should not be in the top-level Makefile. Now that we have a
consistent set of I2C Kconfigs for U-Boot proper, SPL and TPL, we can move
it.

Make use of the existing SPL/TPL rule in drivers/Makefile instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agoi2c: Rename SPL/TPL_I2C_SUPPORT to I2C
Simon Glass [Sun, 11 Jul 2021 03:14:36 +0000 (21:14 -0600)]
i2c: Rename SPL/TPL_I2C_SUPPORT to I2C

Rename these options so that CONFIG_IS_ENABLED can be used with them.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
3 years agoi2c: Create a new Kconfig for I2C
Simon Glass [Sun, 11 Jul 2021 03:14:35 +0000 (21:14 -0600)]
i2c: Create a new Kconfig for I2C

At present we have CONFIG_SPL_I2C but not CONFIG_I2C. The reason
CONFIG_I2C is not strictly necessary is that:

a) We have CONFIG_SYS_I2C_LEGACY and CONFIG_DM_I2C for the two possible
   i2c stacks
b) In U-Boot proper, we always build drivers/i2c/ regardless of the
   options

Still, it is better to have CONFIG_I2C - it makes U-Boot proper similar to
SPL/TPL, so we can (in a future commit) simplify the Makefile rules.

Enable it by default, since as above, we have separate options
(SYS_I2C_LEGACY and DM_I2C) to control whether it is 'really' enabled.

Once we have migrated I2C to driver model, we can drop SYS_I2C_LEGACY and
make DM_I2C become I2C. For now, this lets us simplify the Makefile rules.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
3 years agoi2c: Drop unused CONFIG_I2C
Simon Glass [Sun, 11 Jul 2021 03:14:34 +0000 (21:14 -0600)]
i2c: Drop unused CONFIG_I2C

This actually does nothing but is defined by a few dozen boards. Drop it,
so we can define a real one.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
3 years agoi2c: Fix the migration warning
Simon Glass [Sun, 11 Jul 2021 03:14:33 +0000 (21:14 -0600)]
i2c: Fix the migration warning

While there is a CONFIG_I2C it does not really mean anything and is
defined by only a few dozen boards. This should key off
CONFIG_SYS_I2C_LEGACY instead.

Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
3 years agoi2c: Rename CONFIG_SYS_I2C to CONFIG_SYS_I2C_LEGACY
Simon Glass [Sun, 11 Jul 2021 03:14:32 +0000 (21:14 -0600)]
i2c: Rename CONFIG_SYS_I2C to CONFIG_SYS_I2C_LEGACY

It is quite confusing that CONFIG_SYS_I2C selects the legacy I2C and
CONFIG_DM_I2C selects the current I2C. The deadline to migrate I2C is less
than a year away.

Also we want to have a CONFIG_I2C for U-Boot proper just like we have
CONFIG_SPL_I2C for SPL, so we can simplify the Makefile rules.

Rename this symbol so it is clear it is going away.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
3 years agoRename DRIVERS_MISC_SUPPORT to DRIVERS_MISC
Simon Glass [Sun, 11 Jul 2021 03:14:31 +0000 (21:14 -0600)]
Rename DRIVERS_MISC_SUPPORT to DRIVERS_MISC

Rename these options so that CONFIG_IS_ENABLED can be used with them.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agoRename GPIO_SUPPORT to GPIO
Simon Glass [Sun, 11 Jul 2021 03:14:30 +0000 (21:14 -0600)]
Rename GPIO_SUPPORT to GPIO

Rename these options so that CONFIG_IS_ENABLED can be used with them.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agoRename SPL_USB_HOST_SUPPORT to SPL_USB_HOST
Simon Glass [Sun, 11 Jul 2021 03:14:29 +0000 (21:14 -0600)]
Rename SPL_USB_HOST_SUPPORT to SPL_USB_HOST

Rename this option so that CONFIG_IS_ENABLED can be used with it.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agoRename SPL_WATCHDOG_SUPPORT to SPL_WATCHDOG
Simon Glass [Sun, 11 Jul 2021 03:14:28 +0000 (21:14 -0600)]
Rename SPL_WATCHDOG_SUPPORT to SPL_WATCHDOG

Rename this option so that CONFIG_IS_ENABLED can be used with it.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agoRename SPL_MUSB_NEW_SUPPORT to SPL_MUSB_NEW
Simon Glass [Sun, 11 Jul 2021 03:14:27 +0000 (21:14 -0600)]
Rename SPL_MUSB_NEW_SUPPORT to SPL_MUSB_NEW

Rename this option so that CONFIG_IS_ENABLED can be used with it.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agoRename SPL_ETH_SUPPORT to SPL_ETH
Simon Glass [Sun, 11 Jul 2021 03:14:26 +0000 (21:14 -0600)]
Rename SPL_ETH_SUPPORT to SPL_ETH

Rename this option so that CONFIG_IS_ENABLED can be used with it.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agoRename SPL_CRYPTO_SUPPORT to SPL_CRYPTO
Simon Glass [Sun, 11 Jul 2021 03:14:25 +0000 (21:14 -0600)]
Rename SPL_CRYPTO_SUPPORT to SPL_CRYPTO

Rename this option so that CONFIG_IS_ENABLED can be used with it.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agoRename SPL_POWER_SUPPORT to SPL_POWER
Simon Glass [Sun, 11 Jul 2021 03:14:24 +0000 (21:14 -0600)]
Rename SPL_POWER_SUPPORT to SPL_POWER

Rename this option so that CONFIG_IS_ENABLED can be used with it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agoMakefile: Move phy rules into drivers/phy
Simon Glass [Sun, 11 Jul 2021 03:14:23 +0000 (21:14 -0600)]
Makefile: Move phy rules into drivers/phy

These don't belong in the drivers Makefile so move them down into
the correct place.

Signed-off-by: Simon Glass <sjg@chromium.org>
[trini: Fixup some missing dependencies this exposed]
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoMakefile: Sort the subdirectories
Simon Glass [Sun, 11 Jul 2021 03:14:22 +0000 (21:14 -0600)]
Makefile: Sort the subdirectories

Adjust the subdirectories included in this file so that they are in
alphabetical order. This makes it easier to follow.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agoREADME: Fix hyphenation in the directory docs
Simon Glass [Sun, 11 Jul 2021 03:14:21 +0000 (21:14 -0600)]
README: Fix hyphenation in the directory docs

Hyphens are missing in various places where the intent is to create an
adjective. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agolib: Create a new Kconfig option for charset conversion
Simon Glass [Fri, 2 Jul 2021 18:36:17 +0000 (12:36 -0600)]
lib: Create a new Kconfig option for charset conversion

Rather than looking at two KConfig options in the Makefile, create a new
Kconfig option for compiling lib/charset.c

Enable it for UFS also, which needs this support.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoAllow efi_loader header to be included always
Simon Glass [Fri, 2 Jul 2021 18:36:16 +0000 (12:36 -0600)]
Allow efi_loader header to be included always

It is bad practice to put function declarations behind an #ifdef since
it makes it impossible to use IS_ENABLED() in the C code. The main reason
for doing this is when an empty static inline function is desired when
the feature is disabled.

To this end, this header provides two different versions of various
functions and macros. Collect them together in one place for clarity.
Allow all the rest of the header to be included, regardless of the
setting of EFI_LOADER.

With the inclusion of blk.h the 'struct blk_desc' declaration is
unnecessary. Drop it while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agoUse LIB_UUID with ACPIGEN and FS_BTRFS
Simon Glass [Fri, 2 Jul 2021 18:36:15 +0000 (12:36 -0600)]
Use LIB_UUID with ACPIGEN and FS_BTRFS

Since the ACPI-generation code makes use of UUIDs we typically need to
enabled UUID support for it to build. Add a new Kconfig condition.

Use it for BTRFS also.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agodisk: Tidy up #ifdefs in part_efi
Simon Glass [Fri, 2 Jul 2021 18:36:14 +0000 (12:36 -0600)]
disk: Tidy up #ifdefs in part_efi

This file does not correctly handle the various cases, sometimes
producing warnings about partition_basic_data_guid being defined but not
used. Fix it.

There was some discussion about adjusting Kconfig or making
HAVE_BLOCK_DEVICE a prerequisite for PARTITIONS, but apparently this is
not feasible. Such changes can be undertaken separate from the goal of
this series.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agoMakefile: Drop include/asm directory as well as symlink
Simon Glass [Fri, 2 Jul 2021 18:36:13 +0000 (12:36 -0600)]
Makefile: Drop include/asm directory as well as symlink

At present when using 'make mrproper' on an out-of-tree build, a warning
is shown about include/asm being a directory. With old versions of U-Boot
it is a file, but more recently it has become a directory.

Remove this directory first, since that covers both cases.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agoMerge branch '2021-07-28-setexpr-fmt-support'
Tom Rini [Wed, 28 Jul 2021 13:51:09 +0000 (09:51 -0400)]
Merge branch '2021-07-28-setexpr-fmt-support'

- Add a new feature (and CONFIG option) to allow setexpr to take format
  (%d, etc) arguments.

3 years agoAzureCI: Move i.MX8 builds to their own job
Tom Rini [Tue, 27 Jul 2021 21:01:28 +0000 (17:01 -0400)]
AzureCI: Move i.MX8 builds to their own job

The aarch64 catch-all job is starting to get close to or exceed the time
limit for jobs.  Move the i.MX8 boards to their own job to fix this.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agotest: cmd: setexpr: add format string tests
Roland Gaudig [Fri, 23 Jul 2021 12:29:23 +0000 (12:29 +0000)]
test: cmd: setexpr: add format string tests

Add test cases for the setexpr format string operator.

Signed-off-by: Roland Gaudig <roland.gaudig@weidmueller.com>
[trini: Enable on sandbox]
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agodoc: usage: add description for setexpr command
Roland Gaudig [Fri, 23 Jul 2021 12:29:22 +0000 (12:29 +0000)]
doc: usage: add description for setexpr command

Add usage for the setexpr command. It has been added to describe
mainly the new setexpr format string operation.

Signed-off-by: Roland Gaudig <roland.gaudig@weidmueller.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agocmd: setexpr: add format string handling
Roland Gaudig [Fri, 23 Jul 2021 12:29:21 +0000 (12:29 +0000)]
cmd: setexpr: add format string handling

Add format string handling operator to the setexpr command.
It allows to use C or Bash like format string expressions to be
evaluated with the result being stored inside the environment variable
name.

  setexpr <name> fmt <format> [value]...

The following example

  setexpr foo fmt "%d, 0x%x" 0x100 ff

will result in $foo being set to "256, 0xff".

Signed-off-by: Roland Gaudig <roland.gaudig@weidmueller.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agocmd: printf: add helper functions from busybox
Roland Gaudig [Fri, 23 Jul 2021 12:29:20 +0000 (12:29 +0000)]
cmd: printf: add helper functions from busybox

Import the following helper functions from Busybox-1.33.1 which are
required by printf.c:

  process_escape_sequence from libbb/process_escape_sequence.c,
  skip_whitespace from libbb/skip_whitespace.c,
  overlapping_strcpy  from libbb/safe_strncpy.c

  src-url: https://git.busybox.net/busybox/
  commit bcc5b0e6caca6c7602a6a41f "Bump version to 1.33.1"
  version: 1.33.1

Signed-off-by: Roland Gaudig <roland.gaudig@weidmueller.com>
3 years agocmd: printf: import busybox-1.33.1 printf.c
Roland Gaudig [Fri, 23 Jul 2021 12:29:19 +0000 (12:29 +0000)]
cmd: printf: import busybox-1.33.1 printf.c

Import printf.c from the Busybox project, which provides Bash like
format string handling.

  src-url: https://git.busybox.net/busybox/
  commit bcc5b0e6caca6c7602a6a41f "Bump version to 1.33.1"
  version: 1.33.1

Signed-off-by: Roland Gaudig <roland.gaudig@weidmueller.com>
3 years agolib: strto: add simple_strtoll function
Roland Gaudig [Fri, 23 Jul 2021 12:29:18 +0000 (12:29 +0000)]
lib: strto: add simple_strtoll function

Add simple_strtoll function for converting a string containing digits
into a long long int value.

Signed-off-by: Roland Gaudig <roland.gaudig@weidmueller.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoMerge tag 'u-boot-amlogic-20210727' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Tue, 27 Jul 2021 15:42:31 +0000 (11:42 -0400)]
Merge tag 'u-boot-amlogic-20210727' of https://source.denx.de/u-boot/custodians/u-boot-amlogic

- Add SMBIOS info for Khadas VIM boards
- Fix meson-axg-mipi PHY build
- Fix VIM3 board phy-names property setup
- Return correct value for non emmc boot sources on VIM3
- add kernel compression vars

3 years agoMerge tag 'u-boot-stm32-20210727' of https://source.denx.de/u-boot/custodians/u-boot-stm
Tom Rini [Tue, 27 Jul 2021 13:11:25 +0000 (09:11 -0400)]
Merge tag 'u-boot-stm32-20210727' of https://source.denx.de/u-boot/custodians/u-boot-stm

- FIP Enable OP-TEE and TZC support in SPL for STM32MP15 SoC
- Add stm32mp15 missing SPI clock support
- Manage pull-up on gpio button STM32MP15 boards
- Correct STM32MP15 boot when TAMPER registers are invalid
- Fix EMMC pinmux on STM32MP15 Avenger96 board

3 years agoconfigs: Enable SMBIOS for Khadas VIM boards
Artem Lapkin [Tue, 27 Jul 2021 01:23:19 +0000 (09:23 +0800)]
configs: Enable SMBIOS for Khadas VIM boards

Enable configs to support SMBIOS for all Khadas VIM boards

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Artem Lapkin <art@khadas.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agoARM: dts: meson: Use devicetree for SMBIOS settings for Khadas VIM boards
Artem Lapkin [Tue, 27 Jul 2021 01:23:18 +0000 (09:23 +0800)]
ARM: dts: meson: Use devicetree for SMBIOS settings for Khadas VIM boards

Khadas vim series: Use devicetree for SMBIOS settings
Add settings and enable the default sysinfo driver so that these can come
from the device tree.

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Artem Lapkin <art@khadas.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agophy: meson-axg-mipi: Access parent ofnode through dev_ofnode()
Alper Nebi Yasak [Fri, 14 May 2021 20:54:20 +0000 (23:54 +0300)]
phy: meson-axg-mipi: Access parent ofnode through dev_ofnode()

With commit 84a42ae36683 ("dm: core: Rename device node to indicate it
is private") and commit f10643cf8a4c ("dm: core: Access device ofnode
through functions") accesses to the "node" member were replaced with
dev_ofnode(). Also apply that replacement here.

Fixes: 4547551aa019 ("phy: Add Amlogic AXG MIPI PCIe Analog PHY driver")
Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agophy: meson-axg-mipi: Rename "priv_auto_alloc_size" to "priv_auto"
Alper Nebi Yasak [Fri, 14 May 2021 20:54:19 +0000 (23:54 +0300)]
phy: meson-axg-mipi: Rename "priv_auto_alloc_size" to "priv_auto"

With commit 41575d8e4c33 ("dm: treewide: Rename auto_alloc_size members
to be shorter") "priv_auto_alloc_size" was renamed to "priv_auto". Apply
the rename to these two drivers as well.

Fixes: 4547551aa019 ("phy: Add Amlogic AXG MIPI PCIe Analog PHY driver")
Fixes: 7ef19503bacf ("phy: Add Amlogic AXG MIPI D-PHY driver")
Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agoboard: amlogic: vim3: fix phy-names property setup
Artem Lapkin [Tue, 13 Jul 2021 06:48:47 +0000 (14:48 +0800)]
board: amlogic: vim3: fix phy-names property setup

phy-names was improperly implemented resulting in an inoperable USB-OTG
port.

- phy-names = "usb2-phy0\0\0usb2-phy1\0";
+ phy-names = "usb2-phy0\0usb2-phy1";

Signed-off-by: Artem Lapkin <art@khadas.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agoVIM3: mmc_get_env_dev correct non emmc boot sources
Artem Lapkin [Thu, 27 May 2021 07:35:28 +0000 (15:35 +0800)]
VIM3: mmc_get_env_dev correct non emmc boot sources

need return -1 if boot source is not EMMC or SD ( for example it will be
useful if we have multy env sources configuration and device was booted
from SPI flash and env need read from SPI not from mmc )

Signed-off-by: Artem Lapkin <art@khadas.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agomeson64: add kernel compression vars
Artem Lapkin [Thu, 27 May 2021 06:43:51 +0000 (14:43 +0800)]
meson64: add kernel compression vars

make possible to load simple compressed linux kernel for meson64

Signed-off-by: Artem Lapkin <art@khadas.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agoARM: dts: stm32mp: Add OP-TEE reserved memory to SPL dtb
Alexandru Gagniuc [Thu, 15 Jul 2021 19:19:27 +0000 (14:19 -0500)]
ARM: dts: stm32mp: Add OP-TEE reserved memory to SPL dtb

Add the "/reserved-memory/optee" node to the SPL devicetree. The
purpose is to allow configuring TZC regions when booting OP-TEE.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agostm32mp1: spl: Configure TrustZone controller for OP-TEE
Alexandru Gagniuc [Thu, 15 Jul 2021 19:19:26 +0000 (14:19 -0500)]
stm32mp1: spl: Configure TrustZone controller for OP-TEE

OP-TEE is very particular about how the TZC should be configured.
When booting an OP-TEE payload, an incorrect TZC configuration will
result in a panic.

Most information can be derived from the SPL devicetree. The only
information we don't have is the split between TZDRAM and shared
memory. This has to be hardcoded. The rest of the configuration is
fairly easy, and only requires 3 TZC regions. Configure them.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
3 years agoarm: stm32mp: Implement support for TZC 400 controller
Alexandru Gagniuc [Thu, 15 Jul 2021 19:19:25 +0000 (14:19 -0500)]
arm: stm32mp: Implement support for TZC 400 controller

The purpose of this change is to allow configuring TrustZone (TZC)
memory permissions. For example, OP-TEE expects TZC regions to be
configured in a very particular way. The API presented here is
intended to allow exactly that.

UCLASS support is not implemented, because it would not be too useful.
Changing TZC permissions needs to be done with care, so as not to cut
off access to memory we are currently using. One place where we can
use this is at the end of SPL, right before jumping to OP-TEE.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agospl: Introduce spl_board_prepare_for_optee() hook
Alexandru Gagniuc [Thu, 15 Jul 2021 19:19:24 +0000 (14:19 -0500)]
spl: Introduce spl_board_prepare_for_optee() hook

OP-TEE requires some particular setup, which is not needed for linux
or other payloads. Add a hook for platform-specific code to perform
any OP-TEE related configuration and initialization.

A weak function is used because it is symmetrical to other
spl_board_prepare_for_*() implementations. A solution to avoid the use
of weak functions would trivially apply to all these implementations.
However, re-designing this is beyond the scope of this patch.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agospl: mmc: Support OP-TEE payloads in Falcon mode
Alexandru Gagniuc [Thu, 15 Jul 2021 19:19:23 +0000 (14:19 -0500)]
spl: mmc: Support OP-TEE payloads in Falcon mode

In general, Falcon mode means we're booting a linux kernel directly.
With FIT images, however, an OP-TEE secure kernel can be booted before
linux. Thus, if the next stage is an IH_OS_TEE, this isn't necessarily
a problem.

Of course, a general solution would involve mmc_load_image_raw_os()
only loading the binary, and leaving the decision of suitability to
someone else. However, a rework of the boot flow is beyond the scope
of this patch. Accept IH_OS_TEE as a valid OS value.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agoARM: dts: stm32: Fix AV96 eMMC pinmux
Marek Vasut [Tue, 20 Jul 2021 21:46:07 +0000 (23:46 +0200)]
ARM: dts: stm32: Fix AV96 eMMC pinmux

Commit 500327e2ea7 ("ARM: dts: stm32mp1: DT alignment with Linux kernel v5.8-rc1")
renamed sdmmc2_d47_pins_b phandle to sdmmc2_d47_pins_c, but without updating
the AV96 DT which uses that phandle. Linux missed similar update as well and
it was only added in commit 1ad6e36ec266 ("ARM: dts: stm32: Fix sdmmc2 pins
on AV96") .

Update the AV96 DT pinmux phandle, otherwise eMMC 8bit mode does not work
and access to eMMC takes a very long time to fall back to 4bit mode.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agoclk: stm32mp1: add support of missing SPI clocks
Patrick Delaunay [Fri, 9 Jul 2021 12:24:34 +0000 (14:24 +0200)]
clk: stm32mp1: add support of missing SPI clocks

Add the missing SPI clock even if these instances are not available
on STMicroelectronics boards: SPI2_K, SPI3_K, SPI4_K, SPI6_K.

With this patch, the SPI2 / SPI3 / SPI4 / SPI6 instances can be used on
customer design without the clock driver error:
  stm32mp1_clk_get_id: clk id 131 not found

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agostm32mp1: add pull-up for gpio button PA13 and PA14
Patrick Delaunay [Fri, 9 Jul 2021 07:53:37 +0000 (09:53 +0200)]
stm32mp1: add pull-up for gpio button PA13 and PA14

When a push-button is released and PA13/PA14 are defined as input (high-Z)
the LED should not be active as the circuit is open but a small current
leak through PCB or push-button close the circuit and allows a small LED
bias giving erroneous level voltage.

So it is recommended to activate an internal pull-up in order to clearly
fix the voltage at PA13/PA14 when button is released and to wait
a short delay before to read the GPIO value only when the pull-up is
correctly configured.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agoarm: stm32mp1: force boot_device variable for invalid TAMP register value
Patrick Delaunay [Thu, 8 Jul 2021 08:53:56 +0000 (10:53 +0200)]
arm: stm32mp1: force boot_device variable for invalid TAMP register value

When the TAMP register 20 have an invalid value (0x0 for example after
TAMPER error) the "boot_device" U-Boot env variable have no value and
no error is displayed in U-Boot log.

The STM32MP boot command bootcmd_stm32mp failed with strange trace:
  "Boot over !"

and the next command in bootcmd_stm32mp failed with few indication:
  if test ${boot_device} = serial || test ${boot_device} = usb;
then stm32prog ${boot_device} ${boot_instance};

As it is difficult to investigate, the current patch avoids this issue:
- change the debug message to error: "unexpected boot mode" is displayed
- display trace "Boot over invalid!" in bootcmd_stm32mp
- execute "run distro_bootcmd" to try all the possible target

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agoconfigs: Resync with savedefconfig
Tom Rini [Tue, 27 Jul 2021 01:10:37 +0000 (21:10 -0400)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoPrepare v2021.10-rc1
Tom Rini [Tue, 27 Jul 2021 00:57:18 +0000 (20:57 -0400)]
Prepare v2021.10-rc1

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoMerge tag 'xilinx-for-v2021.10-rc1' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Mon, 26 Jul 2021 16:09:32 +0000 (12:09 -0400)]
Merge tag 'xilinx-for-v2021.10-rc1' of https://source.denx.de/u-boot/custodians/u-boot-microblaze

Xilinx changes for v2021.10-rc1

xilinx:
- Use default ENVL_NOWHERE configuration
- Add support for handling compressed kernels

zynqmp:
- SPL malloc size extension
- USB2.0 for zc1751 dc2
- Fix USB3.0 nodes
- Handle lpd_lsbus clock
- Cleanup macros around SYSRESET

versal:
- Remove PBSIZE macro

zynq_sdhci:
- Tap delay fixups

net:
- Add support for MRMAC

3 years agoarm64: zynqmp: Move USB3 PHY properties from DWC3 node to USB node
Manish Narani [Wed, 14 Jul 2021 12:17:19 +0000 (06:17 -0600)]
arm64: zynqmp: Move USB3 PHY properties from DWC3 node to USB node

Move the PHY properties from DWC3 node to USB node in ZynqMP DTs as here
the USB3 PHY used is PSGTR, which is connected to Xilinx USB core. This
PHY initialization should be handled from Xilinx USB core as the
prerequisite register configurations are done here only.

Signed-off-by: Manish Narani <manish.narani@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agoxilinx: Define kernel_comp_addr_r,kernel_comp_size env variables
Raju Kumar Pothuraju [Mon, 12 Jul 2021 14:49:04 +0000 (20:19 +0530)]
xilinx: Define kernel_comp_addr_r,kernel_comp_size env variables

Add kernel_comp_addr_r, kernel_comp_size env variables for zynqmp and
versal to be able to use the compressed kernel Image(.gz,.bz2,.lzma,.lzo)
using booti command.

Signed-off-by: Raju Kumar Pothuraju <raju.kumar-pothuraju@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agoarm64: versal: Drop default definitions of CONFIG_SYS_PBSIZE
Michal Simek [Wed, 14 Jul 2021 07:07:04 +0000 (09:07 +0200)]
arm64: versal: Drop default definitions of CONFIG_SYS_PBSIZE

It is default value which had been converted by commit 432e39806805
("include/configs: drop default definitions of CONFIG_SYS_PBSIZE"). That's
why also remove it.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agoarm64: zynqmp: Enable reset and poweroff via sysreset framework
Michal Simek [Tue, 13 Jul 2021 14:49:04 +0000 (16:49 +0200)]
arm64: zynqmp: Enable reset and poweroff via sysreset framework

reset and poweroff are called via hooks in psci driver which is going
around sysreset framework that's why enable sysreset drivers and do reset
and poweroff via this framework. Using this flow will allow us to call
SYSTEM_WARM_RESET based on psci 1.1 spec which can be calles with reset -w
command.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agoarm64: zynqmp: Do not define do_reset() if sysreset is enabled
Michal Simek [Tue, 13 Jul 2021 14:39:26 +0000 (16:39 +0200)]
arm64: zynqmp: Do not define do_reset() if sysreset is enabled

The SPL can also be compiled with sysreset drivers just fine, so
update the condition to cater for that option.
The same change was done by commit efa1a62ad2dd ("ARM: imx8m: Do not define
do_reset() if sysreset is enabled").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agopsci: Do not define do_poweroff() if CONFIG_SYSRESET_CMD_POWEROFF is enabled
Michal Simek [Tue, 13 Jul 2021 14:53:46 +0000 (16:53 +0200)]
psci: Do not define do_poweroff() if CONFIG_SYSRESET_CMD_POWEROFF is enabled

CONFIG_SYSRESET_CMD_POWEROFF defines do_poweroff() in sysreset-uclass.c
that's why don't define it twice when both CONFIG_SYSRESET_CMD_POWEROFF and
CONFIG_CMD_POWEROFF are enabled. CONFIG_SYSRESET_CMD_POWEROFF depends on
CONFIG_CMD_POWEROFF.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agoxilinx: versal: Enable Xilinx AXI MRMAC
Ashok Reddy Soma [Fri, 2 Jul 2021 10:40:35 +0000 (04:40 -0600)]
xilinx: versal: Enable Xilinx AXI MRMAC

Enable Xilinx AXI MRMAC for Versal platforms.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agonet: xilinx: axi_mrmac: Add MRMAC driver
Ashok Reddy Soma [Fri, 2 Jul 2021 10:40:34 +0000 (04:40 -0600)]
net: xilinx: axi_mrmac: Add MRMAC driver

Add support for xilinx multirate(MRMAC) ethernet driver.
This driver uses multichannel DMA(MCDMA) for data transfers of MRMAC.
Added support for 4 ports of MRMAC for speeds 10G and 25G.
MCDMA supports upto 16 channels but in this driver we have setup only
one channel which is enough.

Tested 10G and 25G on all 4 ports.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agonet: ethtool: Add ethernet speed macros for higher speeds
Ashok Reddy Soma [Fri, 2 Jul 2021 10:40:33 +0000 (04:40 -0600)]
net: ethtool: Add ethernet speed macros for higher speeds

Add speed macro's for higher ethernet speeds to be used in u-boot
networking drivers. Added Macros for speeds 14G, 20G, 25G, 40G, 50G,
56G, 100G and 200G inline with linux.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agoclk: zynqmp: Add support for enabling clock on lpd_lsbus
Michal Simek [Thu, 1 Jul 2021 17:01:42 +0000 (19:01 +0200)]
clk: zynqmp: Add support for enabling clock on lpd_lsbus

lpd_lsbus is clock which is used by many IPs like dmas, gems, gpio, sdhcis,
spis, ttcs, uarts, watchdog that's why make sense to also enable access to
change this clock. For this clock you already get the rate.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agoarm64: dts: zynqmp: Enable USB2.0 for zc1751-xm016-dc2
Piyush Mehta [Sat, 3 Jul 2021 05:10:30 +0000 (10:40 +0530)]
arm64: dts: zynqmp: Enable USB2.0 for zc1751-xm016-dc2

The board zynqmp-zc1751-xm016-dc2 support only USB2.0.
This patch removes USB3.0 DT configuration for DC2 board.

Signed-off-by: Piyush Mehta <piyush.mehta@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agoxilinx: Return ENVL_NOWHERE instead of ENVL_UNKNOWN
Mike Looijmans [Fri, 2 Jul 2021 08:28:36 +0000 (10:28 +0200)]
xilinx: Return ENVL_NOWHERE instead of ENVL_UNKNOWN

The system refuses to boot without any environment, so return ENVL_NOWHERE when
there's nowhere to store the environment instead of ENVL_UNKNOWN.

This fixes that the board won't boot from eMMC when CONFIG_ENV_IS_IN_FAT is not
defined, for example. Similar for other combinations.

Fixes: 1025bd098aa8 "xilinx: zynqmp: Add support for saving variables"
Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agommc: zynq_sdhci: Make variables/structure static
Michal Simek [Fri, 9 Jul 2021 11:53:44 +0000 (05:53 -0600)]
mmc: zynq_sdhci: Make variables/structure static

All these variables/structure are local and should be static.

Issues are reported by sparse:
drivers/mmc/zynq_sdhci.c:49:11: warning: symbol 'zynqmp_iclk_phases' was not declared. Should it be static?
drivers/mmc/zynq_sdhci.c:50:11: warning: symbol 'zynqmp_oclk_phases' was not declared. Should it be static?
drivers/mmc/zynq_sdhci.c:53:11: warning: symbol 'versal_iclk_phases' was not declared. Should it be static?
drivers/mmc/zynq_sdhci.c:54:11: warning: symbol 'versal_oclk_phases' was not declared. Should it be static?
drivers/mmc/zynq_sdhci.c:546:24: warning: symbol 'arasan_ops' was not declared. Should it be static?

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agommc: zynq_sdhci: Fix kernel doc warnings
Michal Simek [Fri, 9 Jul 2021 11:53:43 +0000 (05:53 -0600)]
mmc: zynq_sdhci: Fix kernel doc warnings

Fix these kernel doc warnings:
drivers/mmc/zynq_sdhci.c:181: warning: contents before sections
drivers/mmc/zynq_sdhci.c:236: warning: contents before sections
drivers/mmc/zynq_sdhci.c:291: warning: contents before sections
drivers/mmc/zynq_sdhci.c:297: warning: Function parameter or member 'degrees' not described in                   'sdhci_versal_sdcardclk_set_phase'
drivers/mmc/zynq_sdhci.c:354: warning: contents before sections
drivers/mmc/zynq_sdhci.c:360: warning: Function parameter or member 'degrees' not described in                   'sdhci_versal_sampleclk_set_phase'
drivers/mmc/zynq_sdhci.c:467: warning: contents before sections

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agommc: zynq_sdhci: Split set_tapdelay function to in and out
Ashok Reddy Soma [Fri, 9 Jul 2021 11:53:42 +0000 (05:53 -0600)]
mmc: zynq_sdhci: Split set_tapdelay function to in and out

Split arasan_zynqmp_set_tapdelay() to handle input and output tapdelays
separately. This is required to handle zero values for ITAP and OTAP
values. If we dont split, we will have to remove the if() in the
function, which makes ITAP values to be overwritten when OTAP values are
called to set and vice-versa.

Restrict tap_delay value calculated to max allowed 8 bits for ITAP and 6
bits for OTAP for ZynqMP.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agommc: zynq_sdhci: Use Mask writes for Tap delays
Ashok Reddy Soma [Fri, 9 Jul 2021 11:53:41 +0000 (05:53 -0600)]
mmc: zynq_sdhci: Use Mask writes for Tap delays

Restrict tap_delay value to the allowed size(8bits for itap and 6 bits
for otap) before writing to the tap delay register.

Clear ITAP and OTAP delay bits before updating with the new tap value
for Versal platform.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agommc: zynq_sdhci: Allow configuring zero Tap values
Ashok Reddy Soma [Fri, 9 Jul 2021 11:53:40 +0000 (05:53 -0600)]
mmc: zynq_sdhci: Allow configuring zero Tap values

Allow configuring ITAP and OTAP values with zero to avoid failures in
some cases (one of them is SD boot mode). Legacy, SDR12 modes require
to program the ITAP and OTAP values as zero, whereas for SDR50 and SDR104
modes ITAP value is zero.

In SD boot mode firmware configures the SD ITAP and OTAP values and
in this case u-boot has to re-configure required tap values(including zero)
based on the operating mode.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agommc: zynq_sdhci: Resolve uninitialized return value
Ashok Reddy Soma [Fri, 9 Jul 2021 11:53:39 +0000 (05:53 -0600)]
mmc: zynq_sdhci: Resolve uninitialized return value

set_phase() functions are not modifying the ret value and returning
the same uninitialized ret, return 0 instead.

Keep the return type as int to return errors when the tapdelay's are
set via xilinx_pm_request() in future.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agoxilinx: zynqmp: increase CONFIG_SYS_SPL_MALLOC_SIZE to 16MB
Ricardo Salveti [Tue, 6 Jul 2021 23:43:01 +0000 (20:43 -0300)]
xilinx: zynqmp: increase CONFIG_SYS_SPL_MALLOC_SIZE to 16MB

commit 03f1f78a9b44 ("spl: fit: Prefer a malloc()'d buffer for loading
images")' changed the way buffer allocation worked for SPL to a more
flexible method.

For xilinx zynqmp the 1MB buffer is not necessarily enough when dealing
with complex fit images (e.g. containing FPGA/TF-A/OP-TEE/U-Boot
proper), which can easily reach up to 10MB, so increase the default
CONFIG_SYS_SPL_MALLOC_SIZE size to 16MB to cover more advanced
scenarios.

Signed-off-by: Ricardo Salveti <ricardo@foundries.io>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agoMerge tag 'efi-2021-10-rc1-3' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sat, 24 Jul 2021 20:41:25 +0000 (16:41 -0400)]
Merge tag 'efi-2021-10-rc1-3' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2021-10-rc1-3

Documentation:
provide Makefile documentation

SMBIOS:
generate BIOS release date based on UEFI version
improve error handling in SMBIOS table generation

UEFI:
correct handling of signed capsule if authentication if off

3 years agoMerge branch '2021-07-24-arm-and-platform-updates'
Tom Rini [Sat, 24 Jul 2021 20:38:09 +0000 (16:38 -0400)]
Merge branch '2021-07-24-arm-and-platform-updates'

- dragonboard410c, synquacer, aspeed fixes / updates
- pl011 serial driver fixes
- Two generic arm bugfixes

3 years agoserial: pl011: Enable DEBUG_UART_PL011 in SPL
Chen Baozi [Wed, 21 Jul 2021 06:11:26 +0000 (14:11 +0800)]
serial: pl011: Enable DEBUG_UART_PL011 in SPL

Commit b81406db51a6 ("arm: serial: Add debug UART capability to the
pl01x driver") add supports to use pl01x as a debug UART. However,
due to CONFIG_IS_ENABLED macro requires CONFIG_SPL_* prefix, the
_debug_uart_init() would not choose TYPE_PL011 in SPL build. This
patch fixes the bug by judging CONFIG_DEBUG_UART_PL011 explicitly.

Signed-off-by: Chen Baozi <chenbaozi@phytium.com.cn>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoreset: ast2600: Fix missing reference operator
Chia-Wei Wang [Tue, 20 Jul 2021 07:01:36 +0000 (15:01 +0800)]
reset: ast2600: Fix missing reference operator

Fix missing reference operator '&' to correctly get
HW register addresses for writel().

Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
3 years agoMAINTAINERS: correct the path of UEFI docs
AKASHI Takahiro [Tue, 20 Jul 2021 07:09:46 +0000 (16:09 +0900)]
MAINTAINERS: correct the path of UEFI docs

Change the path from doc/uefi to doc/develop/uefi.

Fixes: commit d1ceeeff6c2e ("doc: Move UEFI under develop/")
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agotest/py: efi_capsule: align with efidebug syntax changes
AKASHI Takahiro [Tue, 20 Jul 2021 05:57:56 +0000 (14:57 +0900)]
test/py: efi_capsule: align with efidebug syntax changes

After the commit c70f44817d46 ("efi_loader: simplify 'printenv -e'"),
"-all" option is no longer necessary.
Just remove them in the test script.

Fixes: c70f44817d46 ("efi_loader: simplify 'printenv -e'")
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: remove asm/setjmp.h from efi_api.h
AKASHI Takahiro [Tue, 20 Jul 2021 05:57:02 +0000 (14:57 +0900)]
efi_loader: remove asm/setjmp.h from efi_api.h

In the commit c982874e930d ("efi_loader: refactor
efi_setup_loaded_image()"), setjmp-related definitions were moved to
efi_loaded_image_obj in efi_loader.h. So setjmp.h is no longer
refererenced in efi_api.h.

This also fixes some error when efi_api.h will be included in
mkeficapsule.c.

Fixes: c982874e930d ("efi_loader: refactor efi_setup_loaded_image()")
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: capsule: remove authentication data
AKASHI Takahiro [Tue, 20 Jul 2021 05:52:05 +0000 (14:52 +0900)]
efi_loader: capsule: remove authentication data

If capsule authentication is disabled and yet a capsule file is signed,
its signature must be removed from image data to flush.
Otherwise, the firmware will be corrupted after update.

Fixes: 04be98bd6bcf ("efi: capsule: Add support for uefi capsule
authentication")
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>