platform/kernel/u-boot.git
3 years agoMerge tag 'v2021.01-rc5' into next
Tom Rini [Tue, 5 Jan 2021 21:20:26 +0000 (16:20 -0500)]
Merge tag 'v2021.01-rc5' into next

Prepare v2021.01-rc5

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoPrepare v2021.01-rc5
Tom Rini [Tue, 5 Jan 2021 12:30:39 +0000 (07:30 -0500)]
Prepare v2021.01-rc5

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoMerge branch '2021-01-04-minor-fixes'
Tom Rini [Mon, 4 Jan 2021 14:11:35 +0000 (09:11 -0500)]
Merge branch '2021-01-04-minor-fixes'

- Assorted fixes

3 years agocosmetic: fix typo in drivers/usb/Kconfig
Marc Ferland [Wed, 23 Dec 2020 15:13:22 +0000 (10:13 -0500)]
cosmetic: fix typo in drivers/usb/Kconfig

This commit fixes a simple typo: sPL --> SPL.

Signed-off-by: Marc Ferland <ferlandm@amotus.ca>
3 years agocmd: ubi: don't allow to rename a volume to a name that already exist
Philippe Reynes [Wed, 23 Dec 2020 14:33:07 +0000 (15:33 +0100)]
cmd: ubi: don't allow to rename a volume to a name that already exist

This commits add a check on the command ubi rename. This check avoids
to rename a volume to with a name that is already used on another ubi
volume. If two volumes has the same name, then the ubi device can't be
mounted anymore.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
3 years agomailmap: Update mail address for Igor Opaniuk
Igor Opaniuk [Wed, 30 Dec 2020 17:25:47 +0000 (19:25 +0200)]
mailmap: Update mail address for Igor Opaniuk

My address at Toradex doesn't exist anymore, map this address
to my personal email.

Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agodoc: android/boot-image: invalid C declaration
Heinrich Schuchardt [Wed, 30 Dec 2020 16:55:22 +0000 (17:55 +0100)]
doc: android/boot-image: invalid C declaration

make htmldocs results in an error:

doc/android/boot-image.rst:33:
WARNING: Unparseable C cross-reference: 'struct andr_img_hdr'
Invalid C declaration: Expected identifier in nested name, got keyword:
struct [error at 6]

Follow the style prescribed in
https://www.kernel.org/doc/html/latest/doc-guide/kernel-doc.html#highlights-and-cross-references

Add missing definite article.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agonvme: Use only 32-bit accesses in nvme_writeq/nvme_readq
Stefan Agner [Wed, 30 Dec 2020 12:16:36 +0000 (13:16 +0100)]
nvme: Use only 32-bit accesses in nvme_writeq/nvme_readq

There might be hardware configurations where 64-bit data accesses
to NVMe registers are not supported properly.  This patch removes
the readq/writeq so always two 32-bit accesses are used to read/write
64-bit NVMe registers, similarly as it is done in Linux kernel.

This patch fixes operation of NVMe devices on RPi4 Broadcom BCM2711 SoC
based board, where the PCIe Root Complex, which is attached to the
system through the SCB bridge.

Even though the architecture is 64-bit the PCIe BAR is 32-bit and likely
the 64-bit wide register accesses initiated by the CPU are not properly
translated to a sequence of 32-bit PCIe accesses.
nvme_readq(), for example, always returns same value in upper and lower
32-bits, e.g. 0x3c033fff3c033fff which lead to NVMe devices to fail
probing.

