]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
13 months agotools: mkimage: fix sfspl_image_extract_subimage()
Heinrich Schuchardt [Tue, 24 Oct 2023 07:26:38 +0000 (09:26 +0200)]
tools: mkimage: fix sfspl_image_extract_subimage()

Do not leak file descriptor if writing fails.
Correct the error text if opening a file fails.

Addresses-Coverity-ID: 467054 Resource leaks
Fixes: 64fd30d367a1 ("tools: mkimage: Add StarFive SPL image support")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
13 months agoarm_ffa: fix: remove deadcode in ffa_print_error_log()
Abdellatif El Khlifi [Fri, 20 Oct 2023 13:15:33 +0000 (14:15 +0100)]
arm_ffa: fix: remove deadcode in ffa_print_error_log()

address the CID 464361 Control flow issues [1]

[1]: https://lore.kernel.org/all/20230821210927.GL3953269@bill-the-cat/

Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Cc: Tom Rini <trini@konsulko.com>
13 months agocommon: Reword CONSOLE_RECORD_.*SIZE help texts
Tom Rini [Thu, 19 Oct 2023 15:04:35 +0000 (11:04 -0400)]
common: Reword CONSOLE_RECORD_.*SIZE help texts

Make it clear that in the options for setting the console record buffer
sizes that we are talking about buffers for that feature specifically
and not the general console buffers.

Signed-off-by: Tom Rini <trini@konsulko.com>
13 months agoaddrmap: Fix off by one in addrmap_set_entry()
Dan Carpenter [Tue, 25 Jul 2023 06:50:40 +0000 (09:50 +0300)]
addrmap: Fix off by one in addrmap_set_entry()

The > comparison needs to be changed to >= to prevent an out of bounds
write on th next line.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
13 months agoMerge branch 'master_tmio_fixes' of https://source.denx.de/u-boot/custodians/u-boot-sh
Tom Rini [Sat, 28 Oct 2023 16:51:28 +0000 (12:51 -0400)]
Merge branch 'master_tmio_fixes' of https://source.denx.de/u-boot/custodians/u-boot-sh

- MMC fixes for Renesas platforms

13 months agoMerge branch '2023-10-28-assorted-platform-updates'
Tom Rini [Sat, 28 Oct 2023 13:23:27 +0000 (09:23 -0400)]
Merge branch '2023-10-28-assorted-platform-updates'

- Fix some mpc85xx platforms, fixes for a few TI K3 platforms, enable
  usb device and fastboot on verdin-imx8mp, make all QEMU platforms use
  the default console buffer sizes, vexpress platform fixes, and update
  synquacer flash layout

13 months agoiot2050: Allow for more than 1 USB storage device
Jan Kiszka [Sun, 22 Oct 2023 18:07:26 +0000 (20:07 +0200)]
iot2050: Allow for more than 1 USB storage device

This was lost in refactoring while some users of the IOT2050 expect it
to work: Make sure that up to 3 USB storage devices are probed.

Fixes: 53873974a4b0 ("include: armv7: Enable distroboot across all configs")
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
13 months agompc85xx: relocate code in non-SPL build
Martin Fäcknitz [Thu, 19 Oct 2023 23:06:55 +0000 (01:06 +0200)]
mpc85xx: relocate code in non-SPL build

