platform/kernel/u-boot.git
3 years agoboard: freescale: t208xrdb: enable Power-On Reset for rev D boards
Camelia Groza [Thu, 29 Jul 2021 16:31:20 +0000 (19:31 +0300)]
board: freescale: t208xrdb: enable Power-On Reset for rev D boards

Starting with board revision D, the MISCCSR CPLD register needs to be
configured to enable Power-on Reset for software reset commands.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agolx2160a: Enable CONFIG_SPI_FLASH_MT35XU for lx2160a-rdb/qds
Kuldeep Singh [Wed, 28 Jul 2021 08:35:59 +0000 (14:05 +0530)]
lx2160a: Enable CONFIG_SPI_FLASH_MT35XU for lx2160a-rdb/qds

LX2160A-RDB/QDS has micron mt35xu512aba flash which requires flag
CONFIG_SPI_FLASH_MT35XU on to probe flash successfully.

Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: sl28: drop unneeded and outdated flash partitions
Michael Walle [Mon, 26 Jul 2021 20:08:44 +0000 (22:08 +0200)]
board: sl28: drop unneeded and outdated flash partitions

This board doesn't use the MTD subsystem in u-boot, thus there is no
need to specify the partitions. They are outdated anyway. Just drop
them.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoarm: Finish migration of HAS_FSL_XHCI_USB
Tom Rini [Wed, 21 Jul 2021 22:53:20 +0000 (18:53 -0400)]
arm: Finish migration of HAS_FSL_XHCI_USB

This symbol was largely migrated, except for one case.  Update it.

Cc: Priyanka Jain <priyanka.jain@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agospi: nxp_fspi: Ensure width is respected in spi-mem operations
Michael Walle [Mon, 26 Jul 2021 19:35:28 +0000 (21:35 +0200)]
spi: nxp_fspi: Ensure width is respected in spi-mem operations