This fix is analogous to commit 8e2ab05000ab ("usb: xhci: Use only
32-bit accesses in xhci_writeq/xhci_readq").

Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Cc: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
3 years agoMerge tag 'efi-next' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi into...
Tom Rini [Fri, 1 Jan 2021 03:28:09 +0000 (22:28 -0500)]
Merge tag 'efi-next' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi into next

Pull request for UEFI sub-system for next

* UEFI capsule authentication
* UEFI capsule update on QEMU ARM
* fsuuid command for FAT file system
* bug fixes

3 years agoqemu: arm64: Add documentation for capsule update
Sughosh Ganu [Wed, 30 Dec 2020 13:57:12 +0000 (19:27 +0530)]
qemu: arm64: Add documentation for capsule update

Add documentation highlighting the steps for using the uefi capsule
update feature for updating the u-boot firmware image.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
3 years agoefidebug: capsule: Add a command to update capsule on disk
Sughosh Ganu [Wed, 30 Dec 2020 13:57:11 +0000 (19:27 +0530)]
efidebug: capsule: Add a command to update capsule on disk

Add a efidebug subcommand to initiate a firmware update using the efi
firmware management protocol(fmp) set_image routine.

The firmware update can be initiated through

'efidebug capsule disk-update'

This would locate the efi capsule file on the efi system partition,
and call the platform's set_image fmp routine to initiate the firmware
update.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
3 years agoefi_loader: Enable uefi capsule authentication
Sughosh Ganu [Wed, 30 Dec 2020 13:57:10 +0000 (19:27 +0530)]
efi_loader: Enable uefi capsule authentication

Add support for enabling uefi capsule authentication. This feature is
enabled by setting the environment variable
"capsule_authentication_enabled".

The following configs are needed for enabling uefi capsule update and
capsule authentication features on the platform.

CONFIG_EFI_HAVE_CAPSULE_SUPPORT=y
CONFIG_EFI_CAPSULE_ON_DISK=y
CONFIG_EFI_CAPSULE_FIRMWARE_MANAGEMENT=y
CONFIG_EFI_CAPSULE_FIRMWARE=y
CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
CONFIG_EFI_CAPSULE_AUTHENTICATE=y

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
3 years agoefi: capsule: Add support for uefi capsule authentication
Sughosh Ganu [Wed, 30 Dec 2020 13:57:09 +0000 (19:27 +0530)]
efi: capsule: Add support for uefi capsule authentication

Add support for authenticating uefi capsules. Most of the signature
verification functionality is shared with the uefi secure boot
feature.

The root certificate containing the public key used for the signature
verification is stored as part of the device tree blob. The root
certificate is stored as an efi signature list(esl) file -- this file
contains the x509 certificate which is the root certificate.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
3 years agoefi_loader: Re-factor code to build the signature store from efi signature list
Sughosh Ganu [Wed, 30 Dec 2020 13:57:08 +0000 (19:27 +0530)]
efi_loader: Re-factor code to build the signature store from efi signature list

The efi_sigstore_parse_sigdb function reads the uefi authenticated
variable, stored in the signature database format and builds the
signature store structure. Factor out the code for building
the signature store. This can then be used by the capsule
authentication routine to build the signature store even when the
signature database is not stored as an uefi authenticated variable

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
3 years agoefi_loader: Make the pkcs7 header parsing function an extern
Sughosh Ganu [Wed, 30 Dec 2020 13:57:07 +0000 (19:27 +0530)]
efi_loader: Make the pkcs7 header parsing function an extern

The pkcs7 header parsing functionality is pretty generic, and can be
used by other features like capsule authentication. Make the function
an extern, also changing it's name to efi_parse_pkcs7_header

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
3 years agodfu_mtd: Add provision to unlock mtd device
Sughosh Ganu [Wed, 30 Dec 2020 13:57:06 +0000 (19:27 +0530)]
dfu_mtd: Add provision to unlock mtd device

Prior to writing to an mtd device, mtd_erase is called. This call
fails in case the sector being erased is locked. Call mtd_unlock to
unlock the region which is to be erased and later written to. Lock the
region once the write to the region has completed.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
3 years agoefi_loader: Add logic to parse EDKII specific fmp payload header
Sughosh Ganu [Wed, 30 Dec 2020 13:57:05 +0000 (19:27 +0530)]
efi_loader: Add logic to parse EDKII specific fmp payload header

When building the capsule using scripts in edk2, a fmp header is
added on top of the binary payload. Add logic to detect presence of
the header. When present, the pointer to the image needs to be
adjusted as per the size of the header to point to the actual binary
payload.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
3 years agofsp: Move and rename fsp_types.h file
Sughosh Ganu [Wed, 30 Dec 2020 13:57:04 +0000 (19:27 +0530)]
fsp: Move and rename fsp_types.h file

The fsp_types.h header file contains macros for building signatures of
different widths. These signature macros are architecture agnostic,
and can be used in all places which use signatures in a data
structure. Move and rename the fsp_types.h under the common include
header.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
3 years agoqemu: common: Set dfu_alt_info variable for the platform
Sughosh Ganu [Wed, 30 Dec 2020 13:57:03 +0000 (19:27 +0530)]
qemu: common: Set dfu_alt_info variable for the platform

The dfu framework uses the dfu_alt_info environment variable to get
information that is needed for performing the firmware update. Add
logic to set the dfu_alt_info for the qemu arm64 platform to reflect
the two mtd partitions created for the u-boot env and the firmware
image. This can be subsequently extended for other qemu architectures
which need this variable set.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
3 years agoqemu: common: Add support for dynamic mtdparts for the platform
Sughosh Ganu [Wed, 30 Dec 2020 13:57:02 +0000 (19:27 +0530)]
qemu: common: Add support for dynamic mtdparts for the platform

Add support for setting the default values for mtd partitions on the
platform. This would be used for updating the firmware image using
uefi capsule update with the dfu mtd backend driver.

Currently, values have been defined for the qemu arm64 platform, with
default values defined for the mtd partitions based on the NOR
flash. This can be subsequently extended for other qemu architectures
which need mtdparts set.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
3 years agocrypto: Fix the logic to calculate hash with authattributes set
Sughosh Ganu [Wed, 30 Dec 2020 13:57:01 +0000 (19:27 +0530)]
crypto: Fix the logic to calculate hash with authattributes set

RFC 2315 Section 9.3 describes the message digesting process. The
digest calculated depends on whether the authenticated attributes are
present. In case of a scenario where the authenticated attributes are
present, the message digest that gets signed and is part of the pkcs7
message is computed from the auth attributes rather than the contents
field.

Check if the auth attributes are present, and if set, use the auth
attributes to compute the hash that would be compared with the
encrypted hash on the pkcs7 message.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
3 years agoqemu: arm: Initialise virtio devices in board_late_init
Sughosh Ganu [Wed, 30 Dec 2020 13:57:00 +0000 (19:27 +0530)]
qemu: arm: Initialise virtio devices in board_late_init

On the qemu arm platform, the virtio devices are initialised in the
board_init function, which gets called before the initr_pci. With
this sequence, the virtio block devices on the pci bus are not
initialised. Move the initialisation of the virtio devices to
board_late_init which gets called after the call to initr_pci.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
3 years agomkeficapsule: Add support for embedding public key in a dtb
Sughosh Ganu [Wed, 30 Dec 2020 13:56:59 +0000 (19:26 +0530)]
mkeficapsule: Add support for embedding public key in a dtb

Add options for embedding the public key esl(efi signature list) file
to the platform's dtb. The esl file is then retrieved and used for
authenticating the capsule to be used for updating firmare components
on the platform.

The esl file can now be embedded in the dtb by invoking the following
command
mkeficapsule -K <pub_key.esl> -D <dtb>

In the scenario where the esl file is to be embedded in an overlay,
this can be done through the following command
mkeficapsule -O -K <pub_key.esl> -D <dtb>

This will create a node named 'signature' in the dtb, and the esl file
will be stored as 'capsule-key'

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
3 years agoefi_loader: event queueing
Heinrich Schuchardt [Sun, 27 Dec 2020 23:25:34 +0000 (00:25 +0100)]
efi_loader: event queueing

When a new event is queued we have to process the event queue by calling
efi_process_event_queue(). But there is not reason to call the function
when the event is not queueable.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: Add size checks to efi_create_indexed_name()
Ilias Apalodimas [Thu, 31 Dec 2020 10:26:46 +0000 (12:26 +0200)]
efi_loader: Add size checks to efi_create_indexed_name()

Although the function description states the caller must provide a
sufficient buffer, it's better to have in function checks that the
destination buffer can hold the intended value.

So let's add an extra argument with the buffer size and check that
before doing any copying.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: Remove unconditional installation of file2 protocol for initrd
Ilias Apalodimas [Wed, 30 Dec 2020 15:07:14 +0000 (17:07 +0200)]
efi_loader: Remove unconditional installation of file2 protocol for initrd

Up to now we install the EFI_LOAD_FILE2_PROTOCOL to load an initrd
unconditionally. Although we correctly return various EFI exit codes
depending on the file status (i.e EFI_NO_MEDIA, EFI_NOT_FOUND etc), the
kernel loader only falls back to the cmdline interpreted initrd if the
protocol is not installed.

This creates a problem for EFI installers, since they won't be able to
load their own initrd and start the installation.

A following patch introduces a different logic where we search for an
initrd path defined in an EFI variable named 'Initrd####'.
If the bootmgr is used to launch the EFI payload, we'll will try to match
the BootCurrent value and find the corresponding initrd
(i.e Boot0000 -> Initrd0000 etc). If the file is found, we'll install
the required protocol which the kernel's efi-stub can use and load our
initrd.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: Remove unused headers from efi_load_initrd.c
Ilias Apalodimas [Thu, 31 Dec 2020 10:33:23 +0000 (12:33 +0200)]
efi_loader: Remove unused headers from efi_load_initrd.c

dm.h and env.h serve no purpose here. Remove them and sort the
remaining in alphabetical order.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: use after free in efi_exit()
Heinrich Schuchardt [Mon, 28 Dec 2020 22:24:40 +0000 (23:24 +0100)]
efi_loader: use after free in efi_exit()

Do not use data from the loaded image object after deleting it.

Fixes: 126a43f15b36 ("efi_loader: unload applications upon Exit()")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: describe struct efi_loaded_image_obj
Heinrich Schuchardt [Mon, 28 Dec 2020 21:42:51 +0000 (22:42 +0100)]
efi_loader: describe struct efi_loaded_image_obj

Add the missing description of some fields of struct efi_loaded_image_obj.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: efi_signal_event() fix comment typos
Heinrich Schuchardt [Sun, 27 Dec 2020 23:59:09 +0000 (00:59 +0100)]
efi_loader: efi_signal_event() fix comment typos

Add missing commas.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: avoid invalid free
Heinrich Schuchardt [Sun, 27 Dec 2020 14:46:00 +0000 (15:46 +0100)]
efi_loader: avoid invalid free

load_options passed from do_efibootmgr() to do_bootefi_exec() may contain
invalid data from the stack which will lead to an invalid free().

Fixes: 0ad64007feb9 ("efi_loader: set load options in boot manager")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: escape key handling
Heinrich Schuchardt [Sun, 27 Dec 2020 13:47:50 +0000 (14:47 +0100)]
efi_loader: escape key handling

Up to now the escape key was not correctly detected in UEFI applications.
We had to hit it twice for a single escape to be recognized.

Use a 10 ms delay to detect if we are dealing with the escape key or an
escape sequence.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: missing parentheses after if
Heinrich Schuchardt [Sun, 27 Dec 2020 14:33:09 +0000 (15:33 +0100)]
efi_loader: missing parentheses after if

IS_ENABLED() contains parentheses. But we should still put extra
parentheses around it in an if statement for readability.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agofs/fat: implement fsuuid command
Heinrich Schuchardt [Wed, 30 Dec 2020 23:38:13 +0000 (00:38 +0100)]
fs/fat: implement fsuuid command

The FAT file system does not have a UUID but a 4 byte volume ID.
Let the fsuuid command show it in XXXX-XXXX format.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agofs: fat: eliminate DIRENTSPERBLOCK() macro
Heinrich Schuchardt [Fri, 25 Dec 2020 13:30:04 +0000 (14:30 +0100)]
fs: fat: eliminate DIRENTSPERBLOCK() macro

The FAT filesystem implementation uses several marcros referring to a magic
variable name mydata which renders the code less readable. Eliminate one of
them which is only used for a debug() statement.

Use log_debug() instead of debug().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoefi_loader: Extra checks while opening an OPTEE session
Ilias Apalodimas [Wed, 23 Dec 2020 11:25:00 +0000 (13:25 +0200)]
efi_loader: Extra checks while opening an OPTEE session

When opening an OP-TEE session we need to check the internal return
value of OP-TEE call arguments as well the return code of the
function itself.
The code was also ignoring to close the OP-TEE session in case the
shared memory registration failed.

Fixes: f042e47e8fb43 ("efi_loader: Implement EFI variable handling via OP-TEE")
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: make variable store size customizable
Heinrich Schuchardt [Sun, 20 Dec 2020 10:05:38 +0000 (11:05 +0100)]
efi_loader: make variable store size customizable

Currently the size of the buffer to keep UEFI variables in memory is fixed
at 16384 bytes. This size has proven to be too small for some use cases.

Make the size of the memory buffer for UEFI variables customizable.

Reported-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 years agoMerge tag 'efi-2021-01-rc5-2' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Tue, 29 Dec 2020 15:23:58 +0000 (10:23 -0500)]
Merge tag 'efi-2021-01-rc5-2' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi

Pull request for UEFI sub-system for efi-2021-01-rc5 (2)

The following errors in the UEFI sub-system are fixed:

* use after free in efi_exit()
* invalid free when using the boot manager
* pressing escape key once not recognized

3 years agoefi_loader: use after free in efi_exit()
Heinrich Schuchardt [Mon, 28 Dec 2020 22:24:40 +0000 (23:24 +0100)]
efi_loader: use after free in efi_exit()

Do not use data from the loaded image object after deleting it.

Fixes: 126a43f15b36 ("efi_loader: unload applications upon Exit()")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: describe struct efi_loaded_image_obj
Heinrich Schuchardt [Mon, 28 Dec 2020 21:42:51 +0000 (22:42 +0100)]
efi_loader: describe struct efi_loaded_image_obj

Add the missing description of some fields of struct efi_loaded_image_obj.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: efi_signal_event() fix comment typos
Heinrich Schuchardt [Sun, 27 Dec 2020 23:59:09 +0000 (00:59 +0100)]
efi_loader: efi_signal_event() fix comment typos

Add missing commas.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: avoid invalid free
Heinrich Schuchardt [Sun, 27 Dec 2020 14:46:00 +0000 (15:46 +0100)]
efi_loader: avoid invalid free

load_options passed from do_efibootmgr() to do_bootefi_exec() may contain
invalid data from the stack which will lead to an invalid free().