When building a non-SPL image, relocation is needed. This patch restores
the old behaviour before commit b35316fb67cb ("Convert
CONFIG_SPL_INIT_MINIMAL et al to Kconfig") was only defined if
CONFIG_SPL_BUILD was defined.

Fixes: b35316fb67cb ("Convert CONFIG_SPL_INIT_MINIMAL et al to Kconfig")
Signed-off-by: Martin Fäcknitz <faecknitz@hotsplots.de>
13 months agoboard: synquacer: Update the flash image layout
Ilias Apalodimas [Thu, 19 Oct 2023 13:54:19 +0000 (16:54 +0300)]
board: synquacer: Update the flash image layout

The SynQuacer Developerbox, in EFI mode, supports A/B capsule
updates and single image ones. The flash layout in the latter case is
outdated, update it with the new offsets and images

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-By: Masahisa Kojima <masahisa.kojima@linaro.org>
13 months agodriver: misc: k3_avs: Add support for thermal shutdown
Udit Kumar [Thu, 19 Oct 2023 07:27:53 +0000 (12:57 +0530)]
driver: misc: k3_avs: Add support for thermal shutdown

To avoid thermal burn out, program thermal shutdown
value in VTM (Voltage and Thermal Manager) IP.

Part of Linux kernel driver (drivers/thermal/k3_j72xx_bandgap.c)
is ported from kernel 6.6-rc1, which sets thermal shutdown values.

Signed-off-by: Udit Kumar <u-kumar1@ti.com>
Signed-off-by: Neha Francis <n-francis@ti.com>
13 months agovexpress64: Add MMC card to the BOOT_TARGET_DEVICES of FVP
Wei Chen [Wed, 18 Oct 2023 06:27:45 +0000 (14:27 +0800)]
vexpress64: Add MMC card to the BOOT_TARGET_DEVICES of FVP

Add MMC disk to FVP's BOOT_TARGET_DEVICES. This allows the user to boot
from MMC devices.

Signed-off-by: Wei Chen <wei.chen@arm.com>
Signed-off-by: Qi Feng <qi.feng@arm.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
13 months agomisc: vexpress_config: Use member .priv_auto to set the private data
Wei Chen [Wed, 18 Oct 2023 06:27:44 +0000 (14:27 +0800)]
misc: vexpress_config: Use member .priv_auto to set the private data

In current vexpress_config_probe code, it sets the uclass private data
directly. This will cause one compilation error:
drivers/misc/vexpress_config.c:114:27: error: lvalue required as left operand of assignment
  114 |  dev_get_uclass_priv(dev) = priv;
      |                           ^

In this patch we set the uclass private data through struct member
.priv_auto, and this compilation error disappears.

Signed-off-by: Wei Chen <wei.chen@arm.com>
Signed-off-by: Qi Feng <qi.feng@arm.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
13 months agoconfig: qemu: relax print and console buffer size
Heinrich Schuchardt [Mon, 16 Oct 2023 21:54:45 +0000 (23:54 +0200)]
config: qemu: relax print and console buffer size

QEMU print and console buffer sizes have been restricted on QEMU below
their default values.

One of the side effects of the print buffer size restriction is output
truncation of the 'efidebug dh' command.

As QEMU does not have special memory size restrictions remove the settings
from the defconfig files and go with the generic defaults.

Fixes: d0ee7f295d74 ("Convert CONFIG_SYS_PBSIZE to Kconfig")
Fixes: d31466b382dd ("Convert CONFIG_SYS_CBSIZE to Kconfig")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
13 months agoboard: siemens: iot2050: Fix M.2 detection
Jan Kiszka [Tue, 17 Oct 2023 05:20:14 +0000 (07:20 +0200)]
board: siemens: iot2050: Fix M.2 detection

The "simpler" the logic, the higher the probability to not test and get
things wrong, again: The absence of a "-PG2" suffix is not sufficient to
derive that we are on PG1. There is also "IOT2050-ADVANCED-M2".

Finally fix that by exactly matching against the two PG1 device names.

While changing this, we can also drop the not really needed check for
!board_is_sr1 in board_is_m2 and call the boards by their names
("board_is_pg1").

Reported-and-tested-by: Bao Cheng Su <baocheng.su@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
13 months agoboard: toradex: verdin-imx8mp: enable usb device and fastboot support
Marcel Ziswiler [Mon, 28 Aug 2023 21:38:02 +0000 (23:38 +0200)]
board: toradex: verdin-imx8mp: enable usb device and fastboot support

Enable USB device and fastboot support which may be used to load the
Toradex Easy Installer FIT image.

While at it also enable USB mass storage aka UMS support.

Note that the i.MX 8M Plus recovery mode support is based on the USB
boot stage of the BOOTROM and does NOT require USB SDP SPL aka serial
downloader support.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
13 months agoMerge tag 'tpm-next-27102023' of https://source.denx.de/u-boot/custodians/u-boot-tpm
Tom Rini [Fri, 27 Oct 2023 23:27:29 +0000 (19:27 -0400)]
Merge tag 'tpm-next-27102023' of https://source.denx.de/u-boot/custodians/u-boot-tpm

bootX measurements and measurement API moved to u-boot core:

Up to now, U-Boot could perform measurements and EventLog creation as
described by the TCG spec when booting via EFI.

The EFI code was residing in lib/efi_loader/efi_tcg2.c and contained
both EFI specific code + the API needed to access the TPM, extend PCRs
and create an EventLog. The non-EFI part proved modular enough and
moving it around to the TPM subsystem was straightforward.

With that in place we can have a common API for measuring binaries
regardless of the boot command, EFI or boot(m|i|z), and contructing an
EventLog.

I've tested all of the EFI cases -- booting with an empty EventLog and
booting with a previous stage loader providing one and found no
regressions.  Eddie tested the bootX part.

Eddie also fixed the sandbox TPM which couldn't be used for the EFI code
and it now supports all the required capabilities. This had a slight
sideeffect in our testing since the EFI subsystem initializes the TPM
early and 'tpm2 init' failed during some python tests. That code only
opens the device though, so we can replace it with 'tpm2 autostart'
which doesn't error out and still allows you to perfom the rest of the
tests but doesn't report an error if the device is already opened.

There's a few minor issues with this PR as well but since testing and
verifying the changes takes a considerable amount of time, I prefer
merging it now.

Heinrich has already sent a PR for -master containing "efi_loader: fix
EFI_ENTRY point on get_active_pcr_banks" and I am not sure if that will
cause any conflicts, but in any case they should be trivial to resolve.

Both the EFI and non-EFI code have a Kconfig for measuring the loaded
Device Tree.  The reason this is optional is that we can't reason
when/if devices add random info like kaslr-seed, mac addresses etc in
the DT. In that case measurements are random, board specific and
eventually useless.  The reason it was difficult to fix it prior to this
patchset is because the EFI subsystem and thus measurements was brought
up late and DT fixups might have already been applied. With this
patchset we can measure the DT really early in the future.

Heinrich also pointed out that the two Kconfigs for the DTB measurements
can be squashed in a single one and that the documentation only explains
the non-EFI case.  I agree on both but as I said this is a sane working
version, so let's pull this first it's aleady big enough and painful to
test.

13 months agoMerge tag 'efi-2024-01-rc2-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Fri, 27 Oct 2023 19:23:21 +0000 (15:23 -0400)]
Merge tag 'efi-2024-01-rc2-2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2024-01-rc2-2

Documentation:

* Bump urllib3 version
* Replace references to dm_dump_all() with dm_dump_tree()
* Update description of build dependencies for Alpine Linux
* Fix typo in gpt example
* Fix ordering of shell commands

UEFI:

* Move misplace EFI_ENTRY macro

13 months agoefi_loader: fix EFI_ENTRY point on get_active_pcr_banks
Ilias Apalodimas [Thu, 19 Oct 2023 16:21:55 +0000 (11:21 -0500)]
efi_loader: fix EFI_ENTRY point on get_active_pcr_banks

efi_tcg2_get_active_pcr_banks doesn't immediately call the
EFI_ENTRY() wrapper once it enters the function. Move the call a
few lines above to cover the error cases properly as well.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
13 months agodoc: usage: fix ordering of shell commands
Tom Fitzhenry [Tue, 24 Oct 2023 12:03:00 +0000 (23:03 +1100)]
doc: usage: fix ordering of shell commands

I initially didn't find the bootz docs when I went looking for them. :)

Signed-off-by: Tom Fitzhenry <tom@tom-fitzhenry.me.uk>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
13 months agodoc: gpt: fix example of echoing variable
Tom Fitzhenry [Tue, 24 Oct 2023 11:59:06 +0000 (22:59 +1100)]
doc: gpt: fix example of echoing variable

Fixes: 44c5d7764bf4 ("doc: Add gpt command documentation")
Signed-off-by: Tom Fitzhenry <tom@tom-fitzhenry.me.uk>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
13 months agodoc: Replace dm_dump_all() with dm_dump_tree()
Dylan Corrales [Thu, 19 Oct 2023 14:02:30 +0000 (10:02 -0400)]
doc: Replace dm_dump_all() with dm_dump_tree()

Replace dm_dump_all() with dm_dump_tree() in driver model documentation,
to reflect changes introduced in commit 145287040480 ("dm: core: Rename
dm_dump_all()").

Fixes: 145287040480 ("dm: core: Rename dm_dump_all()")
Signed-off-by: Dylan Corrales <deathcamel58@gmail.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reivewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
13 months agosphinx: Bump urllib3 version
Tom Rini [Wed, 18 Oct 2023 12:33:48 +0000 (08:33 -0400)]
sphinx: Bump urllib3 version

While unlikely to be a direct issue for us, urllib3 before 2.0.7 is
vulnerable to CVE-2023-45803, so bump our version up.

Reported-by: GitHub dependabot
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
13 months agoMerge tag 'u-boot-amlogic-20231027' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Fri, 27 Oct 2023 14:19:17 +0000 (10:19 -0400)]
Merge tag 'u-boot-amlogic-20231027' of https://source.denx.de/u-boot/custodians/u-boot-amlogic

- Fix environment saving for new Android boot features on vim3*_android
- Add SPIFC support for Amlogic A1
- Add DFU RAM boot step when booting over USB

13 months agoARM: amlogic: ad401: enable SPIFC
Igor Prusov [Tue, 24 Oct 2023 22:51:40 +0000 (01:51 +0300)]
ARM: amlogic: ad401: enable SPIFC

Enable Amlogic A1 SPI FLash Controller support.

Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20231024225140.366571-3-ivprusov@sberdevices.ru
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
13 months agospi: add support for Amlogic A1 SPI Flash Controller
Igor Prusov [Tue, 24 Oct 2023 22:51:39 +0000 (01:51 +0300)]
spi: add support for Amlogic A1 SPI Flash Controller

Add A1 SPIFC driver from Linux. Slightly modified to use u-boot driver
framework and accommodate to lack of ioread32_rep/iowrite32_rep.

Based on Linux version 6.6-rc4

Signed-off-by: Igor Prusov <IVPrusov@sberdevices.ru>
Signed-off-by: Martin Kurbanov <mmkurbanov@sberdevices.ru>
Reviewed-by: Simon Glass <sjg@chromium.org>
Link: https://lore.kernel.org/r/20231024225140.366571-2-ivprusov@sberdevices.ru
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
[trini: Drop <common.h> as it's not needed]

13 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Fri, 27 Oct 2023 13:38:58 +0000 (09:38 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- kirkwood: Enable bootstd on some boards (Tony)
- mvebu: turris_mox: Extend to support RIPE Atlas Probe (Marek)
- mvebu/bubt: Support eMMC data partition booting (Josua)

13 months agotest/py: always use autostart on tpm2 selftests
Ilias Apalodimas [Wed, 25 Oct 2023 07:25:25 +0000 (10:25 +0300)]
test/py: always use autostart on tpm2 selftests

commit 789ed2784256 ("test/py: replace 'tpm2 init, startup, selftest' sequences")
changed some of the tpm2 init sequences to 'tpm2 autostart' instead of
calling 'tpm init', 'tpm startup TPM2_SU_CLEAR', 'tpm2 self_test full'.

The autostart command calls the afforementioned sequence and on top of
that deals with the 'tpm2 init' return codes if the tpm is already
started. Since we initialize the tpm from various subsystems now,
replace the last remaining instances of 'tpm2 init' with 'tpm2
autostart'.  Since the latter calls 'tpm2 init' anyway we will still be
implicitly testing the validity of that command

It's worth noting that since 'tpm2 autostart' performs the startup and
self tests sequences of the tpm we could drop
'test_tpm2_sandbox_self_test_full' and 'test_tpm2_startup, but let's
keep the since they test tpm commands and options

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
13 months agotest: use a non system PCR for testing PCR extend
Ilias Apalodimas [Tue, 24 Oct 2023 15:43:54 +0000 (10:43 -0500)]
test: use a non system PCR for testing PCR extend

We currently use PCR 0 for testing the PCR read/extend functionality in
our selftests.  How ever those PCRs are defined by the TCG spec for
platform use.  For example if the tests run *after* the efi subsystem
initialization, which extends PCRs 0 & 7 it will give a false positive.

So let's switch over to a PCR which is more suitable and is defined for
OS use.  It's worth noting that we are using PCR10 here, since PCR9 is
used internally by U-Boot if we choose to measure the loaded DTB

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
13 months agoefi_loader: fix EFI_ENTRY point on get_active_pcr_banks
Ilias Apalodimas [Tue, 24 Oct 2023 15:43:53 +0000 (10:43 -0500)]
efi_loader: fix EFI_ENTRY point on get_active_pcr_banks

efi_tcg2_get_active_pcr_banks doesn't immediately call the
EFI_ENTRY() wrapper once it enters the function. Move the call a
few lines above to cover the error cases properly as well.

Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
13 months agodoc: Add measured boot documentation
Eddie James [Tue, 24 Oct 2023 15:43:52 +0000 (10:43 -0500)]
doc: Add measured boot documentation

Briefly describe the feature and specify the requirements.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
13 months agotest: Add sandbox TPM boot measurement
Eddie James [Tue, 24 Oct 2023 15:43:51 +0000 (10:43 -0500)]
test: Add sandbox TPM boot measurement

Use the sandbox TPM driver to measure some boot images in a unit
test case.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
13 months agobootm: Support boot measurement
Eddie James [Tue, 24 Oct 2023 15:43:50 +0000 (10:43 -0500)]
bootm: Support boot measurement

Add a configuration option to measure the boot through the bootm
function. Add the measurement state to the booti and bootz paths
as well.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Ilias: Added some info on Kconfig explaining this is when booting !EFI
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
13 months agotpm: Support boot measurements
Eddie James [Tue, 24 Oct 2023 15:43:49 +0000 (10:43 -0500)]
tpm: Support boot measurements

Add TPM2 functions to support boot measurement. This includes
starting up the TPM, initializing/appending the event log, and
measuring the U-Boot version. Much of the code was used in the
EFI subsystem, so remove it there and use the common functions.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
For the API moving around from EFI -> u-boot core
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
For EFI testing
Tested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
13 months agotpm: sandbox: Update for needed TPM2 capabilities
Eddie James [Tue, 24 Oct 2023 15:43:48 +0000 (10:43 -0500)]
tpm: sandbox: Update for needed TPM2 capabilities

The driver needs to support getting the PCRs in the capabilities
command. Fix various other things and support the max number
of PCRs for TPM2.
Remove the !SANDBOX dependency for EFI TCG2 as well.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
13 months agotpm: Fix spelling for tpmu_ha union
Eddie James [Tue, 24 Oct 2023 15:43:47 +0000 (10:43 -0500)]
tpm: Fix spelling for tpmu_ha union

tmpu -> tpmu

Signed-off-by: Eddie James <eajames@linux.ibm.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
13 months agommc: tmio: Disable 1/1024 clock divider on Renesas R-Car platforms
Marek Vasut [Sun, 22 Oct 2023 21:40:43 +0000 (23:40 +0200)]
mmc: tmio: Disable 1/1024 clock divider on Renesas R-Car platforms

The R-Car Gen3 SD_CLK_CTRL register does not use BIT(16) to implement
divider 1/1024, instead BIT(16) is reserved bit and divider 1/1024 is
not supported. The divider 1/1024 is specific to Socionext variant of
the IP, as is indicated by Linux commit:

0196c8db8363 ("mmc: tmio: move tmio_mmc_set_clock() to platform hook")
"
Socionext (and Panasonic) uses bit 10 (CLKSEL) for 1/1.  Also, newer
versions of UniPhier SoC variants use bit 16 for 1/1024.
"

Do not set the TMIO_SD_CAP_DIV1024 on Renesas R-Car platforms even if
the IP VERSION register does exist, and indicates IP version is newer
or equal to version 1.0 . The IP version 1.0 or newer does not imply
presence of the 1/1024 divider.

Since the TMIO driver is used exactly by two supported platforms, that
is Renesas R-Car and Socionext UniPhier, it is OK to check whether the
TMIO_SD_CAP_RCAR capability is not set to identify the UniPhier platform
and add the capability only on that platform.

Fixes: 58c35b17aa8f ("mmc: matsushita-common: Always check controller version")
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Tested-by: Thuan Nguyen Hong <thuan.nguyen-hong@banvien.com.vn>
13 months agommc: tmio: Always check for errors after receiving an IRQ
Marek Vasut [Sat, 14 Oct 2023 21:56:03 +0000 (23:56 +0200)]
mmc: tmio: Always check for errors after receiving an IRQ

Unconditionally check for errors even after successful reception
of IRQ flag, since the hardware may set both an IRQ completion
flag and an error flag at the same time.

This mode of failure happens in case of an error during transfer,
in which case the hardware may set the expected IRQ completion
flag as well as error flags. The later is currently not checked
by the driver and such an error is not detected. Improve the
error detection.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Tested-by: Thuan Nguyen Hong <thuan.nguyen-hong@banvien.com.vn>
13 months agommc: sh_sdhi: Drop unused driver
Marek Vasut [Sat, 14 Oct 2023 21:27:24 +0000 (23:27 +0200)]
mmc: sh_sdhi: Drop unused driver

This driver is long superseded by renesas-sdhi.c and unused.
Drop the driver.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Paul Barker <paul.barker.ct@bp.renesas.com>
13 months agommc: renesas-sdhi: Fix error handling in rzg2l_sdhi_setup
Paul Barker [Thu, 19 Oct 2023 14:50:38 +0000 (15:50 +0100)]
mmc: renesas-sdhi: Fix error handling in rzg2l_sdhi_setup

We should ensure that reset_free() is called in the error path.

Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Fixes: 93c811b7331b ("mmc: renesas-sdhi: Initialize module on RZ/G2L")
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
13 months agoARM: meson: enable USB DFU + RAM on Amlogic boards with USB Gadget
Neil Armstrong [Mon, 23 Oct 2023 12:41:37 +0000 (14:41 +0200)]
ARM: meson: enable USB DFU + RAM on Amlogic boards with USB Gadget

Enable DFU as an alternate USB boot method when script wasn't
uploaded, this fixes USB full boot on G12/SM1 boards.

Link: https://lore.kernel.org/r/20231023-usb-dfu-boot-v1-4-df9d121c67c1@linaro.org
[narmstrong: remove dfu from ad401]
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
13 months agoconfigs: meson64: add alternate USB DFU boot target
Neil Armstrong [Mon, 23 Oct 2023 12:41:36 +0000 (14:41 +0200)]
configs: meson64: add alternate USB DFU boot target

Add boot over DFU RAM as an alternate to running script at
a fixed address like done today.

The main culprit is that it's not possible to do that
on G12A/Sm1 platforms due to changes in the USB boot protocol.

With this, U-Boot will present a DFU device with a ram slot where
the Host could write a fitImage or legacy U-Boot image, then with the
detach command boot will continue trying to boot the uploaded image.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://lore.kernel.org/r/20231023-usb-dfu-boot-v1-3-df9d121c67c1@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
13 months agoconfigs: meson64: declare addr out of EXTRA_ENV_SETTINGS
Neil Armstrong [Mon, 23 Oct 2023 12:41:35 +0000 (14:41 +0200)]
configs: meson64: declare addr out of EXTRA_ENV_SETTINGS

In order to reuse addresses for DFU RAM, define them separately,
it's cleaner and will be easier to override.

Link: https://lore.kernel.org/r/20231023-usb-dfu-boot-v1-2-df9d121c67c1@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
13 months agoARM: meson: enable FIT with LEGACY_IMAGE_FORMAT on all configs
Neil Armstrong [Mon, 23 Oct 2023 12:41:34 +0000 (14:41 +0200)]
ARM: meson: enable FIT with LEGACY_IMAGE_FORMAT on all configs

Allow all boards to boot with a fitImage, but keep support for
Legacy image format for now.

Link: https://lore.kernel.org/r/20231023-usb-dfu-boot-v1-1-df9d121c67c1@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
13 months agoconfigs: khadas-vim3*_android: fix environment saving
Mattijs Korpershoek [Thu, 26 Oct 2023 13:41:31 +0000 (15:41 +0200)]
configs: khadas-vim3*_android: fix environment saving

The environment is used to configure some additional boot features such as:
* extra boot arguments
* enable AVB (Android Verified Boot) verification

Right now, we cannot store it in eMMC:

  Loading Environment from nowhere... OK

Fix it by enabling the appropriate options in the defconfig

Fixes: b749d5ecdc06 ("configs: meson64_android: define raw parts for bootloader")
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20231026-fix-saveenv-v1-1-6aa59be65481@baylibre.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
13 months agoarm: kirkwood: Enable bootstd for Zyxel NSA310S board
Tony Dinh [Wed, 25 Oct 2023 22:38:37 +0000 (15:38 -0700)]
arm: kirkwood: Enable bootstd for Zyxel NSA310S board

Enable bootstd for Zyxel NSA310S board, and remove distroboot.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
13 months agocmd: mvebu/bubt: move eMMC data-partition uboot from LBA-0 to 4096
Josua Mayer [Wed, 25 Oct 2023 08:22:54 +0000 (10:22 +0200)]
cmd: mvebu/bubt: move eMMC data-partition uboot from LBA-0 to 4096

A38x bootrom only searches 2 sectors when booting from eMMC,
irregardless of data or boot partition: 0 & 4096.

For eMMC boot partitions sector 0 is fine, but on data partition it
conflicts with MBR.

Change bubt command default to 4096 for eMMC data partition only, to
allow using an MBR partition table on the eMMC data partition while also
booting from it.

Signed-off-by: Josua Mayer <josua@solid-run.com>
Reviewed-by: Stefan Roese <sr@denx.de>
13 months agoarm: mvebu: allow additional 4096 offset for bootable mmc image
Josua Mayer [Wed, 25 Oct 2023 08:22:53 +0000 (10:22 +0200)]
arm: mvebu: allow additional 4096 offset for bootable mmc image

Disarm the error message forcing u-boot/spl image to be located at
sector 0 on eMMC data-partition and microSD.
Offset 0 makes sense on eMMC boot partitions only, data partition must
use 4096 to avoid conflicting with MBR.

Valid offsets when booting from microSD, reported by boot-rom v1.73:

BootROM: Bad header at offset 00000200
BootROM: Bad header at offset 00004400
BootROM: Bad header at offset 00200000
BootROM: Bad header at offset 00400000
BootROM: Bad header at offset 00600000
BootROM: Bad header at offset 00800000
BootROM: Bad header at offset 00A00000
BootROM: Bad header at offset 00C00000
BootROM: Bad header at offset 00E00000
BootROM: Bad header at offset 01000000
BootROM: Bad header at offset 01200000
BootROM: Bad header at offset 01400000
BootROM: Bad header at offset 01600000
BootROM: Bad header at offset 01800000
BootROM: Bad header at offset 01A00000
BootROM: Bad header at offset 01C00000
BootROM: Bad header at offset 01E00000
BootROM: Bad header at offset 02000000
BootROM: Bad header at offset 02200000
BootROM: Bad header at offset 02400000
BootROM: Bad header at offset 02600000
BootROM: Bad header at offset 02800000
BootROM: Bad header at offset 02A00000
BootROM: Bad header at offset 02C00000
BootROM: Bad header at offset 02E00000

Valid offsets when booting from eMMC:

BootROM: Bad header at offset 00000000
BootROM: Bad header at offset 00200000
Switching BootPartitions.
BootROM: Bad header at offset 00000000
BootROM: Bad header at offset 00200000

Fixes: 2226ca17348 ("arm: mvebu: Load U-Boot proper binary in SPL code based on kwbimage header")
Signed-off-by: Josua Mayer <josua@solid-run.com>
Reviewed-by: Stefan Roese <sr@denx.de>
13 months agoarm: kirkwood: Enable bootstd for Pogo V4 board
Tony Dinh [Tue, 24 Oct 2023 23:17:08 +0000 (16:17 -0700)]
arm: kirkwood: Enable bootstd for Pogo V4 board

Enable bootstd for Pogo V4 board, and remove distroboot.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
13 months agoarm: mvebu: turris_mox: Extend to support RIPE Atlas Probe
Marek Behún [Fri, 20 Oct 2023 14:29:16 +0000 (16:29 +0200)]
arm: mvebu: turris_mox: Extend to support RIPE Atlas Probe

Extend Turris Mox board code to support CZ.NIC's RIPE Atlas Probe.

Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
13 months agodoc: build: update description of build dependencies for Alpine Linux
Milan P. Stanić [Tue, 17 Oct 2023 19:46:58 +0000 (21:46 +0200)]
doc: build: update description of build dependencies for Alpine Linux

Signed-off-by: Milan P. Stanić <mps@arvanta.net>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reformat and keep ncurses-dev needed for 'make menuconfig'
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
13 months agoMerge branch '2023-10-24-assorted-general-fixes-and-updates'
Tom Rini [Tue, 24 Oct 2023 23:12:21 +0000 (19:12 -0400)]
Merge branch '2023-10-24-assorted-general-fixes-and-updates'

- Remove common.h in a number of places and make checkpatch.pl complain
  about its use in all cases, allow the mbr command to handle 4 primary
  partitions, fix an issue with the pstore command, fix a problem with
  cli parsing of escape sequences, remove and ignore more files, allow
  for the serial port to be flushed with every print (for debugging),
  and add SCMI power domain support.

14 months agoserial: introduce CONFIG_CONSOLE_FLUSH_ON_NEWLINE
Rasmus Villemoes [Mon, 16 Oct 2023 08:35:22 +0000 (10:35 +0200)]
serial: introduce CONFIG_CONSOLE_FLUSH_ON_NEWLINE

When debugging, one sometimes only gets partial output lines or
nothing at all from the last printf, because the uart has a largish
buffer, and the code after the printf() may cause the CPU to hang
before the uart IP has time to actually emit all the characters. That
can be very confusing, because one doesn't then know exactly where the
hang happens.

Introduce a config knob allowing one to wait for the uart fifo to
drain whenever a newline character is printed, roughly corresponding
to the effect of setvbuf(..., _IOLBF, ...) in ordinary C programs.

Since this uses IS_ENABLED() instead of cpp ifdef, we can remove the
ifdef around the _serial_flush() definition - if neither
CONSOLE_FLUSH_SUPPORT or CONSOLE_FLUSH_ON_NEWLINE are enabled, the
compiler elides _serial_flush(), but it won't warn about it being
unused.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
14 months agoserial: serial-uclass.c: move definition of _serial_flush up a bit
Rasmus Villemoes [Mon, 16 Oct 2023 08:35:21 +0000 (10:35 +0200)]
serial: serial-uclass.c: move definition of _serial_flush up a bit

Preparation for next patch.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
14 months agotest: dm: add SCMI power domain protocol test
AKASHI Takahiro [Mon, 16 Oct 2023 05:39:46 +0000 (14:39 +0900)]
test: dm: add SCMI power domain protocol test

This ut has tests for the SCMI power domain protocol as well as DM
interfaces for power domain devices.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
14 months agosandbox: add SCMI power domain protocol support for testing
AKASHI Takahiro [Mon, 16 Oct 2023 05:39:45 +0000 (14:39 +0900)]
sandbox: add SCMI power domain protocol support for testing

SCMI power domain management protocol is supported on sandbox
for test purpose. Add fake agent interfaces and associated
power domain devices.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
14 months agopower: domain: add SCMI driver
AKASHI Takahiro [Mon, 16 Oct 2023 05:39:44 +0000 (14:39 +0900)]
power: domain: add SCMI driver

Add power domain driver based on SCMI power domain management protocol.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
14 months agofirmware: scmi: add power domain protocol support
AKASHI Takahiro [Mon, 16 Oct 2023 05:39:43 +0000 (14:39 +0900)]
firmware: scmi: add power domain protocol support

In this patch, added are helper functions to directly manipulate
SCMI power domain management protocol. DM compliant power domain
driver will be implemented on top of those interfaces in a succeeding
patch.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
14 months agocmd: mbr: Allow 4 MBR partitions without need for extended
Alexander Gendin [Mon, 9 Oct 2023 01:24:36 +0000 (01:24 +0000)]
cmd: mbr: Allow 4 MBR partitions without need for extended

Current code allows up to 3 MBR partitions without extended one.
If more than 3 partitions are required, then extended partition(s)
must be used.
This commit allows up to 4 primary MBR partitions without the
need for extended partition.

Add mbr test unit. In order to run the test manually, mmc6.img file
of size 12 MiB or greater is required in the same directory as u-boot.
Test also runs automatically via ./test/py/test.py tool.
Running mbr test is only supported in sandbox mode.

Signed-off-by: Alex Gendin <agendin@matrox.com>
[ And due to some further changes for testing ]
Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agopstore: Use root address-cells/size-cells as defaults for reserved-memory
Andrey Skvortsov [Sat, 26 Aug 2023 12:16:52 +0000 (15:16 +0300)]
pstore: Use root address-cells/size-cells as defaults for reserved-memory

u-boot adds reserve-memory node, if it's missing, with following
properties:

```
    reserved-memory {
         #address-cells = <2>;
         #size-cells = <2>;
         ranges;
    }
```

But with these default address-cells and size-cells values, pstore
isn't working on A64. Root node for A64 defines 'address-cells' and
'size-cells' as 1.

dtc complains if reserved-memory has different address-cells and
size-cells.

```
     Warning (ranges_format): /reserved-memory:ranges: empty "ranges"
     property but its #address-cells (2) differs from / (1)
```

This patch takes into account address-cells and size-cells of the root
node and uses them as values for new reserved-memory node.

Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
14 months ago.gitignore: ignore misc include, simple-bin, and tools/generated build artifacts
John Clark [Fri, 13 Oct 2023 13:26:16 +0000 (13:26 +0000)]
.gitignore: ignore misc include, simple-bin, and tools/generated build artifacts

make rock5b-rk3588_defconfig
make
git status

before
~~~~~~~
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

Untracked files:
  (use "git add <file>..." to include in what will be committed)
include/autoconf.mk
include/autoconf.mk.dep
include/config.h
mkimage-in-simple-bin-spi.mkimage-rockchip-tpl
mkimage-in-simple-bin-spi.mkimage-u-boot-spl
mkimage-in-simple-bin.mkimage-rockchip-tpl
mkimage-in-simple-bin.mkimage-u-boot-spl
simple-bin-spi.map
simple-bin.fit.fit
simple-bin.fit.itb
simple-bin.map
tools/generated/

after
~~~~~~~
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

Signed-off-by: John Clark <inindev@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
14 months agoMakefile: remove misc include and simple-bin build artifacts on clean
John Clark [Fri, 13 Oct 2023 13:23:07 +0000 (13:23 +0000)]
Makefile: remove misc include and simple-bin build artifacts on clean

make rock5b-rk3588_defconfig
make
make clean
git status

before
~~~~~~~
On branch master
Your branch is up to date with 'origin/master'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)
include/autoconf.mk
include/autoconf.mk.dep
include/config.h
mkimage-in-simple-bin-spi.mkimage-rockchip-tpl
mkimage-in-simple-bin-spi.mkimage-u-boot-spl
mkimage-in-simple-bin.mkimage-rockchip-tpl
mkimage-in-simple-bin.mkimage-u-boot-spl
simple-bin.fit.fit
simple-bin.fit.itb

after
~~~~~~~
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

Signed-off-by: John Clark <inindev@gmail.com>
14 months agoriscv: Remove common.h usage
Tom Rini [Thu, 12 Oct 2023 23:03:59 +0000 (19:03 -0400)]
riscv: Remove common.h usage

We can remove common.h from most cases of the code here, and only a few
places need an additional header instead.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Rick Chen <rick@andestech.com>
14 months agomips: Remove common.h usage
Tom Rini [Thu, 12 Oct 2023 23:03:58 +0000 (19:03 -0400)]
mips: Remove common.h usage

We can remove common.h from most cases of the code here, and only a few
places need an additional header instead.

Signed-off-by: Tom Rini <trini@konsulko.com>
14 months agomicroblaze: Remove common.h usage
Tom Rini [Thu, 12 Oct 2023 23:03:57 +0000 (19:03 -0400)]
microblaze: Remove common.h usage

We can remove common.h from most cases of the code here, and only a few
places need an additional header instead.

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Michal Simek <michal.simek@amd.com>
14 months agom68k: Remove common.h usage
Tom Rini [Thu, 12 Oct 2023 23:03:56 +0000 (19:03 -0400)]
m68k: Remove common.h usage

We can remove common.h from most cases of the code here, and only a few
places need an additional header instead.

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Angelo Dureghello <angelo@kernel-space.org>
14 months agoarc: Remove common.h usage
Tom Rini [Thu, 12 Oct 2023 23:03:55 +0000 (19:03 -0400)]
arc: Remove common.h usage

We can remove common.h from most cases of the code here, and only a few
places need an additional header instead.

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
14 months agoinclude: Add <linux/types.h> in a few places
Tom Rini [Thu, 12 Oct 2023 23:03:54 +0000 (19:03 -0400)]
include: Add <linux/types.h> in a few places

These files references a number of types that are defined in
<linux/types.h> (and so forth), so include it here rather than rely on
indirect inclusion.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
14 months agopatman: Add a little documentation on the checkpatch tests
Simon Glass [Fri, 13 Oct 2023 16:28:33 +0000 (09:28 -0700)]
patman: Add a little documentation on the checkpatch tests

These texts lack comments. Add some so that it is clearer what is going
on.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agocheckpatch.pl: Make common.h check boarder
Tom Rini [Fri, 13 Oct 2023 16:28:32 +0000 (09:28 -0700)]
checkpatch.pl: Make common.h check boarder

At this point in time we should not add common.h to any new files, so
make checkpatch.pl complain.

Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agocli: Consume invalid escape sequences early
Yurii Monakov [Tue, 10 Oct 2023 08:16:39 +0000 (11:16 +0300)]
cli: Consume invalid escape sequences early

Unexpected 'Esc' key presses are accumulated internally, even if it is
already clear that the current escape sequence is invalid. This results
in weird behaviour. For example, the next character after 'Esc' key
simply disappears from input and 'Unknown command' is printed
after 'Enter'.

This commit fixes some issues with extra 'Esc' keys entered by user:

1. Sequence <Esc><Esc><Enter> right after autoboot stop gives:
=>
nknown command 'ry 'help'
=>
2. Sequence <Esc><p><r><i><Enter> gives:
=> ri
Unknown command 'ri' - try 'help'
=>
3. Extra 'Esc' key presses break backspace functionality.

Signed-off-by: Yurii Monakov <monakov.y@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
14 months agoMerge tag 'u-boot-rockchip-20231024' of https://source.denx.de/u-boot/custodians...
Tom Rini [Tue, 24 Oct 2023 13:39:52 +0000 (09:39 -0400)]
Merge tag 'u-boot-rockchip-20231024' of https://source.denx.de/u-boot/custodians/u-boot-rockchip

- Add Board: rk3588 NanoPC-T6, Orange Pi 5, Orange Pi 5 Plus;
- clk driver fix for rk3568 and rk3588;
- rkmtd cmd support for rockchip nand device;
- dts update and sync from linux;

14 months agoMerge tag 'u-boot-imx-20231024' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
Tom Rini [Tue, 24 Oct 2023 13:39:02 +0000 (09:39 -0400)]
Merge tag 'u-boot-imx-20231024' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

u-boot-imx-20231024
-------------------

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

- Fixes for MC2432 Eeprom
- i.MX93 ADC
- Secondary boot mode on i.MX8M

14 months agorockchip: configs: sandbox: enable rkmtd command
Johan Jonker [Wed, 18 Oct 2023 14:02:32 +0000 (16:02 +0200)]
rockchip: configs: sandbox: enable rkmtd command

Enable rkmtd command for testing with sandbox_defconfig
and sandbox64_defconfig.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
14 months agorockchip: doc: add rkmtd.rst
Johan Jonker [Wed, 18 Oct 2023 14:02:19 +0000 (16:02 +0200)]
rockchip: doc: add rkmtd.rst

Add documention for Rockchip rkmtd virtual block device.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
14 months agorockchip: test: dm: add rkmtd test
Johan Jonker [Wed, 18 Oct 2023 14:01:59 +0000 (16:01 +0200)]
rockchip: test: dm: add rkmtd test

Add Rockchip rkmtd test:
Create/attach/detach RKMTD device.
Send/read data with Rockchip boot block header.
Test that reusing the same label should work.
Basic test of 'rkmtd' commands.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
14 months agorockchip: cmd: add rkmtd command
Johan Jonker [Wed, 18 Oct 2023 14:01:40 +0000 (16:01 +0200)]
rockchip: cmd: add rkmtd command

The command rkmtd creates a virtual block device to transfer
Rockchip boot block data to and from NAND with block orientated
tools like "ums" and "rockusb".

It uses the Rockchip MTD driver to scan for boot blocks and copies
data from the first block in a GPT formated virtual disk.
Data must be written in U-boot "idbloader.img" format and start at
partition "loader1" offset 64. The data header is parsed
for length and offset. When the last sector is received
it erases up to 5 erase blocks on NAND and writes bootblocks
in a pattern depending on the NAND ID. Data is then verified.
When a block turns out bad the block header is discarded.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
14 months agorockchip: block: blk-uclass: add bounce buffer flag to blk_desc
Johan Jonker [Wed, 18 Oct 2023 14:01:10 +0000 (16:01 +0200)]
rockchip: block: blk-uclass: add bounce buffer flag to blk_desc

Currently bounce buffer support is enabled for all block devices
when available. Add a flag to blk_desc to enable only on demand.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
14 months agorockchip: block: add rkmtd class and drivers
Johan Jonker [Wed, 18 Oct 2023 14:00:56 +0000 (16:00 +0200)]
rockchip: block: add rkmtd class and drivers

Add rkmtd class and drivers to create a virtual block device
to transfer Rockchip boot block data to and from NAND with
block orientated tools like "ums" and "rockusb".

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
14 months agorockchip: dm: prepare rkmtd UCLASS
Johan Jonker [Wed, 18 Oct 2023 14:00:40 +0000 (16:00 +0200)]
rockchip: dm: prepare rkmtd UCLASS

Prepare a rkmtd UCLASS in use for writing Rockchip boot blocks
in combination with existing userspace tools and rockusb command.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
14 months agomtd: nand: raw: rockchip_nfc: add NAND_SKIP_BBTSCAN option
Johan Jonker [Wed, 18 Oct 2023 14:00:27 +0000 (16:00 +0200)]
mtd: nand: raw: rockchip_nfc: add NAND_SKIP_BBTSCAN option

On Rockchip SoCs the first boot stages are written on NAND
with help of manufacturer software that uses a different format
then the MTD framework. Skip the automatic BBT scan with the
NAND_SKIP_BBTSCAN option to be able to pass the driver probe
function and to let the original data unchanged.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
14 months agoboard: rockchip: Add Xunlong Orange Pi 5 Plus
Jonas Karlman [Tue, 17 Oct 2023 21:40:22 +0000 (21:40 +0000)]
board: rockchip: Add Xunlong Orange Pi 5 Plus

Xunlong Orange Pi 5 Plus is a single-board computer based on the
Rockchip RK3588 SoC. The board provides abundant interfaces, including
two HDMI output ports, one HDMI input port, two 2.5G Ethernet ports,
M.2 M-Key slot, M.2 E-Key slot, two USB 3.0, two USB 2.0, and two Type-C.

Features tested on a Orange Pi 5 Plus 4GB v1.2:
- SD-card boot
- eMMC boot
- SPI Flash boot
- PCIe/NVMe
- USB 2.0 host
- Ethernet

Device tree is imported from linux v6.7-rockchip-dts64-1 tag.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
14 months agoboard: rockchip: Add Xunlong Orange Pi 5
Jonas Karlman [Tue, 17 Oct 2023 21:40:21 +0000 (21:40 +0000)]
board: rockchip: Add Xunlong Orange Pi 5

Xunlong Orange Pi 5 is a single-board computer based on the Rockchip
RK3588S SoC. The board provides abundant interfaces, HDMI output, GPIO
interface, M.2 PCIe2.0, Type-C, Gigabit LAN port, 2*USB2.0, 1*USB3.0,
etc.

Features tested on a Orange Pi 5 4GB v1.2:
- SD-card boot
- SPI Flash boot
- PCIe/NVMe
- USB 2.0 host
- Ethernet

Device tree is imported from linux v6.7-rockchip-dts64-1 tag.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
14 months agomtd: spi-nor: Add support for XMC XM25QU128C
Ricardo Pardini [Tue, 17 Oct 2023 21:40:20 +0000 (21:40 +0000)]
mtd: spi-nor: Add support for XMC XM25QU128C

Add support for XMC XM25QU128C (128M-bit) Serial Flash memory. Used on
the Xunlong Orange Pi 3B, 5 and 5 Plus boards.

Datasheet:
https://www.xmcwh.com/uploads/806/XM25QU128C_Ver2.0.pdf

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
[jonas@kwiboo.se: update commit message]
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
14 months agorockchip: rk3588-rock-5b: Sync USB3 nodes from mainline linux patches
Jonas Karlman [Tue, 17 Oct 2023 17:02:11 +0000 (17:02 +0000)]
rockchip: rk3588-rock-5b: Sync USB3 nodes from mainline linux patches

The device tree for rk3588 and rock-5b contain usb3 nodes that have
deviated too much from current state of submitted mainline linux usb3
patches, see [1].

Sync usb3 related nodes from latest patches and collaboras rk3588 tree
so that dwc3-generic driver can be updated to include support for the
rockchip,rk3588-dwc3 compatible in the future, use rockchip,rk3568-dwc3
compatible until final node is merged in linux maintainer tree.

[1] https://lore.kernel.org/lkml/20231009172129.43568-1-sebastian.reichel@collabora.com/

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
14 months agorockchip: rk3588-rock-5b: Enable support for PCIe SATA cards
Jonas Karlman [Tue, 17 Oct 2023 17:02:10 +0000 (17:02 +0000)]
rockchip: rk3588-rock-5b: Enable support for PCIe SATA cards

Enable support for PCIe SATA cards and the on-board SATA controller.

This also revert use of CONFIG_PCI_INIT_R in order to speed up boot from
eMMC or SD-cards. Standard boot will initialize pci after faster boot
media have been enumerated.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Christopher Obbard <chris.obbard@collabora.com>
Tested-by: Christopher Obbard <chris.obbard@collabora.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
14 months agorockchip: rk3588-rock-5a: Enable support for USB 2.0 ports
Jonas Karlman [Tue, 17 Oct 2023 17:02:09 +0000 (17:02 +0000)]
rockchip: rk3588-rock-5a: Enable support for USB 2.0 ports

Enable Kconfig options for the two USB 2.0 ports and bottom USB 3.0 port
on ROCK 5 Model A.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
14 months agorockchip: rk3588: Sync device tree from v6.7-rockchip-dts64-1 tag
Jonas Karlman [Tue, 17 Oct 2023 17:02:08 +0000 (17:02 +0000)]
rockchip: rk3588: Sync device tree from v6.7-rockchip-dts64-1 tag

Sync rk3588 device tree from v6.7-rockchip-dts64-1 tag.

Adds PCIe, button and led nodes to rk3588-evb1-v10 and rk3588-rock-5b
boards. Also remove includes from u-boot.dtsi-files that is no longer
needed.

Linux commits:
42145b7a8235 ("arm64: dts: rockchip: add PCIe network controller to rock-5b")
199cbd5f195a ("arm64: dts: rockchip: add PCIe for M.2 M-key to rock-5b")
da447ec38780 ("arm64: dts: rockchip: add PCIe for M.2 E-Key to rock-5b")
86a2024d95e2 ("arm64: dts: rockchip: add PCIe2 network controller to rk3588-evb1")
46bb398ea1d8 ("arm64: dts: rockchip: add PCIe3 bus to rk3588-evb1")
1c9a53ff7ece ("arm64: dts: rockchip: Add sdio node to rock-5b")
3eaf2abd11aa ("arm64: dts: rockchip: Add sfc node to rk3588s")
bf012368bb0a ("arm64: dts: rockchip: Add I2S2 M0 pin definitions to rk3588s")
3d77a3e51b0f ("arm64: dts: rockchip: Add UART9 M0 pin definitions to rk3588s")
0002c377e862 ("arm64: dts: rockchip: Remove duplicate regulator vcc3v3_wf from rock-5b")
a6169ab36923 ("arm64: dts: rockchip: Enable UART6 on rock-5b")
dd6dc0c4c126 ("arm64: dts: rockchip: Add AV1 decoder node to rk3588s")
afa933c208e5 ("arm64: dts: rockchip: add ADC buttons to rk3588-evb1")
7952cbbda301 ("arm64: dts: rockchip: add status LED to rock-5b")

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Christopher Obbard <chris.obbard@collabora.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
14 months agodt-bindings: leds: import common led bindings from linux v6.5
Tom Fitzhenry [Tue, 17 Oct 2023 15:59:25 +0000 (02:59 +1100)]
dt-bindings: leds: import common led bindings from linux v6.5

This brings in more colours, e.g. ORANGE needed for the QuartzPro64 DT.

Linux commits:
472d7b9e8141 ("dt-bindings: leds: Expand LED_COLOR_ID definitions")

Signed-off-by: Tom Fitzhenry <tom@tom-fitzhenry.me.uk>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
14 months agoPrepare v2024.01-rc1
Tom Rini [Mon, 23 Oct 2023 20:29:47 +0000 (16:29 -0400)]
Prepare v2024.01-rc1

Signed-off-by: Tom Rini <trini@konsulko.com>
14 months agoconfigs: Resync with savedefconfig
Tom Rini [Mon, 23 Oct 2023 19:08:23 +0000 (15:08 -0400)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
14 months agoMerge branch '2023-10-23-bootstd-fixes-and-improvements'
Tom Rini [Mon, 23 Oct 2023 19:01:08 +0000 (15:01 -0400)]
Merge branch '2023-10-23-bootstd-fixes-and-improvements'

- Fix a few bootstd issues that have been reported and ahci support to
  bootstd

14 months agobootstd: sata: bootdev scanning for ahci sata with no drive attached
Tony Dinh [Sat, 7 Oct 2023 03:34:28 +0000 (20:34 -0700)]
bootstd: sata: bootdev scanning for ahci sata with no drive attached

It's normal to have no SATA drive attached to the controller, so return a
successful status when there is no block device found after probing.

Note: this patch depends on the previous patch
https://patchwork.ozlabs.org/project/uboot/patch/20230917230649.30357-1-mibodhi@gmail.com/

Resend the right patch.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
14 months agobootstd: sata: Add bootstd support for ahci sata
Tony Dinh [Wed, 11 Oct 2023 20:26:42 +0000 (13:26 -0700)]
bootstd: sata: Add bootstd support for ahci sata

Add ahci sata bootdev and corresponding hunting function.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
14 months agobootstd: Scan all bootdevs in a boot_targets entry (take 2)
Simon Glass [Mon, 23 Oct 2023 07:02:13 +0000 (00:02 -0700)]
bootstd: Scan all bootdevs in a boot_targets entry (take 2)

When the boot_targets environment variable is used with the distro-boot
scripts, each device is included individually. For example, if there
are three mmc devices, then we will have something like:

   boot_targets="mmc0 mmc1 mmc2"

In contrast, standard boot supports specifying just the uclass, i.e.:

   boot_targets="mmc"

The intention is that this should scan all MMC devices, but in fact it
currently only scans the first.

Update the logic to handle this case, without required BOOTSTD_FULL to
be enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Date Huang <tjjh89017@hotmail.com>
Reported-by: Vincent Stehlé <vincent.stehle@arm.com>
Reported-by: Ivan Ivanov <ivan.ivanov@suse.com>
Tested-by: Ivan T.Ivanov <iivanov@suse.de>
14 months agobootstd: Correct logic for single uclass
Simon Glass [Mon, 23 Oct 2023 07:02:12 +0000 (00:02 -0700)]
bootstd: Correct logic for single uclass

The current logic for "bootflow mmc" is flawed since it checks the
uclass of the bootdev instead of its parent, the media device. Correct
this and add a test that covers this scenario.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Ivan T.Ivanov <iivanov@suse.de>
14 months agobootstd: Expand boot-ordering test to include USB
Simon Glass [Mon, 23 Oct 2023 07:02:11 +0000 (00:02 -0700)]
bootstd: Expand boot-ordering test to include USB

Scan the USB bus as well, so we can check that different uclasses work
correctly in boot_targets

update the function comment with more detail.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Ivan T.Ivanov <iivanov@suse.de>
14 months agoRevert "bootstd: Scan all bootdevs in a boot_targets entry"
Simon Glass [Mon, 23 Oct 2023 07:02:10 +0000 (00:02 -0700)]
Revert "bootstd: Scan all bootdevs in a boot_targets entry"

This commit was intended to allow all bootdevs in each boot_targets
entry to be scanned. However it causes bad ordering with bootdevs, e.g.
scanning Ethernet bootdevs when it should be keeping to mmc.

Revert it so we can try another approach.

This reverts commit e824d0d0c219bc6da767f13f90c5b00eefe929f0.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Ivan T.Ivanov <iivanov@suse.de>
14 months agoCI: Re-enable maintainer check
Tom Rini [Mon, 23 Oct 2023 15:37:47 +0000 (11:37 -0400)]
CI: Re-enable maintainer check

At this point we have all of the defconfigs maintained again, so
re-enable the check to prevent further regressions.

Signed-off-by: Tom Rini <trini@konsulko.com>
14 months agoae350: Update defconfig list
Tom Rini [Mon, 23 Oct 2023 15:28:53 +0000 (11:28 -0400)]
ae350: Update defconfig list

Update the list of defconfigs, this was missed with the last pull
request of the u-boot-riscv tree.

Signed-off-by: Tom Rini <trini@konsulko.com>
14 months agoMerge tag 'u-boot-at91-2024.01-b' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Mon, 23 Oct 2023 15:39:38 +0000 (11:39 -0400)]
Merge tag 'u-boot-at91-2024.01-b' of https://source.denx.de/u-boot/custodians/u-boot-at91

Second set of u-boot-at91 features for the 2024.01 cycle

This feature set a new board named Conclusive KSTR sama5d27 with some
small prerequisites patches.