Import linux commit 007773e16a6f ("spi: nxp-fspi: Ensure width is
respected in spi-mem operations") to fix SPI access on boards which
don't have all SPI I/O lines connected to the flash.

Since commit 71025f013ccb ("mtd: spi-nor-core: Rework hwcaps selection")
u-boot figures out the capabilities by looking at spi_mem_supports_op().
The FlexSPI driver doesn't take the board layout into account. Fix that.

Fixes: 383fded70c4f ("spi: nxp_fspi: new driver for the FlexSPI controller")
Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-tegra
Tom Rini [Tue, 17 Aug 2021 13:39:22 +0000 (09:39 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-tegra

3 years agoboard: apalis-tk1: launch toradex easy installer in usb recovery
Marcel Ziswiler [Wed, 11 Aug 2021 13:12:56 +0000 (15:12 +0200)]
board: apalis-tk1: launch toradex easy installer in usb recovery

The USB recovery mode is used by Toradex to load the Toradex Easy
Installer image which supports further system images installation.
Prepare for loading and launching the Toradex Easy Installer if the
USB Recovery mode is activated.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
3 years agoPrepare v2021.10-rc2
Tom Rini [Mon, 16 Aug 2021 18:18:45 +0000 (14:18 -0400)]
Prepare v2021.10-rc2

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoconfigs: Resync with savedefconfig
Tom Rini [Mon, 16 Aug 2021 13:35:24 +0000 (09:35 -0400)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-stm
Tom Rini [Mon, 16 Aug 2021 13:31:00 +0000 (09:31 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-stm

Highlights:
  - Handle TF-A boot with FIP for STM32MP1
  - Fix board_get_usable_ram_top(0) for STM32MP1
  - DT alignement with kernel v5.14 for STM32MP1
  - SPI-NOR DT update for DHSOM
  - Add UCLASS API for ECDSA singnature and implement it for STM32MP1

3 years agotest: dm: Add test for ECDSA UCLASS support
Alexandru Gagniuc [Thu, 29 Jul 2021 16:47:19 +0000 (11:47 -0500)]
test: dm: Add test for ECDSA UCLASS support

This test verifies that ECDSA_UCLASS is implemented, and that
ecdsa_verify() works as expected. The definition of "expected" is
"does not find a device, and returns -ENODEV".

The lack of a hardware-independent ECDSA implementation prevents us
from having one in the sandbox, for now.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agoKconfig: FIT_SIGNATURE should not select RSA_VERIFY
Alexandru Gagniuc [Thu, 29 Jul 2021 16:47:18 +0000 (11:47 -0500)]
Kconfig: FIT_SIGNATURE should not select RSA_VERIFY

FIT signatures can now be implemented with ECDSA. The assumption that
all FIT images are signed with RSA is no longer valid. Thus, instead
of 'select'ing RSA, only 'imply' it. This doesn't change the defaults,
but allows one to explicitly disable RSA support.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Igor Opaniuk <igor.opaniuk@foundries.io>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agoarm: stm32mp1: Implement ECDSA signature verification
Alexandru Gagniuc [Thu, 29 Jul 2021 16:47:17 +0000 (11:47 -0500)]
arm: stm32mp1: Implement ECDSA signature verification

The STM32MP ROM provides several service. One of them is the ability
to verify ecdsa256 signatures. Hook the ROM API into the ECDSA uclass.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agolib: ecdsa: Implement UCLASS_ECDSA verification on target
Alexandru Gagniuc [Thu, 29 Jul 2021 16:47:16 +0000 (11:47 -0500)]
lib: ecdsa: Implement UCLASS_ECDSA verification on target

Implement the crypto_algo .verify() function for ecdsa256. Because
it backends on UCLASS_ECDSA, this change is focused on parsing the
keys from devicetree and passing this information to the specific
UCLASS driver.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agodm: crypto: Define UCLASS API for ECDSA signature verification
Alexandru Gagniuc [Thu, 29 Jul 2021 16:47:15 +0000 (11:47 -0500)]
dm: crypto: Define UCLASS API for ECDSA signature verification

Define a UCLASS API for verifying ECDSA signatures. Unlike
UCLASS_MOD_EXP, which focuses strictly on modular exponentiation,
the ECDSA class focuses on verification. This is done so that it
better aligns with mach-specific implementations, such as stm32mp.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agoARM: dts: stm32: Reduce DHCOR SPI NOR frequency to 50 MHz
Marek Vasut [Mon, 9 Aug 2021 12:06:04 +0000 (14:06 +0200)]
ARM: dts: stm32: Reduce DHCOR SPI NOR frequency to 50 MHz

The SPI NOR is a bit further away from the SoC on DHCOR than on DHCOM,
which causes additional signal delay. At 108 MHz, this delay triggers
a sporadic issue where the first bit of RX data is not received by the
QSPI controller.

There are two options of addressing this problem, either by using the
DLYB block to compensate the extra delay, or by reducing the QSPI bus
clock frequency. The former requires calibration and that is overly
complex for SPL, so opt for the second option. This incurs 20ms delay
during boot, when SPL loads U-Boot to DRAM.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agoARM: stm32: Set environment sector size to 4k on DHSOM
Marek Vasut [Mon, 9 Aug 2021 12:08:11 +0000 (14:08 +0200)]
ARM: stm32: Set environment sector size to 4k on DHSOM

The DHSOM SPI NOR is using 4k erase blocks, make use of it
and define the default environment sector size to 4k.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agoarm: dts: stm32mp15: alignment with v5.14
Patrick Delaunay [Tue, 27 Jul 2021 10:15:12 +0000 (12:15 +0200)]
arm: dts: stm32mp15: alignment with v5.14

Device tree alignment with Linux kernel v5.14-rc3
- ARM: dts: stm32: move stmmac axi config in ethernet node on stm32mp15
- ARM: dts: stm32: Configure qspi's mdma transfer to block for stm32mp151
- ARM: dts: stm32: add a new DCMI pins group on stm32mp15
- ARM: dts: stm32: fix ltdc pinctrl on microdev2.0-of7

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agostm32mp: correctly handle board_get_usable_ram_top(0)
Patrick Delaunay [Mon, 26 Jul 2021 09:55:27 +0000 (11:55 +0200)]
stm32mp: correctly handle board_get_usable_ram_top(0)

The function board_get_usable_ram_top can be called after relocation
with total_size = 0 to get the uppermost pointer that is valid to access
in U-Boot.

When total_size = 0, the reserved memory should be not take in account
with lmb library and 'gd->ram_base + gd->ram_size' can be used.

It is the case today in lib/efi_loader/efi_memory.c:efi_add_known_memory()
and this patch avoids that the reserved memory for OP-TEE is not part of
the EFI available memory regions.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agostm32mp1: stm32prog: remove stm32prog_get_tee_partitions with FIP
Patrick Delaunay [Mon, 26 Jul 2021 09:21:38 +0000 (11:21 +0200)]
stm32mp1: stm32prog: remove stm32prog_get_tee_partitions with FIP

The MTD tee partitions used to save the OP-TEE binary are needed when
TF-A doesn't use the FIP container to load binaries.

This patch puts under CONFIG_STM32MP15x_STM32IMAGE flag the associated
code in U-Boot binary and prepare the code cleanup when
CONFIG_STM32MP15x_STM32IMAGE support will be removed after TF-A migration
to FIP support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agodoc: st: stm32mp1: Add FIP support for trusted boot
Patrick Delaunay [Mon, 26 Jul 2021 09:21:37 +0000 (11:21 +0200)]
doc: st: stm32mp1: Add FIP support for trusted boot

TF-A for STM32MP15 now supports the FIP: it is a packaging format which
includes the secure monitor, u-boot-nodtb.bin and u-boot.dtb

This FIP file is loaded by FSBL = TF-A BL2.

This patch updates the board documentation to use this FIP file and no
more u-boot.stm32 (with STM32 image header) which is no more generated.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agoarm: stm32mp: add defconfig for trusted boot with FIP
Patrick Delaunay [Mon, 26 Jul 2021 09:21:36 +0000 (11:21 +0200)]
arm: stm32mp: add defconfig for trusted boot with FIP

Add TF-A FIP support for trusted boot on STM32MP15x,
when STM32MP15x_STM32IMAGE is not activated.

With FIP support the SSBL partition is named "fip" and its size is 4MB,
so the ENV partition name in device tree  (for SD card or eMMC)
or offset in defconfig (CONFIG_ENV_OFFSET / CONFIG_ENV_OFFSET_REDUND)
need to be modified.

With FIP the TEE MTD partitions are removed because the OP-TEE binray are
included in the FIP containers.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agoarm: stm32mp: handle the OP-TEE nodes in DT with FIP support
Patrick Delaunay [Mon, 26 Jul 2021 09:21:35 +0000 (11:21 +0200)]
arm: stm32mp: handle the OP-TEE nodes in DT with FIP support

With FIP support in TF-A (when CONFIG_STM32MP15x_STM32IMAGE
is not activated), the DT nodes needed by OP-TEE are added by OP-TEE
firmware in U-Boot device tree, present in FIP.

These nodes are only required in trusted boot, when TF-A load the file
u-boot.stm32, including the U-Boot device tree with STM32IMAGE header,
in this case OP-TEE can't update the U-Boot device tree.

Moreover in trusted boot mode with FIP, as the OP-TEE nodes are present
in U-Boot device tree only when needed the function
stm32_fdt_disable_optee can be removed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agoarm: stm32mp: add config for STM32IMAGE support
Patrick Delaunay [Mon, 26 Jul 2021 09:21:34 +0000 (11:21 +0200)]
arm: stm32mp: add config for STM32IMAGE support

By default for trusted boot with TF-A, U-Boot (u-boot-nodtb)
is located in FIP container with its device tree and with
the secure monitor (provided by TF-A or OP-TEE).
The FIP file is loaded by TF-A BL2 and each components is
extracted at the final location.

This patch add CONFIG_STM32MP15x_STM32IMAGE to request the
STM32 image generation for SOC STM32MP15x
when FIP container is not used (u-boot.stm32 is loaded by TF-A
as done previously to keep the backward compatibility).

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agoclk: stm32mp1: add support of BSEC clock
Patrick Delaunay [Fri, 16 Jul 2021 08:10:55 +0000 (10:10 +0200)]
clk: stm32mp1: add support of BSEC clock

Add the support of the BSEC clock used by the STM32MP misc driver
since the commit 622c956cada0 ("stm32mp: bsec: manage clock when present
in device tree") even if this clock is not yet defined in kernel device
tree stm32mp151.dtsi.

This patch avoids issue for basic boot when this secure clock are not
provided by secure world with SCMI.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agoMerge tag 'efi-2021-10-rc2-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sun, 15 Aug 2021 17:42:42 +0000 (13:42 -0400)]
Merge tag 'efi-2021-10-rc2-2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2021-10-rc2-2

Documentation:

* Require Sphinx >= 2.4.4 for 'make htmldocs'
* Move devicetree documentation to restructured text and update it
* Document stm32mp1 devicetree bindings

UEFI

* Extend measurement to UEFI variables and ExitBootServices()
* Support Uri() node in devicetree to text protocol
* Add Linux magic token to RISC-V EFI test binaries

3 years agoefi_loader: refactor efi_append_scrtm_version()
Masahisa Kojima [Fri, 13 Aug 2021 07:12:42 +0000 (16:12 +0900)]
efi_loader: refactor efi_append_scrtm_version()

Refactor efi_append_scrtm_version() to use common
function for adding eventlog and extending PCR.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
3 years agoefi_loader: add ExitBootServices() measurement
Masahisa Kojima [Fri, 13 Aug 2021 07:12:41 +0000 (16:12 +0900)]
efi_loader: add ExitBootServices() measurement

TCG PC Client PFP spec requires to measure
"Exit Boot Services Invocation" if ExitBootServices() is invoked.
Depending upon the return code from the ExitBootServices() call,
"Exit Boot Services Returned with Success" or "Exit Boot Services
Returned with Failure" is also measured.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Swap two ifs in efi_exit_boot_services().
efi_tcg2_notify_exit_boot_services must have EFIAPI signature.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: add boot variable measurement
Masahisa Kojima [Fri, 13 Aug 2021 07:12:40 +0000 (16:12 +0900)]
efi_loader: add boot variable measurement

TCG PC Client PFP spec requires to measure "Boot####"
and "BootOrder" variables, EV_SEPARATOR event prior
to the Ready to Boot invocation.
Since u-boot does not implement Ready to Boot event,
these measurements are performed when efi_start_image() is called.

TCG spec also requires to measure "Calling EFI Application from
Boot Option" for each boot attempt, and "Returning from EFI
Application from Boot Option" if a boot device returns control
back to the Boot Manager.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
3 years agoefi_loader: add secure boot variable measurement
Masahisa Kojima [Fri, 13 Aug 2021 07:12:39 +0000 (16:12 +0900)]
efi_loader: add secure boot variable measurement

TCG PC Client PFP spec requires to measure the secure
boot policy before validating the UEFI image.
This commit adds the secure boot variable measurement
of "SecureBoot", "PK", "KEK", "db", "dbx", "dbt", and "dbr".

Note that this implementation assumes that secure boot
variables are pre-configured and not be set/updated in runtime.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
3 years agoefi_loader: add Linux magic to RISC-V crt0
Heinrich Schuchardt [Fri, 28 May 2021 20:24:37 +0000 (22:24 +0200)]
efi_loader: add Linux magic to RISC-V crt0

Add the Linux magic to the EFI file header to allow running our test
programs with GRUB's linux command.

MajorImageVersion = 1 indicates a kernel that can consume the
EFI_LOAD_FILE2_PROTOCOL. This allows to dump the GRUB provided intird with
our initrddump.efi tool.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: Uri() device path node
Heinrich Schuchardt [Thu, 5 Aug 2021 21:10:05 +0000 (21:10 +0000)]
efi_loader: Uri() device path node

iPXE used Uri() device path nodes. So we should support them in the
device path to text protocol.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agodoc: stm32mp1: add page for device tree bindings
Patrick Delaunay [Mon, 2 Aug 2021 16:08:36 +0000 (18:08 +0200)]
doc: stm32mp1: add page for device tree bindings

With device tree binding migration to yaml it is difficult to synchronize
the binding from Linux kernel to U-Boot.

Instead of maintaining the same dt bindings, this patch adds in the U-Boot
documentation the path to the device tree bindings in Linux kernel for
STMicroelectronics devices, when they are used without modification.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Add links for referenced text files.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agodoc: Add a note about why devicetree is used
Simon Glass [Mon, 2 Aug 2021 00:57:12 +0000 (18:57 -0600)]
doc: Add a note about why devicetree is used

This question comes up every now and then with people coming from Linux.
Add some notes about it so we can point to it in the mailing list.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agodoc: Update devicedocs including how to add tweaks
Simon Glass [Mon, 2 Aug 2021 00:57:11 +0000 (18:57 -0600)]
doc: Update devicedocs including how to add tweaks

This file is about 10 years old and the updates have not covered
everything that has changed, particularly in the last few years. Update
the information and add mention of the u-boot.dtsi files.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fix typos.
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agodoc: Move devicetree control doc to rST
Simon Glass [Mon, 2 Aug 2021 00:57:10 +0000 (18:57 -0600)]
doc: Move devicetree control doc to rST

Move this to rST format, largely unchanged to start with. Add an index
for this topic, as well as an empty intro.

Note this patch does not include updates! Is it just a conversion to the
new format. See the next patch.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchart <xypron.glpk@gmx.de>
3 years agodoc: fix Latex margins
Heinrich Schuchardt [Thu, 5 Aug 2021 18:18:06 +0000 (20:18 +0200)]
doc: fix Latex margins

Adjust the Latex formatting to match Linux v5.13.1:

* add Latex margins
* reformat the code in doc/conf.py to match Linux

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agodoc: require Sphinx 2.4.4
Heinrich Schuchardt [Thu, 5 Aug 2021 18:13:41 +0000 (20:13 +0200)]
doc: require Sphinx 2.4.4

Require Sphinx 2.44 to build the documentation.
Remove all code related to earlier versions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agodoc: add pkg-config to the build dependencies
Heinrich Schuchardt [Mon, 2 Aug 2021 20:10:04 +0000 (22:10 +0200)]
doc: add pkg-config to the build dependencies

tools/Makefile uses pkg-config.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-x86
Tom Rini [Fri, 13 Aug 2021 12:37:47 +0000 (08:37 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-x86

- Enable SeaBIOS support for Crown Bay
- Update SeaBIOS build instructions in the x86 doc
- Enable CONFIG_SPI_FLASH_SMART_HWCAPS for Crown Bay

3 years agox86: crownbay: Enable CONFIG_SPI_FLASH_SMART_HWCAPS
Bin Meng [Wed, 4 Aug 2021 03:53:39 +0000 (11:53 +0800)]
x86: crownbay: Enable CONFIG_SPI_FLASH_SMART_HWCAPS

Now that the spi-nor fix has been made in u-boot/master via:

  commit 87e7219f9c6a ("mtd: spi-nor: Respect flash's hwcaps in spi_nor_adjust_hwcaps()")

enable CONFIG_SPI_FLASH_SMART_HWCAPS on Intel Crown Bay again.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agodoc: x86: Update SeaBIOS build instructions
Bin Meng [Tue, 3 Aug 2021 12:50:04 +0000 (20:50 +0800)]
doc: x86: Update SeaBIOS build instructions

Update SeaBIOS build instructions using exact command that involves
"make olddefconfig", and mention SeaBIOS release 1.14.0 has been
used for testing.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agox86: crownbay: Enable SeaBIOS support
Bin Meng [Tue, 3 Aug 2021 12:50:03 +0000 (20:50 +0800)]
x86: crownbay: Enable SeaBIOS support

Enable SeaBIOS support for any kernel that requires legacy BIOS
services.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoMerge tag 'u-boot-rockchip-20210812' of https://source.denx.de/u-boot/custodians...
Tom Rini [Thu, 12 Aug 2021 13:33:39 +0000 (09:33 -0400)]
Merge tag 'u-boot-rockchip-20210812' of https://source.denx.de/u-boot/custodians/u-boot-rockchip

- Add Rockchip SFC driver support;
- DTS sync from kernel;
- emmc hs400 support for rk3399;
- Fix for spinore bootdevice and MMC boot order;

3 years agorockchip: px30: Support configure SFC
Jon Lin [Thu, 5 Aug 2021 08:27:53 +0000 (16:27 +0800)]
rockchip: px30: Support configure SFC

Make px30 SFC clock configurable

Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
3 years agorockchip: px30: add support for SFC for Odroid Go Advance
Chris Morgan [Thu, 5 Aug 2021 08:27:52 +0000 (16:27 +0800)]
rockchip: px30: add support for SFC for Odroid Go Advance

The Odroid Go Advance uses a Rockchip Serial Flash Controller with an
XT25F128B SPI NOR flash chip. This adds support for both. Note that
while both the controller and chip support quad mode, only two lines
are connected to the chip. Changing the pinctrl to bus2 and setting tx
and rx lines to 2 for this reason.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
3 years agomtd: spi-nor-ids: Add XTX XT25F128B
Chris Morgan [Thu, 5 Aug 2021 08:26:41 +0000 (16:26 +0800)]
mtd: spi-nor-ids: Add XTX XT25F128B

Adds support for XT25F128B used on Odroid Go Advance. Unfortunately
this chip uses a continuation code which I cannot seem to parse, so
there are possibly going to be collisions with chips that use the same
manufacturer/ID.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
3 years agorockchip: px30: add the serial flash controller
Chris Morgan [Thu, 5 Aug 2021 08:26:40 +0000 (16:26 +0800)]
rockchip: px30: add the serial flash controller

Add the serial flash controller to the devicetree for the PX30.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
3 years agorockchip: px30: Add support for using SFC
Chris Morgan [Thu, 5 Aug 2021 08:26:39 +0000 (16:26 +0800)]
rockchip: px30: Add support for using SFC

This patch adds support for setting the correct pin configuration
for the Rockchip Serial Flash Controller found on the PX30.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
3 years agospi: rockchip_sfc: add support for Rockchip SFC
Chris Morgan [Thu, 5 Aug 2021 08:26:38 +0000 (16:26 +0800)]
spi: rockchip_sfc: add support for Rockchip SFC

This patch adds support for the Rockchip serial flash controller
found on the PX30 SoC. It should work for versions 3-5 of the SFC
IP, however I am only able to test it on v3.

This is adapted from the WIP SPI-MEM driver for the SFC on mainline
Linux. Note that the main difference between this and earlier versions
of the driver is that this one does not support DMA. In testing
the performance difference (performing a dual mode read on a 128Mb
chip) is negligible. DMA, if used, must also be disabled in SPL
mode when using A-TF anyway.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
3 years agorockchip: Fix u-boot-rockchip.bin build
Johan Gunnarsson [Sun, 25 Jul 2021 14:25:58 +0000 (16:25 +0200)]
rockchip: Fix u-boot-rockchip.bin build

Currently there are a few arm32 rockchip board configs that don't
generate u-boot-rockchip.bin when running make because CONFIG_BINMAN
is not enabled. This patch changes CONFIG_ARCH_ROCKCHIP to also select
CONFIG_BINMAN if CONFIG_SPL and !CONFIG_ARM64.

Example builds that don't generate u-boot-rockchip.bin without this
patch:

export ARCH=arm
export CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf-
make kylin-rk3036_defconfig
make

export ARCH=arm
export CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf-
make rock_defconfig
make

export ARCH=arm
export CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf-
make tinker-rk3288_defconfig
make

Signed-off-by: Johan Gunnarsson <johan.gunnarsson@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
3 years agoarm: dts: sync the Rockhip 3368 SoCs from Linux
Peter Robinson [Thu, 22 Jul 2021 15:20:44 +0000 (16:20 +0100)]
arm: dts: sync the Rockhip 3368 SoCs from Linux

Sync the rk3368 DTs and associated bits from 5.14-rc1.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
3 years agoarm: dts: sync the Rockhip 3328 SoCs from Linux
Peter Robinson [Thu, 22 Jul 2021 15:20:43 +0000 (16:20 +0100)]
arm: dts: sync the Rockhip 3328 SoCs from Linux

Sync the rk3328 DTs and associated bits from 5.14-rc1.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
3 years agoarm: dts: sync the Rockhip 3399 SoCs from Linux
Peter Robinson [Thu, 22 Jul 2021 15:20:42 +0000 (16:20 +0100)]
arm: dts: sync the Rockhip 3399 SoCs from Linux

Sync the rk3399 DTs and associated bits from 5.14-rc1.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
(Remove the conflict content for vmarc-som)
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
3 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-cfi-flash
Tom Rini [Wed, 11 Aug 2021 12:31:56 +0000 (08:31 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-cfi-flash

- Some CFI flash related fixups (Kconfig & header) (Bin)
- Enable CFI flash support on the QEMU RISC-V virt machine. (Bin)

3 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Wed, 11 Aug 2021 12:31:25 +0000 (08:31 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- Convert GoFlex Home Ethernet and SATA to Driver Model (Tony)
- mvebu: Automatically detect CONFIG_SYS_TCLK (Pavel)
- mvebu: sata_mv: Fix HDD identication during cold start (Tony)
- a37xx: pci: Fix handling PIO config error responses (Pavel)
- Other minor misc changes and board maintainer updates

3 years agoMerge tag 'u-boot-amlogic-20210810' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Wed, 11 Aug 2021 12:31:13 +0000 (08:31 -0400)]
Merge tag 'u-boot-amlogic-20210810' of https://source.denx.de/u-boot/custodians/u-boot-amlogic

- odroid-n2: fix fdtfile suffix for n2-plus
- sei610 & meson64_android cleanups to prepare android 11 boot support
- use Android BCB mechanism for reboot reason instead of HW reboot flag
- Switch meson64_android boot flow to use abootimg for A/B, AVB and DTBO support

3 years agoarm64: rk3399: r4s: Remove undesirable MAC address fetching methods for ethernet
Xiaobo Tian [Tue, 6 Jul 2021 14:43:59 +0000 (22:43 +0800)]
arm64: rk3399: r4s: Remove undesirable MAC address fetching methods for ethernet

Remove the recommended MAC address from the network card.
NanoPi R4S has a EEPROM attached to the 2nd I2C bus (U92), which stores the MAC address.

Signed-off-by: Xiaobo Tian <peterwillcn@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
3 years agoarm64: rk3399: r4s: Inheritance uses the sdmmc definition in dtsi
Xiaobo Tian [Tue, 6 Jul 2021 14:43:58 +0000 (22:43 +0800)]
arm64: rk3399: r4s: Inheritance uses the sdmmc definition in dtsi

The host-index-min property is invalid,
so it inherits from the sdmmc definition in dtsi.

Signed-off-by: Xiaobo Tian <peterwillcn@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
3 years agoarm64: rk3399: r4s: correct the LEDS label name
Xiaobo Tian [Tue, 6 Jul 2021 14:43:57 +0000 (22:43 +0800)]
arm64: rk3399: r4s: correct the LEDS label name

Correct the LEDS label name and remove the board type prefix,
which is actually unnecessary here, removes the redefined system status LED pin.

Signed-off-by: Xiaobo Tian <peterwillcn@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
3 years agorockchip: config: evb-rk3399: add hs400 and SDMA support
Yifeng Zhao [Tue, 29 Jun 2021 08:24:43 +0000 (16:24 +0800)]
rockchip: config: evb-rk3399: add hs400 and SDMA support

This enable hs400 and SDMA support for emmc on evb-rk3399.

Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
3 years agommc: rockchip_sdhci: Add support for RK3568
Yifeng Zhao [Tue, 29 Jun 2021 08:24:42 +0000 (16:24 +0800)]
mmc: rockchip_sdhci: Add support for RK3568

This patch adds support for the RK3568 platform to this driver.

Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
3 years agommc: rockchip_sdhci: add phy and clock config for rk3399
Yifeng Zhao [Tue, 29 Jun 2021 08:24:41 +0000 (16:24 +0800)]
mmc: rockchip_sdhci: add phy and clock config for rk3399

Add clock, phy and other configuration, it is convenient to support
new controller. Here a short summary of the changes:
- Add mmc_of_parse to parse dts config.
- Remove OF_PLATDATA related code.
- Reorder header inclusion.
- Add phy ops.
- add ops set_ios_post to modify the parameters of phy when the
  clock changes.
- Add execute tuning api for hs200 tuning.

Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
3 years agoARM: dts: rockchip: update rk3188-radxarock.dts
Johan Jonker [Fri, 25 Jun 2021 13:26:33 +0000 (15:26 +0200)]
ARM: dts: rockchip: update rk3188-radxarock.dts

In the Linux DT the file rk3xxx.dtsi is shared between
rk3066 and rk3188. Both rk3xxx.dtsi and rk3188.dtsi have recently
had some updates.
For a future rk3066 support in U-boot this file must also update.
Move U-boot specific things in a rk3188-radxarock-u-boot.dtsi file.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
3 years agoARM: dts: rockchip: update rk3188.dtsi
Johan Jonker [Fri, 25 Jun 2021 13:26:32 +0000 (15:26 +0200)]
ARM: dts: rockchip: update rk3188.dtsi

In the Linux DT the file rk3xxx.dtsi is shared between
rk3066 and rk3188. Both rk3xxx.dtsi and rk3188.dtsi have recently
had some updates.
For a future rk3066 support in U-boot this file must also update.
Move U-boot specific things in a rk3188-u-boot.dtsi file.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
3 years agorockchip: rk3188-power: sync power domain dt-binding header from Linux
Johan Jonker [Fri, 25 Jun 2021 13:26:31 +0000 (15:26 +0200)]
rockchip: rk3188-power: sync power domain dt-binding header from Linux

In order to update the DT for rk3188
sync the power domain dt-binding header.
This is the state as of v5.12 in Linux.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
3 years agoARM: dts: rockchip: update rk3xxx.dtsi
Johan Jonker [Fri, 25 Jun 2021 13:26:30 +0000 (15:26 +0200)]
ARM: dts: rockchip: update rk3xxx.dtsi

In the Linux DT the file rk3xxx.dtsi is shared between
rk3066 and rk3188. This file has recently had some updates.
For a future rk3066 support in U-boot this file must also update.
Move U-boot specific things in a rk3xxx-u-boot.dtsi file.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
3 years agorockchip: rk3188-cru-common: sync clock dt-binding header from Linux
Johan Jonker [Fri, 25 Jun 2021 13:26:29 +0000 (15:26 +0200)]
rockchip: rk3188-cru-common: sync clock dt-binding header from Linux

In order to update the DT for rk3066 and rk3188
sync the clock dt-binding header.
This is the state as of v5.12 in Linux.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
3 years agork3399: boot_devices fix spinor node name
Artem Lapkin [Wed, 26 May 2021 09:32:27 +0000 (17:32 +0800)]
rk3399: boot_devices fix spinor node name

Problem: board_spl_was_booted_from return wrong boot_devices[3] value
/spi@ff1d0000 and same-as-spl dont work properly for SPINOR flash
because arch/arm/mach-rockchip/spl-boot-order.c spl_node_to_boot_device
need parse SPINOR flash node as UCLASS_SPI_FLASH

spl-boot-order: same-as-spl > *** BOOT_SOURCE_ID 3 (2:emmc 3:spi 5:sd ...
/spi@ff1d0000 > board_boot_order: could not map node @618 to a boot-device
/sdhci@fe330000 > /mmc@fe320000

Solution: just change it to /spi@ff1d0000/flash@0

spl-boot-order: same-as-spl > *** BOOT_SOURCE_ID 3 (2:emmc 3:spi 5:sd ...
/spi@ff1d0000/flash@0 > /sdhci@fe330000 > /mmc@fe320000

Signed-off-by: Artem Lapkin <art@khadas.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
3 years agorockchip: Fix MMC boot order
Alex Bee [Thu, 17 Jun 2021 09:01:12 +0000 (11:01 +0200)]
rockchip: Fix MMC boot order

Basically all, i.e. rk3036.dtsi, rk3128.dtsi, rk3xxx.dtsi, rk322x.dtsi,
rk3288.dtsi, rk3308-u-boot.dtsi, rk3328-u-boot.dtsi, rk3399-u-boot.dtsi
and px30-u-boot.dtsi Rockchip SoC devicetrees which have mmc indexes
are defining eMMC as mmc0 and sdmmc as mmc1.
This means that the rule to try to boot from the SD card first is ignored,
which as per comment is what we want and is important for distros, which
rely on that.

Fix this by setting the correct mmc index, i.e. first from mmc1 (SD card),
second from mmc0 (eMMC).

Signed-off-by: Alex Bee <knaerzche@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
3 years agoriscv: qemu: Enable MTD NOR flash support
Bin Meng [Sat, 7 Aug 2021 05:00:02 +0000 (13:00 +0800)]
riscv: qemu: Enable MTD NOR flash support

Enable support to the 2 NOR flashes on the QEMU RISC-V virt machine.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoflash.h: Remove CONFIG_SYS_FLASH_CFI from flash_info_t
Bin Meng [Sat, 7 Aug 2021 05:00:01 +0000 (13:00 +0800)]
flash.h: Remove CONFIG_SYS_FLASH_CFI from flash_info_t

Those embers wrapped with CONFIG_SYS_FLASH_CFI in struct flash_info_t
are unconditionally used in the cfi_flash.c driver.

Drop the #ifdefs in the definition of flash_info_t.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agomtd: kconfig: Fix CFI_FLASH dependency
Bin Meng [Sat, 7 Aug 2021 05:00:00 +0000 (13:00 +0800)]
mtd: kconfig: Fix CFI_FLASH dependency

The DM version CFI flash driver is in driver/mtd/cfi_flash.c, which
only gets built when FLASH_CFI_DRIVER is on. If CFI_FLASH is on but
FLASH_CFI_DRIVER is not, nothing is enabled at all.

Fix this dependency by selecting FLASH_CFI_DRIVER when CFI_FLASH is
enabled.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: kirkwood: Goflex Home: Update board maintainer
Tony Dinh [Tue, 10 Aug 2021 06:53:17 +0000 (23:53 -0700)]
arm: kirkwood: Goflex Home: Update board maintainer

Change maintainer to me. Suriyan no longer has this board and wishes
to see someone maintaining it actively.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: kirkwood: Dockstar: Update board maintainer
Tony Dinh [Tue, 10 Aug 2021 06:10:42 +0000 (23:10 -0700)]
arm: kirkwood: Dockstar: Update board maintainer

Change maintainer to me. Eric no longer has this board and wishes
to see someone maintaining it actively.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: mvebu: Hang if ddr3_init() fails
Pali Rohár [Mon, 9 Aug 2021 15:44:35 +0000 (17:44 +0200)]
arm: mvebu: Hang if ddr3_init() fails

If ddr3_init() fails then DDR was not initialized and we cannot load and
execute U-Boot. We cannot continue, we cannot do anything in this case, so
hang.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: a37xx: pci: Fix handling PIO config error responses
Pali Rohár [Mon, 9 Aug 2021 07:53:13 +0000 (09:53 +0200)]
arm: a37xx: pci: Fix handling PIO config error responses

Returning fabricated CRS value (0xFFFF0001) by PCIe Root Complex to OS is
allowed only for 4-byte PCI_VENDOR_ID config read request and only when
CRSSVE bit in Root Port PCIe device is enabled. In all other error PCIe
Root Complex must return all-ones.

So implement this logic in pci-aardvark.c driver properly.

aardvark HW does not have Root Port PCIe device and U-Boot does not
implement emulation of this device. So expect that CRSSVE bit is set as
U-Boot can already handle CRS value for PCI_VENDOR_ID config read request.

More callers of pci_bus_read_config() function in U-Boot do not check for
return value, but check readback value. Therefore always fill readback
value in pcie_advk_read_config() function. On error fill all-ones of
correct size as it is required for PCIe Root Complex.

And also correctly propagates error from failed config write request to
return value of pcie_advk_write_config() function. Most U-Boot callers
ignores this return value, but it is a good idea to return correct value
from function.

These issues about return value of failed config read requests, including
special handling of CRS were reported by Lorenzo and Bjorn for Linux kernel
driver pci-aardvark together with quotes from PCIe r4.0 spec, see details:
https://lore.kernel.org/linux-pci/20210624213345.3617-1-pali@kernel.org/t/#u

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: mvebu: sata_mv failed to identify HDDs during cold start
Tony Dinh [Sun, 1 Aug 2021 03:29:35 +0000 (20:29 -0700)]
arm: mvebu: sata_mv failed to identify HDDs during cold start

During cold start, with some HDDs, mv_sata_identify() does not populate
the ID words on the 1st ATA ID command. In fact, the first ATA ID
command will only power up the drive, and then the ATA ID command
processing is lost in the process.

Tests with:

- Seagate ST9250320AS 250GB HDD and Seagate ST4000DM004-2CV104 4TB HDD.
- Zyxel NSA310S (Kirkwood 88F6702), Marvell Dreamplug (Kirkwood 88F6281),
 Seagate GoFlex Home (Kirkwood 88F6281), Pogoplug V4 (Kirkwood 88F6192).

Observation:

- The Seagate ST9250320AS 250GB took about 3 seconds to spin up.
- The Seagate ST4000DM004-2CV104 4TB took about 8 seconds to spin up.
- mv_sata_identify() did not populate the ID words after the call to
 mv_ata_exec_ata_cmd_nondma().
- Attempt to insert a long delay of 30 seconds, ie. mdelay(30_000), after
the call to ata_wait_register() inside mv_ata_exec_ata_cmd_nondma() did
not help with the 4TB drive. The ID words were still empty after that 30s
delay.

Patch Description:

- Added a second ATA ID command in mv_sata_identify(), which will be
executed if the 1st ATA ID command did not return with valid ID words.
- Use the HDD drive capacity in the ID words as a successful indicator of
ATA ID command.
- In the scenario where a box is rebooted, the 1st ATA ID command is always
successful, so there is no extra time wasted.
- In the scenario where a box is cold started, the 1st ATA command is the
power up command. The 2nd ATA ID command alleviates the uncertainty of
how long we have to wait for the ID words to be populated by the SATA
controller.

Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Tony Dinh <mibodhi@gmail.com>
3 years agoarm: kirkwood: Do not overwrite CONFIG_SYS_TCLK
Pali Rohár [Sat, 31 Jul 2021 12:22:56 +0000 (14:22 +0200)]
arm: kirkwood: Do not overwrite CONFIG_SYS_TCLK

Config option CONFIG_SYS_TCLK is set by kw88f6281.h and kw88f6192.h files
to correct SOC/platform value. So do not overwrite it in board config
include files.

Kirkwood 88F6180 and 88F6192 uses 166 MHz TCLK and Kirkwood 88F6281 uses
200 MHz TCLK.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: mvebu: axp: Set CONFIG_SYS_TCLK globally
Pali Rohár [Sat, 31 Jul 2021 12:22:55 +0000 (14:22 +0200)]
arm: mvebu: axp: Set CONFIG_SYS_TCLK globally

This mvebu axp platform always uses fixed 250 MHz TCLK. So specify this
CONFIG_SYS_TCLK option in msys section of global file soc.h file instead of
manual configuration in every board file.

Now every #if-#else case of soc.h file defines CONFIG_SYS_TCLK, so remove
useless default CONFIG_SYS_TCLK value from the end of soc.h file.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: mvebu: msys: Set CONFIG_SYS_TCLK globally
Pali Rohár [Sat, 31 Jul 2021 12:22:54 +0000 (14:22 +0200)]
arm: mvebu: msys: Set CONFIG_SYS_TCLK globally

This mvebu msys platform always uses fixed 200 MHz TCLK. So specify this
CONFIG_SYS_TCLK option in msys section of global file soc.h file instead of
manual configuration in every board file.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: mvebu: a37x: Detect CONFIG_SYS_TCLK from SAR register
Pali Rohár [Sat, 31 Jul 2021 12:22:53 +0000 (14:22 +0200)]
arm: mvebu: a37x: Detect CONFIG_SYS_TCLK from SAR register

Bit 20 in SAR register specifies if TCLK is running at 200 MHz or 166 MHz.
Use this information instead of manual configuration in every board file.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: mvebu: a38x: Detect CONFIG_SYS_TCLK from SAR register
Pali Rohár [Sat, 31 Jul 2021 12:22:52 +0000 (14:22 +0200)]
arm: mvebu: a38x: Detect CONFIG_SYS_TCLK from SAR register

Bit 15 in SAR register specifies if TCLK is running at 200 MHz or 250 MHz.
Use this information instead of manual configuration in every board file.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: kirkwood: GoFlex Home: Use Ethernet PHY name and address from device tree
Tony Dinh [Fri, 30 Jul 2021 03:02:43 +0000 (20:02 -0700)]
arm: kirkwood: GoFlex Home: Use Ethernet PHY name and address from device tree

In DM Ethernet, the old "egiga0" name is no longer valid,
so replace these with Ethernet PHY names from device tree. Also, read
Ethernet PHY address from device tree.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: kirkwood: GoFlex Home: Add DM SATA configs
Tony Dinh [Fri, 30 Jul 2021 03:02:42 +0000 (20:02 -0700)]
arm: kirkwood: GoFlex Home: Add DM SATA configs

Enable DM SATA in board file.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: kirkwood: GoFlex Home: Add DM Ethernet, remove IDE, and add DM SATA configs
Tony Dinh [Fri, 30 Jul 2021 03:02:41 +0000 (20:02 -0700)]
arm: kirkwood: GoFlex Home: Add DM Ethernet, remove IDE, and add DM SATA configs

Add DM_ETH, SATA_MV and associated configs to goflexhome_defconfig.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoconfigs: Resync with savedefconfig
Tom Rini [Tue, 10 Aug 2021 19:08:46 +0000 (15:08 -0400)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
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 agoMerge tag 'u-boot-imx-20210809' of https://source.denx.de/u-boot/custodians/u-boot-imx
Tom Rini [Mon, 9 Aug 2021 13:27:26 +0000 (09:27 -0400)]
Merge tag 'u-boot-imx-20210809' of https://source.denx.de/u-boot/custodians/u-boot-imx

u-boot-imx-20210809

- new SOC: add support for imx8ulp
- Toradex fixes for colibri (vf / imx6 / imx7 / imx8x)
- convert to DM for mx28evk
- Fixes for Gateworks ventana boards

CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/8639

3 years agoMerge tag 'dm-pull-8aug21' of https://source.denx.de/u-boot/custodians/u-boot-dm
Tom Rini [Mon, 9 Aug 2021 13:27:06 +0000 (09:27 -0400)]
Merge tag 'dm-pull-8aug21' of https://source.denx.de/u-boot/custodians/u-boot-dm

Use log subsystem for dm_warn()
Various minor bug fixes

3 years agoimx: cmd: use struct cmd_tbl
Peng Fan [Sat, 7 Aug 2021 08:21:34 +0000 (16:21 +0800)]
imx: cmd: use struct cmd_tbl

cmd_tbl_t is removed, need use struct cmd_tbl

Signed-off-by: Peng Fan <peng.fan@nxp.com>