Fixes: 0ad64007feb9 ("efi_loader: set load options in boot manager")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: escape key handling
Heinrich Schuchardt [Sun, 27 Dec 2020 13:47:50 +0000 (14:47 +0100)]
efi_loader: escape key handling

Up to now the escape key was not correctly detected in UEFI applications.
We had to hit it twice for a single escape to be recognized.

Use a 10 ms delay to detect if we are dealing with the escape key or an
escape sequence.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: missing parentheses after if
Heinrich Schuchardt [Sun, 27 Dec 2020 14:33:09 +0000 (15:33 +0100)]
efi_loader: missing parentheses after if

IS_ENABLED() contains parentheses. But we should still put extra
parentheses around it in an if statement for readability.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoMerge tag 'u-boot-imx-20201227' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
Tom Rini [Mon, 28 Dec 2020 12:44:03 +0000 (07:44 -0500)]
Merge tag 'u-boot-imx-20201227' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

Fixes for 2021.1
----------------

CI: https://gitlab.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/5680

- fixes for Variscite dart6ul
- imx8mp : increase malloc area
- fixes for bx50v3
- imx8m: HS400ES and UHS for EVK
- imx8qm-rom7720: fix phy bind

3 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Mon, 28 Dec 2020 12:43:28 +0000 (07:43 -0500)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell

- Fix "Assert PERST# signal when unloading driver" in a37xx PCI
  driver (Pali)
- Fix SPL on armada-xp-gp (add u-boot,dm-pre-reloc and alias) (myself)

3 years agoRevert "arm64: a37xx: pci: Assert PERST# signal when unloading driver"
Pali Rohár [Wed, 23 Dec 2020 15:07:08 +0000 (16:07 +0100)]
Revert "arm64: a37xx: pci: Assert PERST# signal when unloading driver"

This reverts commit 828d32621686aec593076d16445d39b9b8d49c05.

This change revers code which asserting PERST# signal when unloading
driver. Driver's remove callback is still there as it is used for other
functionality.

Asserting PERST# signal prior booting kernel is causing that A3720 boards
(Turris MOX and Espressobin) with stable Linux kernel versions 4.14 and
4.19 are not able to detect some PCIe cards (e.g. Compex WLE200 and WLE900)
and anymore. When PERST# signal is not asserted these cards are detected
correctly. As this is regression for existing stable Linux kernel versions
revert this problematic change in U-Boot.

To make cards working with OpenWRT 4.14 kernel it is needed to disable link
training prior booting kernel, which is already done in driver's remove
callback.

Described issue is in Linux kernel pci aardvark driver which is (hopefully)
fixed in latest upstream versions. Latest upstream versions should be able
to initialize PCIe bus and detects cards independently of the link training
and PERST# signal state.

So with this change, U-Boot on A3720 boards should be able to boot OpenWRT
4.14 kernel, stable 4.14 and 4.19 kernels and also latest mainline kernels.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: mvebu: armada-xp-gp.dts: Add spi0 alias
Stefan Roese [Fri, 11 Dec 2020 04:47:40 +0000 (05:47 +0100)]
arm: mvebu: armada-xp-gp.dts: Add spi0 alias

For correct spi bus detection the spi0 alias is needed in the DT.
Otherwise this error will ocurr in U-Boot:

Invalid bus 0 (err=-19)
Failed to initialize SPI flash at 0:0 (error -19)

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Dennis Gilmore <dgilmore@redhat.com>
Tested-by: Dennis Gilmore <dgilmore@redhat.com>
3 years agoarm: mvebu: Add armada-xp-gp-u-boot.dtsi for U-Boot properties
Stefan Roese [Thu, 10 Dec 2020 05:40:10 +0000 (06:40 +0100)]
arm: mvebu: Add armada-xp-gp-u-boot.dtsi for U-Boot properties

Add some missing "u-boot,dm-pre-reloc;" properties to UART0, SPI
controller and SPI NOR flash node to enable usage in SPL. Otherwise
these devices will not be available.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Dennis Gilmore <dgilmore@redhat.com>
Tested-by: Dennis Gilmore <dgilmore@redhat.com>
3 years agoi2c: mxc_i2c: improve error message readability
Marc Ferland [Mon, 21 Dec 2020 14:50:16 +0000 (09:50 -0500)]
i2c: mxc_i2c: improve error message readability

Use 0x%2lx to print the i2c bus base address in hexadecimal format
instead of printing as an integer.

Signed-off-by: Marc Ferland <ferlandm@amotus.ca>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
3 years agoimx: mx7: clock: use correct format strings
Heinrich Schuchardt [Fri, 25 Dec 2020 15:22:27 +0000 (16:22 +0100)]
imx: mx7: clock: use correct format strings

Use %u and not %d for unsigned values.
Print kHz and not khz.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
3 years agoarm: dart6ul: read and print SoM info from eeprom on startup
Marc Ferland [Tue, 22 Dec 2020 19:24:12 +0000 (14:24 -0500)]
arm: dart6ul: read and print SoM info from eeprom on startup

The dart6ul has an i2c eeprom at 0x50 which contains, among other
things, the manufacturing/revision/options info of the SoM. This patch
replaces the current checkboard() implementation with a more
exhaustive one based on the content of the eeprom.

Since this code uses the new driver model, some changes were also
required in the DTS to make the nodes related to i2c available before
relocation.

This code was inspired from the supported u-boot code from Variscite
which can be found here:

https://github.com/varigit/uboot-imx/tree/imx_v2018.03_4.14.78_1.0.0_ga_var02

New output example:

Board: PN: VSM-6UL-705B, Assy: AS1812142257, Date: 2019 Feb 17
       Storage: eMMC, Wifi: yes, DDR: 1024 MiB, Rev: 2.4G

Signed-off-by: Marc Ferland <ferlandm@amotus.ca>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
3 years agoarm: dart6ul: change compatible string for eeprom
Marc Ferland [Tue, 22 Dec 2020 19:24:11 +0000 (14:24 -0500)]
arm: dart6ul: change compatible string for eeprom

The eeprom at address 0x50 is a BR24G04NUX-3TTR. It has a
4Kbit (512x8) capacity, change the compatible string to reflect this
fact.

Also, add an alias to easily refer to this eeprom with
fdt_path_offset() which will be in another commit.

Signed-off-by: Marc Ferland <ferlandm@amotus.ca>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
3 years agotoradex: hand over maintainership
Igor Opaniuk [Tue, 22 Dec 2020 15:56:46 +0000 (17:56 +0200)]
toradex: hand over maintainership

Hand over maintainership of Toradex SoMs (that I was responsible of) to
Oleksandr because of my resignation from Toradex, as such I will
have no immediate involvement with these modules and as a result not
able to continue maintaining these boards.

CC: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Acked-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
3 years agoimx8mp_evk: Increase CONFIG_SYS_MALLOC_F_LEN
Fabio Estevam [Mon, 21 Dec 2020 18:40:37 +0000 (15:40 -0300)]
imx8mp_evk: Increase CONFIG_SYS_MALLOC_F_LEN

When booting imx8mp-evk the following allocation error
message is seen:

U-Boot 2021.01-rc3-00200-ge668bec96a5f (Dec 21 2020 - 14:36:42 -0300)

alloc space exhausted

Fix it by increasing CONFIG_SYS_MALLOC_F_LEN to 0x10000 like it
is done on other i.MX8MM/8MN boards.

Reported-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
3 years agoimx: ahab: allow to bypass confirmation for ahab_close cmd
Clément Péron [Mon, 21 Dec 2020 17:31:28 +0000 (18:31 +0100)]
imx: ahab: allow to bypass confirmation for ahab_close cmd

Calling ahab_close cmd force the user to interact for confirmation.

This is not user-friendly when using this cmd during factory process.

Allow the user to pass '-y' option to bypass this confirmation.

Signed-off-by: Clément Péron <peron.clem@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Oliver Graute <oliver.graute@kococonnector.com>
3 years agoboard: ge: bx50v3: cleanup phy config
Sebastian Reichel [Mon, 14 Dec 2020 23:41:57 +0000 (00:41 +0100)]
board: ge: bx50v3: cleanup phy config

The current PHY rework does the following things:

1. Configure 125MHz clock
2. Setup the TX clock delay (RX is enabled by default),
3. Setup reserved bits to avoid voltage peak

The clock delays are nowadays already configured by the
PHY driver (in ar803x_delay_config). The code for that
can simply be dropped. The clock speed can also be
configured by the PHY driver by adding the device tree
property "qca,clk-out-frequency".

What is left is setting up the undocumented reserved bits
to avoid the voltage peak problem. I slightly improved its
documentation while updating the board's PHY rework code.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agoboard: ge: bx50v3: remove confidx magic numbers
Sebastian Reichel [Mon, 14 Dec 2020 23:41:56 +0000 (00:41 +0100)]
board: ge: bx50v3: remove confidx magic numbers

Instead of hardcoding index magic numbers in the board code,
also rely on board_fit_config_name_match choosing the right
config for the fitImage containing the kernel.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agoMerge tag 'efi-2021-01-rc5' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sat, 26 Dec 2020 13:02:19 +0000 (08:02 -0500)]
Merge tag 'efi-2021-01-rc5' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi

Pull request for UEFI sub-system for efi-2021-01-rc5

* In the Standalone MM based implementation of UEFI variables
  check the internal OP-TEE return code

3 years agoefi_loader: Extra checks while opening an OPTEE session
Ilias Apalodimas [Wed, 23 Dec 2020 11:25:00 +0000 (13:25 +0200)]
efi_loader: Extra checks while opening an OPTEE session

When opening an OP-TEE session we need to check the internal return
value of OP-TEE call arguments as well the return code of the
function itself.
The code was also ignoring to close the OP-TEE session in case the
shared memory registration failed.

Fixes: f042e47e8fb43 ("efi_loader: Implement EFI variable handling via OP-TEE")
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agocompiler.h: add host_build()
Sebastian Reichel [Mon, 14 Dec 2020 23:41:53 +0000 (00:41 +0100)]
compiler.h: add host_build()

Add a host_build() function, so that it's possible to
check for software being build with USE_HOSTCC without
relying on preprocessor conditions. In other words

 #ifdef USE_HOSTCC
  host_only_code();
 #endif

can be written like this instead:

 if (host_build())
  host_only_code();

This improves code readability and test coverage and
compiler will eleminate this unreachable code.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agomx6sabresd: Remove unneeded checkboard()
Fabio Estevam [Mon, 14 Dec 2020 17:32:39 +0000 (14:32 -0300)]
mx6sabresd: Remove unneeded checkboard()

After the conversion to device tree the board information becomes
redundant:

Model: Freescale i.MX6 Quad Plus SABRE Smart Device Board
Board: MX6-SabreSD

Remove the printing of the board information.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
3 years agoconfigs: imx8m: enable eMMC HS400ES and SD UHS mode on EVK
Andrey Zhizhikin [Sat, 5 Dec 2020 17:29:19 +0000 (17:29 +0000)]
configs: imx8m: enable eMMC HS400ES and SD UHS mode on EVK

i.MX8M series includes support for high speed modes in uSDHC controllers.
Turn on corresponding configuration options for EVK boards, which would
enable high speed modes to be included in U-Boot.

Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
3 years agoARM: dts: imx8m: add UHS or HS400/HS400ES properties
Andrey Zhizhikin [Sat, 5 Dec 2020 17:29:18 +0000 (17:29 +0000)]
ARM: dts: imx8m: add UHS or HS400/HS400ES properties

i.MX8M series provide support for high speed grades in their
usdhc controllers, which has eMMC and SDHC connected to them.

Enable this support across the entire i.MX8M family by providing quirks
to usdhc controllers designated by storage media connected to them.

Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Ye Li <ye.li@nxp.com>
3 years agoARM: dts: imx8m: increase off-on delay on the SD Vcc regulator
Andrey Zhizhikin [Sat, 5 Dec 2020 17:29:17 +0000 (17:29 +0000)]
ARM: dts: imx8m: increase off-on delay on the SD Vcc regulator

Some SD Card controller and power circuitry has increased capacitance,
which keeps the internal logic remains powered after regulator is switch
off. This is generally the case when card is switched to SD104 mode,
where a power cycle should be performed. In case if the card internal
logic remains powered, it causes a subsequent failure of mode
transition, effectively leading to failed enumeration.

Introduce a delay of 20 msec in order to provide a possibility for
internal card circuitry to drain voltages and perform a power cycle
correctly.

Similar fix is done in commit c49d0ac38a76 ("ARM: dts: rmobile: Increase
off-on delay on the SD Vcc regulator") targeted Renesas SOCs.

Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoimx8mm_beacon: Enable HS400 on MMC controller
Adam Ford [Sat, 5 Dec 2020 00:59:43 +0000 (18:59 -0600)]
imx8mm_beacon: Enable HS400 on MMC controller

The i.MX8MM is capable of HS400.  Enable it in both
U-Boot and SPL for faster throughput.

Signed-off-by: Adam Ford <aford173@gmail.com>
3 years agoarm64: dts: imx8mm-beacon: Re-sync dts file with Linux 5.10-rc6
Adam Ford [Fri, 4 Dec 2020 23:27:47 +0000 (17:27 -0600)]
arm64: dts: imx8mm-beacon: Re-sync dts file with Linux 5.10-rc6

There have been some updates to the device trees, so re-sync.

Signed-off-by: Adam Ford <aford173@gmail.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
3 years agoarm: dts: imx8mm: sync dts from Linux Kernel 5.10-rc6
Adam Ford [Fri, 4 Dec 2020 23:27:46 +0000 (17:27 -0600)]
arm: dts: imx8mm: sync dts from Linux Kernel 5.10-rc6

There have been some updates to the device tree since 5.6.
This also includes some clocks, and makes it easier to keep
board device tree files in sync with Linux

Signed-off-by: Adam Ford <aford173@gmail.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
3 years agoimx: imx8mm: Update clock bindings header
Adam Ford [Fri, 4 Dec 2020 23:27:45 +0000 (17:27 -0600)]
imx: imx8mm: Update clock bindings header

Import clock bindings header file from Linux 5.10-rc6

Signed-off-by: Adam Ford <aford173@gmail.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
3 years agoARM: dts: imx: imx8qm-rom7720: Fix AR8031 phy-mode
Oliver Graute [Fri, 4 Dec 2020 14:26:16 +0000 (15:26 +0100)]
ARM: dts: imx: imx8qm-rom7720: Fix AR8031 phy-mode

Fixed wrong PHY Interface Mode

    As per kernel commit 0672d22a1924 ("ARM: dts: imx: Fix the AR803X phy-mode)
    the correct phy-mode should be "rgmii-id", so fix it accordingly
    to fix the Ethernet regression.

    This problem has been exposed by commit:

    commit 13114f38e2ccea9386726d8b9831dfc310589548

    Fix the phy-mode accordingly to fix the regression.

Signed-off-by: Oliver Graute <oliver.graute@kococonnector.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Vladimir Oltean <vladimir.oltean@nxp.com>
3 years agoMerge tag 'dm-next-23dec20' of git://git.denx.de/u-boot-dm into next
Tom Rini [Wed, 23 Dec 2020 23:10:15 +0000 (18:10 -0500)]
Merge tag 'dm-next-23dec20' of git://git.denx.de/u-boot-dm into next

dm: New sequence number implementation
SPI handling of bus with different-speed devices
patman supression of sign-offs

3 years agodm: core: Inline a few ofnode functions in SPL
Simon Glass [Thu, 17 Dec 2020 00:25:06 +0000 (17:25 -0700)]
dm: core: Inline a few ofnode functions in SPL

A recent change to unify the flattree/livetree code introduced a small
size increase in SPL on some boards. For example SPL code size for
px30-core-ctouch2-px30 increased by 40 bytes.

To address this we can take advantage of the fact that some of the ofnode
functions are only called a few times in SPL, so it is worth inlining
them.

Add new Kconfig options to control this. These functions are not inlined
for U-Boot proper, since this increases code size.

Fixes: 2ebea5eaebf ("dm: core: Combine the flattree and livetree binding code")
Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agobuildman: Remove output binaries before building
Simon Glass [Thu, 17 Dec 2020 00:24:17 +0000 (17:24 -0700)]
buildman: Remove output binaries before building

Buildman reuses build directories from previous builds to avoid the cost
of 'make mrproper' for every build. If the previous build produced an SPL
image but the current one does not, the SPL image will remain and buildman
will think it is a result of building the current board.

Remove these files before building, to avoid this problem.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agodm: spi: Fix spi_free_slave() freed memory write
Niel Fourie [Wed, 16 Dec 2020 11:11:52 +0000 (12:11 +0100)]
dm: spi: Fix spi_free_slave() freed memory write

Remove setting slave->dev to NULL after the device_remove() call.

The slave pointer points to dev->parent_priv, which has already
been freed by device_free(), called from device_remove() in the
preceding line. Writing to slave->dev may cause corruption of the
dlmalloc free chunk forward pointer of the previously freed chunk.

Signed-off-by: Niel Fourie <lusus@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agotest: dm: spi: Add testcase for spi_claim_bus()
Ovidiu Panait [Mon, 14 Dec 2020 17:06:51 +0000 (19:06 +0200)]
test: dm: spi: Add testcase for spi_claim_bus()

Add testcase for spi_claim_bus(), which checks that sandbox spi bus
speed/mode settings are updated correctly when multiple slaves use
the bus consecutively. The following configurations are used for the
two spi slaves involved:
  * different max_hz / different modes
  * different max_hz / same modes
  * different modes / same max_hz

asm/test.h header is added in order to be able to retrieve the current
speed/mode of the sandbox spi bus, via sandbox_spi_get_{speed, mode}.

Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agospi: spi-uclass: Fix spi_claim_bus() speed/mode setup logic
Ovidiu Panait [Mon, 14 Dec 2020 17:06:50 +0000 (19:06 +0200)]
spi: spi-uclass: Fix spi_claim_bus() speed/mode setup logic

Currently, when different spi slaves claim the bus consecutively using
spi_claim_bus(), spi_set_speed_mode() will only be executed on the first
two calls, leaving the bus in a bad state starting with the third call.

This patch drops spi_slave->speed member and adds caching of bus
speed/mode in dm_spi_bus struct. It also updates spi_claim_bus() to call
spi_set_speed_mode() if either speed or mode is different from what the
bus is currently configured for. Current behavior is to only take into
account the speed, but not the mode, which seems wrong.

Fixes: 60e2809a848 ("dm: spi: Avoid setting the speed with every transfer")
Reviewed-by: Simon Glass <sjg@chromium.org>
Reported-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reported-by: Moshe, Yaniv <yanivmo@amazon.com>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
3 years agotest: spi: Add sandbox_spi_get_{speed, mode} interface
Ovidiu Panait [Mon, 14 Dec 2020 17:06:49 +0000 (19:06 +0200)]
test: spi: Add sandbox_spi_get_{speed, mode} interface

Introduce sandbox_spi_get_{speed, mode} public interface to retrieve the
sandbox spi bus internal state. They are meant to be used in sandbox spi
testcases.

Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agospi: sandbox_spi: Implement speed/mode setup
Ovidiu Panait [Mon, 14 Dec 2020 17:06:48 +0000 (19:06 +0200)]
spi: sandbox_spi: Implement speed/mode setup

Implement sandbox_spi_set_{speed, mode} routines, to be able to keep track
of the current bus speed/mode. This will help determine whether the values
passed from dm_spi_claim_bus() are valid.

Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
3 years agosandbox: test: Add a second SPI slave on sandbox_spi bus
Ovidiu Panait [Mon, 14 Dec 2020 17:06:47 +0000 (19:06 +0200)]
sandbox: test: Add a second SPI slave on sandbox_spi bus

Place a second spi slave on the sandbox_spi bus, to be used by the
spi_claim_bus() testcase we are about to introduce. We need to make sure
that jumping between slaves calling spi_claim_bus() sets the bus speed and
mode appropriately. Use different max-hz and mode properties for this new
slave.

Also, update sandbox_spi cs_info call to allow activity on CS0/CS1 and
adapt dm_test_spi_find() testcase for this new setup.

Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agosandbox: spi: Drop unused sandbox_spi_parse_spec function
Ovidiu Panait [Mon, 14 Dec 2020 17:06:46 +0000 (19:06 +0200)]
sandbox: spi: Drop unused sandbox_spi_parse_spec function

Commit 1289e96797bf ("sandbox: spi: Drop command-line SPI option") dropped
support for specifying SPI devices on the command line, removing the only
user of sandbox_spi_parse_spec(). Remove the function too.

Fixes: 1289e96797bf ("sandbox: spi: Drop command-line SPI option")
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agosandbox: implement invalidate_icache_all()
Heinrich Schuchardt [Wed, 9 Dec 2020 18:42:44 +0000 (19:42 +0100)]
sandbox: implement invalidate_icache_all()

Before executing code that we have loaded from a file we need to flush the
data cache and invalidate the instruction flash.

Implement functions flush_cache() and invalidate_icache_all().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agofdt: Use phandle to distinguish DT nodes with same name
Aswath Govindraju [Thu, 3 Dec 2020 05:25:45 +0000 (10:55 +0530)]
fdt: Use phandle to distinguish DT nodes with same name

While assigning the sequence number to subsystem instances by reading the
aliases property, only DT nodes names are compared and not the complete
path. This causes a problem when there are two DT nodes with same name but
have different paths.

In arch/arm/dts/k3-am65-main.dtsi there are two USB controllers with the
same device tree node name but different path. When aliases are defined for
these USB controllers then fdtdec_get_alias_seq() fails to pick the correct
instance for a given index.

fdt_path_offset() function is slow and this would effect the U-Boot
startup. To avert the time penalty on all boards, apply this extra check
only when required by using a config option.

Fix it by comparing the phandles of DT nodes after the node names match,
under a config option.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Fix whitespace error in Kconfig:
Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agoCommon:fdt: Check for error return value
Hongwei Zhang [Wed, 2 Dec 2020 19:47:03 +0000 (14:47 -0500)]
Common:fdt: Check for error return value

Check for negative return value of fdt_noffset from calling
boot_get_fdt_fit().

Signed-off-by: Hongwei Zhang <hongweiz@ami.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agosandbox: implement runtime system reset
Heinrich Schuchardt [Wed, 2 Dec 2020 15:22:11 +0000 (16:22 +0100)]
sandbox: implement runtime system reset

Implement a reset function that we can call after ExitBootServices(),
when all driver model devices are gone.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoconfigs: sandbox: activate DEBUG_UART
Patrick Delaunay [Fri, 27 Nov 2020 10:49:29 +0000 (11:49 +0100)]
configs: sandbox: activate DEBUG_UART

Add CONFIG_DEBUG_UART=y for all sandbox defconfig
as it is already done in sandbox_defconfig.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agopatman: Add project-default for 'gcc'
Philipp Tomsich [Tue, 24 Nov 2020 17:14:53 +0000 (18:14 +0100)]
patman: Add project-default for 'gcc'

Add defaults for FSF/GNU projects, such as gcc, that provide sensible
settings for those projects.

Signed-off-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agopatman: Add --no-signoff to suppress adding signoffs
Philipp Tomsich [Tue, 24 Nov 2020 17:14:52 +0000 (18:14 +0100)]
patman: Add --no-signoff to suppress adding signoffs

To enable use of patman with FSF/GNU projects, such as GCC or
Binutils, no Signed-off-by may be added.  This adds a command
line flag '--no-signoff' to suppress adding signoffs in patman
when processing commits.

Signed-off-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Reviewed-by: Simon Glass <sjg@chromium.org>
Fix patman testBranch() test:
Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-x86
Tom Rini [Tue, 22 Dec 2020 13:18:21 +0000 (08:18 -0500)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-x86

- Update Intel Edison doc information about xFSTK
- Move and rename fsp_types.h file to signatures.h

3 years agofsp: Move and rename fsp_types.h file
Sughosh Ganu [Mon, 14 Dec 2020 06:22:44 +0000 (11:52 +0530)]
fsp: Move and rename fsp_types.h file

The fsp_types.h header file contains macros for building signatures of
different widths. These signature macros are architecture agnostic,
and can be used in all places which use signatures in a data
structure. Move and rename the fsp_types.h under the common include
header.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
3 years agodoc: edison: Update information about xFSTK
Andy Shevchenko [Fri, 27 Nov 2020 15:59:09 +0000 (17:59 +0200)]
doc: edison: Update information about xFSTK

xFSTK sources got a new home under Edison Firmware Group on GitHub [1].
Update Intel Edison documentation accordingly.

While here, fix couple of typos.

[1]: https://github.com/edison-fw

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Bin Meng <bmeng.cn@gmail.com>
3 years agoPrepare v2021.01-rc4
Tom Rini [Mon, 21 Dec 2020 20:03:24 +0000 (15:03 -0500)]
Prepare v2021.01-rc4

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoTravis-CI: Drop support
Tom Rini [Wed, 16 Dec 2020 00:06:03 +0000 (19:06 -0500)]
Travis-CI: Drop support

Travis-CI is changing their support for FOSS (understandably) to have a
limited per-month number of build minutes.  Unfortunately for us, the
matrix of jobs we run will exhaust that very quickly.  Remove the yml
file.  Thanks for all the builds, Travis-CI!

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
3 years agoboard: kontron: sl28: reorder mmc devices
Michael Walle [Sun, 20 Dec 2020 21:35:13 +0000 (22:35 +0100)]
board: kontron: sl28: reorder mmc devices

Since linux commit 2e6cde96873253fd9eb0f20afd8ffd18278cff75 ("arm64:
dts: ls1028a: make the eMMC and SD card controllers use fixed indices")
mmc0 is the eMMC and mmc1 is the SD card. Also swap it in u-boot to
avoid any confusion by the user and to be aligned with linux.

Signed-off-by: Michael Walle <michael@walle.cc>
3 years agoMerge tag 'efi-2021-01-rc4' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sun, 20 Dec 2020 19:55:59 +0000 (14:55 -0500)]
Merge tag 'efi-2021-01-rc4' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi

Pull request for UEFI sub-system for efi-2021-01-rc4

* Provide a tool to create a file with UEFI variables to preseed UEFI
  variable store.
* Make size of UEFI variable store configurable.
* Add man pages for commands 'bootefi' and 'button'.

3 years agoMAINTAINERS: add tools/efivar.py to EFI PAYLOAD
Heinrich Schuchardt [Sun, 20 Dec 2020 10:58:25 +0000 (11:58 +0100)]
MAINTAINERS: add tools/efivar.py to EFI PAYLOAD

tools/efivar.py allows to prepare a file with UEFI variables to preseed
the UEFI variable store.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agotools: add a simple script to generate EFI variables
Paulo Alcantara [Tue, 8 Dec 2020 23:10:48 +0000 (20:10 -0300)]
tools: add a simple script to generate EFI variables

This script generates EFI variables for U-Boot variable store format.

A few examples:

  - Generating secure boot keys

    $ openssl req -x509 -sha256 -newkey rsa:2048 -subj /CN=TEST_PK/ \
            -keyout PK.key -out PK.crt -nodes -days 365
    $ efisiglist -a -c PK.crt -o foo.esl
    $ tools/efivar.py set -i ubootefi.var -n db -d foo.esl -t file
    $ tools/efivar.py set -i ubootefi.var -n kek -d foo.esl -t file
    $ tools/efivar.py set -i ubootefi.var -n pk -d foo.esl -t file

  - Printing out variables

    $ tools/efivar.py set -i ubootefi.var -n var1 -d foo -t str
    $ tools/efivar.py set -i ubootefi.var -n var2 -d bar -t str
    $ tools/efivar.py print -i ubootefi.var
    var1:
        8be4df61-93ca-11d2-aa0d-00e098032b8c EFI_GLOBAL_VARIABLE_GUID
        NV|BS|RT, DataSize = 0x3
        0000000000: 66 6F 6F                                          foo
    var2:
        8be4df61-93ca-11d2-aa0d-00e098032b8c EFI_GLOBAL_VARIABLE_GUID
        NV|BS|RT, DataSize = 0x3
        0000000000: 62 61 72                                          bar

    - Removing variables

      $ tools/efivar.py del -i ubootefi.var -n var1
      $ tools/efivar.py set -i ubootefi.var -n var1 -a nv,bs -d foo -t str
      $ tools/efivar.py print -i ubootefi.var -n var1
      var1:
          8be4df61-93ca-11d2-aa0d-00e098032b8c EFI_GLOBAL_VARIABLE_GUID
          NV|BS, DataSize = 0x3
          0000000000: 66 6F 6F                                        foo
      $ tools/efivar.py del -i ubootefi.var -n var1
      err: attributes don't match
      $ tools/efivar.py del -i ubootefi.var -n var1 -a nv,bs
      $ tools/efivar.py print -i ubootefi.var -n var1
      err: variable not found

Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Correct examples in commit message.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: make variable store size customizable
Heinrich Schuchardt [Sun, 20 Dec 2020 10:05:38 +0000 (11:05 +0100)]
efi_loader: make variable store size customizable

Currently the size of the buffer to keep UEFI variables in memory is fixed
at 16384 bytes. This size has proven to be too small for some use cases.

Make the size of the memory buffer for UEFI variables customizable.

Reported-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 years agodoc: man-page for bootefi command
Heinrich Schuchardt [Wed, 16 Dec 2020 21:08:38 +0000 (22:08 +0100)]
doc: man-page for bootefi command

Provide a description of the bootefi command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agodoc: button command
Heinrich Schuchardt [Wed, 16 Dec 2020 11:15:49 +0000 (12:15 +0100)]
doc: button command

Provide a description of the 'button' command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agodm: Update documentation for new sequence numbers
Simon Glass [Thu, 17 Dec 2020 04:20:33 +0000 (21:20 -0700)]
dm: Update documentation for new sequence numbers

Update the driver model documention to describe how sequence numbers now
work.

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