pandora-u-boot.git
2 months agocore: ofnode_graph: Fix a comment
Miquel Raynal [Thu, 3 Apr 2025 07:39:01 +0000 (09:39 +0200)]
core: ofnode_graph: Fix a comment

Naming between the parameter list, the prototype and the main comment do
not match. Fix the comment which seems the be the one that is incorrect.

Fixes: 9057077cf4e1 ("core: ofnode: add of_graph parsing helpers")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agoMerge patch series "*** Add Ethernet boot support for AM62Ax + phyCORE-AM62 SoMs...
Tom Rini [Thu, 10 Apr 2025 21:04:09 +0000 (15:04 -0600)]
Merge patch series "*** Add Ethernet boot support for AM62Ax + phyCORE-AM62 SoMs ***"

Wadim Egorov <w.egorov@phytec.de> says:

Add general ethernet boot support for AM62Ax SoC.
Some of the work is based on TI's downstream u-boot patches found in
[1], patches touching code in mach-k3 and *.yaml board config files.

Also, provide defconfigs and device tree changes for phyCORE-AM62x and
phyCORE-AM62Ax to support booting via ethernet.

[1] https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1307981/sk-am62a-lp-rgmii-boot-mode-problem

Link: https://lore.kernel.org/r/20250325035824.2304200-1-w.egorov@phytec.de
2 months agoconfigs: Add phycore_am62ax_r5_ethboot_defconfig
Wadim Egorov [Tue, 25 Mar 2025 03:58:24 +0000 (04:58 +0100)]
configs: Add phycore_am62ax_r5_ethboot_defconfig

Provide a defconfig for booting the phycore-am62ax via Ethernet.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2 months agoboard: phytec: phycore_am62ax: Share ethernet resources with boot r5 core
Nathan Morrisson [Tue, 25 Mar 2025 03:58:23 +0000 (04:58 +0100)]
board: phytec: phycore_am62ax: Share ethernet resources with boot r5 core

During the U-Boot SPL R5 boot stage the code is running on the MAIN R5
core, which means a host ID of 36 is used for DM/TIFS communication,
see [1]. In order to enable Ethernet boot update the DMA resources used
to be shared with the MAIN R5 core instead of the MCU R5 core.

[1] https://software-dl.ti.com/tisci/esd/latest/5_soc_doc/am62ax/hosts.html

Based on patch 19 from https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1307981/sk-am62a-lp-rgmii-boot-mode-problem

Signed-off-by: Nathan Morrisson <nmorrisson@phytec.com>
Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2 months agoarch: arm: mach-k3: r5: am62ax: Update SoC auto-gen data to enable CPSW boot
Andreas Dannenberg [Tue, 25 Mar 2025 03:58:22 +0000 (04:58 +0100)]
arch: arm: mach-k3: r5: am62ax: Update SoC auto-gen data to enable CPSW boot

This data was generated using the ksswtool-autogen project with the
followig commit:

eed7492 ("soc: am62ax: Add cpsw_3guss_main_0 id to the dev list")

Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Signed-off-by: Nathan Morrisson <nmorrisson@phytec.com>
Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2 months agoarch: arm: mach-k3: am62a7: Probe CPSW NUSS in board_init_f()
Nathan Morrisson [Tue, 25 Mar 2025 03:58:21 +0000 (04:58 +0100)]
arch: arm: mach-k3: am62a7: Probe CPSW NUSS in board_init_f()

Probe CPSW NUSS in am62a7 board_init_f() to support ethernet boot.

Signed-off-by: Nathan Morrisson <nmorrisson@phytec.com>
Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2 months agoarch: arm: dts: k3-am62a7-phyboard-lyra-rdk-u-boot: Disable Ethernet2
Daniel Schultz [Tue, 25 Mar 2025 03:58:20 +0000 (04:58 +0100)]
arch: arm: dts: k3-am62a7-phyboard-lyra-rdk-u-boot: Disable Ethernet2

Don't initialize Ethernet2 in SPL. We cannot boot from that source anyways
and it throws an error during boot.

This will remove following error message during network boot:

Error: ethernet@8000000port@2 No valid MAC address found.ethernet@8000000port@1
Waiting for PHY auto negotiation to complete....... done

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2 months agoconfigs: phycore_am62x_a53_defconfig: Update for ethernet boot
Wadim Egorov [Tue, 25 Mar 2025 03:58:19 +0000 (04:58 +0100)]
configs: phycore_am62x_a53_defconfig: Update for ethernet boot

Add support for ethernet boot in the A53 SPL. Increase the SPL Size
limit and update SPL_STACK_R_ADDR.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2 months agoconfigs: Add phycore_am62x_r5_ethboot_defconfig
Wadim Egorov [Tue, 25 Mar 2025 03:58:18 +0000 (04:58 +0100)]
configs: Add phycore_am62x_r5_ethboot_defconfig

Provide a defconfig for booting the phycore-am62x via Ethernet.
We need a separate defconfig because the AM62x has not enough internal
SRAM to support all boot sources.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2 months agoarm: dts: k3-am625-phyboard-lyra-rdk: Add boot phase tag to phy_gmii_sel
Wadim Egorov [Tue, 25 Mar 2025 03:58:17 +0000 (04:58 +0100)]
arm: dts: k3-am625-phyboard-lyra-rdk: Add boot phase tag to phy_gmii_sel

Add bootph-all tag to phy_gmii_sel node. This is needed for booting via
Ethernet. While at it, drop main_pktdma reg redefinitions which are already
provided by the top-level SoC device tree file.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Tested-by: Daniel Schultz <d.schultz@phytec.de>
2 months agoMerge patch series "scsi: ensure writes are flushed to disk"
Tom Rini [Thu, 10 Apr 2025 20:21:46 +0000 (14:21 -0600)]
Merge patch series "scsi: ensure writes are flushed to disk"

Caleb Connolly <caleb.connolly@linaro.org> says:

SCSI devices like UFS may maintain their own cache to speed up writes,
however this is lost on board reset (and may be lost on device removal
or reset by OS drivers).

Currently this can be worked around by "waiting for a while" after
writing data to disk, but of course this is not an acceptable solution.

Ideally U-Boot would have a mechanism to flush caches during board
reset, but until that logic is hooked up let's be sure that all writes
are actually propagated to the storage device so that we don't lose data
on board reset.

The same logic was already implemented just for the AHCI backend, this
duplicated logic has been removed and support for the SYNC_CACHE command
is added to AHCI.

This is particularly noticeable during capsule updates, since the update
file is deleted and the board is reset immediately afterwards which
resulted in the same capsule update being applied over and over again.

This specifically fixes Qualcomm SDM845 devices with UFS 2.1, but likely
all UFS devices that use a cache.

Link: https://lore.kernel.org/r/20250326-scsi-sync-on-write-v2-0-12ab05bd464b@linaro.org
2 months agoata: ahci: implement SCSI_SYNC_CACHE
Caleb Connolly [Wed, 26 Mar 2025 12:24:10 +0000 (13:24 +0100)]
ata: ahci: implement SCSI_SYNC_CACHE

The SCSI layer now issues a SYNC_CACHE command after every write to
ensure there is no data loss due to a board reset after write.

Implement support for this command and remove the same logic from the
ATA write path to be consistent with other SCSI backends.

Ranges are not supported and the whole cache will be flushed in all
cases.

This was done per iteration in ata_scsiop_read_write(), but it's not
clear why this was the case, calling it once for the entire write ought
to achieve the same result.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoscsi: sync cache on write
Caleb Connolly [Wed, 26 Mar 2025 12:24:09 +0000 (13:24 +0100)]
scsi: sync cache on write

We don't have a mechanism to safely shutdown block devices prior to a
baord reset or driver removal. Prevent data loss by synchronizing the
SCSI cache after every write.

In particular this solves the issue of capsule updates looping on some
devices because the board resets immediately after deleting the capsule
file and this write wouldn't be flushed in time.

This may impact NAND wear, but should be negligible given the usecases
for disk write in U-Boot.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoscsi: fix typo in setup_read_ext()
Caleb Connolly [Wed, 26 Mar 2025 12:24:08 +0000 (13:24 +0100)]
scsi: fix typo in setup_read_ext()

This clears the 6th byte of cmd twice rather than setting the 9th byte
to 0. Fix it.

The only other command that sets the 9th byte is the 64-bit read, so
this likely never caused issues in practise.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoMerge patch series "Add UBIFS Support"
Tom Rini [Thu, 10 Apr 2025 20:21:34 +0000 (14:21 -0600)]
Merge patch series "Add UBIFS Support"

Santhosh Kumar K <s-k6@ti.com> says:

This series adds support for UBIFS in AM64x, AM62x, AM62Px.

Test logs: https://gist.github.com/santhosh21/be687f10086fe3b02d76cf5126a99861

Link: https://lore.kernel.org/r/20250326121220.1831975-1-s-k6@ti.com
2 months agoconfigs: am62px: Add UBIFS support
Santhosh Kumar K [Wed, 26 Mar 2025 12:12:20 +0000 (17:42 +0530)]
configs: am62px: Add UBIFS support

Add UBIFS support on top of MTD devices by enabling the required
configs.

Signed-off-by: Santhosh Kumar K <s-k6@ti.com>
2 months agoconfigs: am62x: Add UBIFS support
Santhosh Kumar K [Wed, 26 Mar 2025 12:12:19 +0000 (17:42 +0530)]
configs: am62x: Add UBIFS support

Add UBIFS support on top of MTD devices by enabling the required
configs.

Signed-off-by: Santhosh Kumar K <s-k6@ti.com>
2 months agoconfigs: am64x: Add UBIFS support
Santhosh Kumar K [Wed, 26 Mar 2025 12:12:18 +0000 (17:42 +0530)]
configs: am64x: Add UBIFS support

Add UBIFS support on top of MTD devices by enabling the required
configs.

Signed-off-by: Santhosh Kumar K <s-k6@ti.com>
2 months agodtc: introduce label relative path references
Patrice Chotard [Fri, 28 Mar 2025 16:31:15 +0000 (17:31 +0100)]
dtc: introduce label relative path references

Since introduction of OF_UPSTREAM flag, U-Boot's dtc must be able
to compile Kernel's device tree.

Since kernel commit 7de129f5389b ("ARM: dts: stm32: stm32mp151a-prtt1l:
Fix QSPI configuration"), label relative path references has been
introduced. These label relative path references is not supported
by current U-Boot dtc version 1.5.0: (see mailing list discussion [1]).

In order to support such label relative patch references
adds following commit from upstream DTC tree:

commit 651410e54cb9 ("util: introduce xstrndup helper")
commit ec7986e682cf ("dtc: introduce label relative path references")

[1] https://lore.kernel.org/all/20250115144428.GZ3476@bill-the-cat/T/

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 months agoenv: mmc: Fix test for ENV_IS_EMBEDDED
Tom Rini [Tue, 1 Apr 2025 16:21:25 +0000 (10:21 -0600)]
env: mmc: Fix test for ENV_IS_EMBEDDED

The symbol "ENV_IS_EMBEDDED" is an environment internal define and not a
real CONFIG symbol. The IS_ENABLED() macro is still valid to use here,
so update the check.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agotools: add pkg-config for preload_check_sign
Raymond Mao [Thu, 27 Mar 2025 23:10:44 +0000 (16:10 -0700)]
tools: add pkg-config for preload_check_sign

The cflags and ldflags of preload_check_sign depend on the openssl
package thus pkg-config is needed to get the location where openssl
is installed.
This fix a potential build failure when openssl is not from the
distro and installed in a varied place.

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
2 months agotest/py: memtest: Fix test for non-trivial parameters
Andrew Goodbody [Fri, 28 Mar 2025 16:30:37 +0000 (16:30 +0000)]
test/py: memtest: Fix test for non-trivial parameters

When using non-trivial values for parameters for this test it
will cause a spurious failure as the test passes a decimal value
to the mtest command which will interpret it as hexadecimal and
result in failure as below.

test/py/tests/test_memtest.py:66: in test_memtest_ddr
    assert expected_response in response
E   AssertionError: assert 'Tested 16 iteration(s) with 0 errors.' in 'Refusing to do empty test\r\nmtest - simple RAM read/write test\r\n\r\nUsage:\r\nmtest [start [end [pattern [iterations]]]]'
----------------------------- Captured stdout call -----------------------------
U-Boot> mtest 134217728 0x8001000 90 0x10
Refusing to do empty test
mtest - simple RAM read/write test
Usage:
mtest [start [end [pattern [iterations]]]]

The fix is to ensure that all the parameters to the mtest command are
passed as hexadecimal values.

Fixes: 22efc1cf276c ("test/py: memtest: Add tests for mtest command")
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Love Kumar <love.kumar@amd.com>
2 months agopatman: Show base commit on each patch when no cover letter
Simon Glass [Fri, 28 Mar 2025 13:02:20 +0000 (07:02 -0600)]
patman: Show base commit on each patch when no cover letter

If a series is sent without a cover letter, there is no indication of
the base commit. Add support for this, since single patches of small
series may not always have a cover letter.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agobinman: Fix a typo in elf.py
Simon Glass [Fri, 28 Mar 2025 13:02:08 +0000 (07:02 -0600)]
binman: Fix a typo in elf.py

Fix an 'EFL' typo. It should be 'ELF'.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
2 months agopatman: Show the base commit and branch
Simon Glass [Thu, 27 Feb 2025 19:27:30 +0000 (12:27 -0700)]
patman: Show the base commit and branch

It is helpful to know which commit patches are based on, even if that
commit might not be available to readers. Add a tag for this in the
cover letter.

Also add the local-branch name since that may be useful to the writer.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoCI: Move to latest container images
Tom Rini [Thu, 10 Apr 2025 15:15:05 +0000 (09:15 -0600)]
CI: Move to latest container images

- Bump up "Jammy" tag to jammy-20250404
- Include most recent changes to the Dockerfile itself

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agoDockerfile: Add fdisk
Tom Rini [Thu, 10 Apr 2025 16:54:03 +0000 (10:54 -0600)]
Dockerfile: Add fdisk

We had previously gotten this package through a chain of dependencies
with guestfs-tools. Now that we no longer install that package, install
fdisk (for sfdisk) directly.

Fixes: eb1b90ec57a4 ("Dockerfile: Update to drop virt-make-fs packages")
Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agoDockerfile: Download the Arm FVP and extract it
Tom Rini [Tue, 8 Apr 2025 20:21:41 +0000 (14:21 -0600)]
Dockerfile: Download the Arm FVP and extract it

There are some reference platforms from Arm which are not found in QEMU
but instead in the FVP tool. As we can make use of this in CI later on,
download and extract it in our Dockerfile today.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agoDockerfile: Update to a more current TF-A release tag
Tom Rini [Tue, 8 Apr 2025 20:21:40 +0000 (14:21 -0600)]
Dockerfile: Update to a more current TF-A release tag

In preparation for using TF-A more in our CI loops, switch to the
current release tag for TF-A.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agoDockerfile: install byacc
Leonard Anderweit [Tue, 1 Apr 2025 08:46:41 +0000 (10:46 +0200)]
Dockerfile: install byacc

Install byacc required to build cst from source.

Signed-off-by: Leonard Anderweit <l.anderweit@phytec.de>
2 months agoDockerfile: Update to gcc-14.2.0 and clang-18
Tom Rini [Tue, 28 Jan 2025 23:02:05 +0000 (17:02 -0600)]
Dockerfile: Update to gcc-14.2.0 and clang-18

Outside of changing versions here the other visible change is that we
tell grub that riscv64 does not have "large model" support. Without this
change the resulting mkimage is non-functional. This is known upstream
already.

Link: https://savannah.gnu.org/bugs/?65909
Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agoMerge tag 'u-boot-dfu-20250410' of https://source.denx.de/u-boot/custodians/u-boot-dfu
Tom Rini [Thu, 10 Apr 2025 14:01:11 +0000 (08:01 -0600)]
Merge tag 'u-boot-dfu-20250410' of https://source.denx.de/u-boot/custodians/u-boot-dfu

u-boot-dfu-20250410

CI:
- https://source.denx.de/u-boot/custodians/u-boot-dfu/-/pipelines/25615

Usb gadget:
- Add SAM9X60 support to atmel driver
- Fix memory leaks in f_mass_storage gadget driver
- Fix comment typo in dwc3 gadget driver

Fastboot:
- Lift restrictions on !NET_LWIP for USB

Android:
- Fix possible NULL ptr when AVB is out of memory

2 months agobootstd: android: avoid possible null pointer dereference
Gary Bisson [Wed, 2 Apr 2025 14:42:19 +0000 (16:42 +0200)]
bootstd: android: avoid possible null pointer dereference

- avb_slot_verify_data_free() doesn't check its data parameter
- out_data can be null if avb_slot_verify() fails to allocate memory

Signed-off-by: Gary Bisson <bisson.gary@gmail.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Link: https://lore.kernel.org/r/20250402144219.1875067-1-bisson.gary@gmail.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2 months agousb: gadget: atmel: Add SAM9X60 support
Zixun LI [Mon, 31 Mar 2025 16:26:07 +0000 (18:26 +0200)]
usb: gadget: atmel: Add SAM9X60 support

Compared to SAM9X5 the only difference is the DPRAM memory from the
USB High Speed Device Port (UDPHS) hardware block was increased,
so we can reuse the same endpoint data.

Also add compatible "microchip,sam9x60-udc".

Signed-off-by: Zixun LI <admin@hifiphile.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Link: https://lore.kernel.org/r/20250331162611.1557759-2-admin@hifiphile.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2 months agousb: gadget: f_mass_storage: Fix memory leak of fsg buffers
Mattijs Korpershoek [Fri, 28 Mar 2025 08:15:44 +0000 (09:15 +0100)]
usb: gadget: f_mass_storage: Fix memory leak of fsg buffers

In fsg_common_init, we allocate some buffers via memalign().
However, these buffers are never freed.

Because of that, we cannot call => ums command multiple times on boards
with low memory (CONFIG_SYS_MALLOC_LEN=0x81000):

=> ums 0 mmc 2
UMS: LUN 0, dev mmc 2, hwpart 0, sector 0x0, count 0x3a3e000
|crq->brequest:0x0
CTRL+C - Operation aborted
=> ums 0 mmc 2
UMS: LUN 0, dev mmc 2, hwpart 0, sector 0x0, count 0x3a3e000
failed to start <NULL>: -12
g_dnl_register: failed!, error: -12
g_dnl_register failed

Make sure the fsg buffers are freed when the gadget is unbound by
calling fsg_common_release() in fsg_unbind().

Reported-by: Zixun LI <admin@hifiphile.com>
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Zixun LI <admin@hifiphile.com> # on SAM9X60
Link: https://lore.kernel.org/r/20250328-ums-gadget-leak-v1-4-3b677db99bde@baylibre.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2 months agousb: gadget: f_mass_storage: Fix NULL dereference in fsg_add()
Mattijs Korpershoek [Fri, 28 Mar 2025 08:15:43 +0000 (09:15 +0100)]
usb: gadget: f_mass_storage: Fix NULL dereference in fsg_add()

fsg_common_init() can fail when memory is low. In that case, it returns
PTR_ERR().
fsg_add() does not check for failure, and thus dereferences an invalid
fsg_common later, which crashes.

Verify if we receive an error from fsg_common_init() and handle it
gracefully.

Reported-by: Zixun LI <admin@hifiphile.com>
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Zixun LI <admin@hifiphile.com> # on SAM9X60
Link: https://lore.kernel.org/r/20250328-ums-gadget-leak-v1-3-3b677db99bde@baylibre.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2 months agousb: gadget: f_mass_storage: Drop invalid kfree() in fsg_common_release()
Mattijs Korpershoek [Fri, 28 Mar 2025 08:15:42 +0000 (09:15 +0100)]
usb: gadget: f_mass_storage: Drop invalid kfree() in fsg_common_release()

Boards with low memory (CONFIG_SYS_MALLOC_LEN=0x81000), can be crashed
using the => ums command twice in row:

=> ums 0 mmc 2
UMS: LUN 0, dev mmc 2, hwpart 0, sector 0x0, count 0x3a3e000
|crq->brequest:0x0
CTRL+C - Operation aborted
=> ums 0 mmc 2
UMS: LUN 0, dev mmc 2, hwpart 0, sector 0x0, count 0x3a3e000
"Synchronous Abort" handler, esr 0x96000004, far 0xfffffffff2ea20f0
elr: 000000000102ea78 lr : 000000000105e028 (reloc)
elr: 00000000f2f33a78 lr : 00000000f2f63028
x0 : 0000000100000000 x1 : 0000000100000000
x2 : 0000000000000000 x3 : fffffffff2ea20e0
x4 : 00000000f2fc9720 x5 : 00000000f2ea20e0
x6 : 00000000f2fc9730 x7 : 00000000f2ee4780
x8 : 000000000000003f x9 : 0000000000000004
x10: 0000000000000058 x11: 00000000000058c4
x12: 0000000000000000 x13: 00000000f2e60800
x14: 00000000f4ec0040 x15: 0000000000000000
x16: 00000000f2f62f2c x17: 0000000000c0c0c0
x18: 00000000f2e73e00 x19: 00000000f2ea2010
x20: 00000000fffffff4 x21: 00000000f2e9b500
x22: 00000000f2ea20f0 x23: 00000000f2ea2050
x24: 00000000f2f61eec x25: 00000000f2fcf000
x26: 00000000f2e9fcd0 x27: 0000000000000000
x28: 0000000000000000 x29: 00000000f2e60290

Code: d00004a6 911cc0c6 cb000063 8b000021 (f9400860)
Resetting CPU ...

This happens when fsg_common_init() fails to allocate memory and calls
fsg_common_release().
fsg_common_release() then calls kfree() which frees common->luns.
However, common->luns was never allocated via kmalloc/calloc(),
resulting in a crash.

Drop the invalid kfree. The memory from common->luns will be
reclaimed when we kfree(common) later in fgs_common_release().

Reported-by: Zixun LI <admin@hifiphile.com>
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Zixun LI <admin@hifiphile.com> # on SAM9X60
Link: https://lore.kernel.org/r/20250328-ums-gadget-leak-v1-2-3b677db99bde@baylibre.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2 months agousb: gadget: f_mass_storage: Remove kref structure use
Mattijs Korpershoek [Fri, 28 Mar 2025 08:15:41 +0000 (09:15 +0100)]
usb: gadget: f_mass_storage: Remove kref structure use

The kref structure is locally to f_mass_storage and is not used
anywhere beside in fsg_common_release().

Remove it and use struct fsg_common* instead.

No functional change.

Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Zixun LI <admin@hifiphile.com> # on SAM9X60
Link: https://lore.kernel.org/r/20250328-ums-gadget-leak-v1-1-3b677db99bde@baylibre.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2 months agofastboot: lift restrictions on !NET_LWIP for USB
Michael Walle [Wed, 12 Mar 2025 07:36:55 +0000 (08:36 +0100)]
fastboot: lift restrictions on !NET_LWIP for USB

Fastboot works either over TCP, UDP or USB. The latter doesn't have
anything to do with networking, thus should work just fine with
regardless which network stack is selected. In practice, header symbols
are used inside common code paths. Add some ifdeffery to guard against
that.

This will make fastboot over USB work with the new LWIP stack.

Signed-off-by: Michael Walle <mwalle@kernel.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20250312073655.2281377-1-mwalle@kernel.org
Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2 months agousb: dwc3: gadget: Fix excepts/expects typo
Marek Vasut [Mon, 24 Mar 2025 14:39:43 +0000 (15:39 +0100)]
usb: dwc3: gadget: Fix excepts/expects typo

Fix the excepts typo to expects , no functional change.

Fixes: 0916053ebc56 ("usb: dwc3: gadget: Fix match_ep callback for NXP UUU tool")
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20250324143956.91791-1-marex@denx.de
Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2 months agoCI: Disable evb-ast2600
Tom Rini [Thu, 10 Apr 2025 00:31:21 +0000 (18:31 -0600)]
CI: Disable evb-ast2600

Currently, this platform is failing in CI due to seemingly platform
specific reasons. For now, remove it from CI until the maintainers have
a chance to look in to it.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agoMerge patch series "Annotate switch/case fallthrough cases"
Tom Rini [Tue, 8 Apr 2025 22:24:12 +0000 (16:24 -0600)]
Merge patch series "Annotate switch/case fallthrough cases"

Andre Przywara <andre.przywara@arm.com> says:

C's implicit fallthrough behaviour in switch/case statements can lead to
subtle bugs. Quite some while ago many compilers introduced warnings in
those cases, requiring intentional fallthrough's to be annotated.

So far we were not enabling that compiler option, so many ambiguities
and some bugs in the code went unnoticed.

This series adds the required annotations in code paths that the first
stage of the U-Boot CI covers. There is a large number of cases left
in the libbz2 code. The usage of switch/case is borderline insane there,
labels are hidden in macros, and there are no breaks, but just goto's.
Upstream still uses very similar code, without any annotations. I still
am not 100% sure those are meant to fall through or not, and plan to do
further investigations, but didn't want to hold the rest of the patches
back. You can see for yourself by applying patch 18/18 and building for
sandbox64, for instance.

Because of this we cannot quite enable the warning in the Makefile yet,
but those fixes are worth regardless, and be it to increase readability.

Please note that those patches do not fix anything, really, they just add
those fallthrough annotations, so the series is not really critical.

Link: https://lore.kernel.org/r/20250327153313.2105227-1-andre.przywara@arm.com
2 months agocmd: spl: annotate switch/case fallthrough
Andre Przywara [Thu, 27 Mar 2025 15:33:12 +0000 (15:33 +0000)]
cmd: spl: annotate switch/case fallthrough

The argument parsing in the SPL configuration command uses an implicit
switch/case fallthrough when dealing with a different number of
arguments.

Add our "fallthrough;" statement-like macro before the respective labels
in the bootm code, to avoid a warning when GCC's -Wimplicit-fallthrough
warning option is enabled.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 months agocmd: pmic: annotate switch/case fallthrough
Andre Przywara [Thu, 27 Mar 2025 15:33:11 +0000 (15:33 +0000)]
cmd: pmic: annotate switch/case fallthrough

The argument parsing code in the pmic command uses an implicit switch/case
fallthrough to handle the common part of having one or two arguments.

Add our "fallthrough;" statement-like macro before the second branch in
the parsing code, to avoid a warning when GCC's -Wimplicit-fallthrough
warning option is enabled.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 months agomtd: rawnand: nand_base: annotate switch/case fallthrough
Andre Przywara [Thu, 27 Mar 2025 15:33:10 +0000 (15:33 +0000)]
mtd: rawnand: nand_base: annotate switch/case fallthrough

The raw NAND flash code uses an implicit switch/case fallthrough to
share code when dealing with different ECC modes, and also when handling
some read command.

Add our "fallthrough;" statement-like macro before the respective labels
in the NAND code, to avoid a warning when GCC's -Wimplicit-fallthrough
warning option is enabled.

This copies the fallthrough annotations that the original kernel code
gained, before this function got refactored there.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Michael Trimrachi <michael@amarulasolutions.com>
2 months agomtd: spi-nor-tiny: annotate switch/case fallthrough
Andre Przywara [Thu, 27 Mar 2025 15:33:09 +0000 (15:33 +0000)]
mtd: spi-nor-tiny: annotate switch/case fallthrough

The SPI NOR code uses an implicit switch/case fallthrough when checking
different vendors to determine how to deal with extended addressig modes.

Add our "fallthrough;" statement-like macro before some label in the
4-byte addressing mode code, to avoid a warning when GCC's
-Wimplicit-fallthrough warning option is enabled.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 months agoarm: mach-k3: am62p: annotate switch/case fallthrough
Andre Przywara [Thu, 27 Mar 2025 15:33:08 +0000 (15:33 +0000)]
arm: mach-k3: am62p: annotate switch/case fallthrough

The MMC boot mode selection for the TI AM62P series of SoCs uses an
implicit switch/case fallthrough for falling back to some default
boot mode.

Add our "fallthrough;" statement-like macro before the default branch in
the code, to avoid a warning when GCC's -Wimplicit-fallthrough warning
option is enabled.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 months agomtd: ubi: annotate fallthrough
Andre Przywara [Thu, 27 Mar 2025 15:33:07 +0000 (15:33 +0000)]
mtd: ubi: annotate fallthrough

The UBI code uses an implicit switch/case fallthrough when handling two
related cases of bad header errors. Also there is a switch/case for unit
prefix handling (G/M/K), which accumulates multiplications.

Add our "fallthrough;" statement-like macro before the respective labels
in both cases, to avoid a warning when GCC's -Wimplicit-fallthrough
warning option is enabled.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
2 months agonet: e1000: annotate switch/case fallthrough
Andre Przywara [Thu, 27 Mar 2025 15:33:06 +0000 (15:33 +0000)]
net: e1000: annotate switch/case fallthrough

The E1000 driver uses an implicit switch/case fallthrough for sharing
some code supporting different PHYs.

Add our "fallthrough;" statement-like macro before the two labels in
e1000_set_phy_type(), to avoid a warning when GCC's -Wimplicit-fallthrough
warning option is enabled.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 months agovideo: annotate switch/case fall-through
Andre Przywara [Thu, 27 Mar 2025 15:33:05 +0000 (15:33 +0000)]
video: annotate switch/case fall-through

The generic DM video code uses an implicit switch/case fallthrough to
provide fallback code paths when certain colour depths are not enabled.

Add our "fallthrough;" statement-like macro to the video_fill() function
to avoid a warning when GCC's -Wimplicit-fallthrough warning option is
enabled.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 months agousb: xhci: annotate switch/case fallthrough properly
Andre Przywara [Thu, 27 Mar 2025 15:33:04 +0000 (15:33 +0000)]
usb: xhci: annotate switch/case fallthrough properly

The USB XHCI code uses an implicit switch/case fallthrough to share code
for handling full speed and low speed transfers.

Add our "fallthrough;" statement-like macro before the second label in
the XHCI code, to avoid a warning when GCC's -Wimplicit-fallthrough
warning option is enabled.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 months agousb: ohci-hcd: annotate switch/case fallthrough
Andre Przywara [Thu, 27 Mar 2025 15:33:03 +0000 (15:33 +0000)]
usb: ohci-hcd: annotate switch/case fallthrough

The USB OCHI code uses an implicit switch/case fallthrough after checking
for valid descriptor IDs.

Add our "fallthrough;" statement-like macro before the default branch in
the OHCI code, to avoid a warning when GCC's -Wimplicit-fallthrough
warning option is enabled.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 months agonet: sun8i-emac: annotate fallthrough
Andre Przywara [Thu, 27 Mar 2025 15:33:02 +0000 (15:33 +0000)]
net: sun8i-emac: annotate fallthrough

The Allwinner sun8i EMAC driver uses an implicit switch/case fallthrough
when setting up the MAC/PHY communication protocol, to handle the case
when RMII is requested, but would not be supported by the hardware.

Add our "fallthrough;" statement-like macro before the default branch in
sun8i_emac_set_syscon(), to avoid a warning when GCC's
-Wimplicit-fallthrough warning option is enabled.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 months agofastboot: annotate switch/case fallthrough case
Andre Przywara [Thu, 27 Mar 2025 15:33:01 +0000 (15:33 +0000)]
fastboot: annotate switch/case fallthrough case

The fastboot command handling uses an implicit switch/case fallthrough
when receiving the OEM_CONSOLE command, but when this command is not
enabled in Kconfig, to report this command as unknown.

Add our "fallthrough;" statement-like macro before the default branch in
the fastboot code, to avoid a warning when GCC's -Wimplicit-fallthrough
warning option is enabled.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2 months agouse proper fallthrough annotations
Andre Przywara [Thu, 27 Mar 2025 15:32:59 +0000 (15:32 +0000)]
use proper fallthrough annotations

In some cases in the generic code, we were already using switch/case
fallthrough annotations comments, though in a way which might not be
understood by most compilers.

Replace two non-standard /* no break */ comments with our fallthrough;
statement-like macro, to make this visible to the compiler.
Also use this macro in place of an /* Fall through */ comment, to be
more consistent.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 months agogadget: f_thor: annotate switch/case fallthrough
Andre Przywara [Thu, 27 Mar 2025 15:32:58 +0000 (15:32 +0000)]
gadget: f_thor: annotate switch/case fallthrough

Even though we seem to catch POWEROFF and EFSCLEAR commands in the THOR
protocol request handling, we ultimately do not seem to handle them
(apart from sending a response), so those commands still print an error
message.

Annotate the switch/case fallthrough in this case, to make this clear to
the compiler.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2 months agozlib: annotate switch/case fallthrough cases
Andre Przywara [Thu, 27 Mar 2025 15:32:57 +0000 (15:32 +0000)]
zlib: annotate switch/case fallthrough cases

The inflate state machine in zlib uses switch/case fall-through's
extensively, as it sometimes advances the state, and lets the
conveniently placed next case statement handle the new state already.
The pattern here is:
state->mode = LEN;
case LEN:

Annotate those occasions with the "fallthrough;" macro, to let compilers
know this is fine when using -Wimplicit-fallthrough.

This mimics the upstream commit 76f70abbc73f:
Author:  Mark Adler <madler@alumni.caltech.edu>
Date:    Sun Mar 27 00:12:38 2022 -0700
Subject: Add fallthrough comments for gcc.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Link: https://github.com/madler/zlib/commit/76f70abbc73f
Reviewed-by: Tom Rini <trini@konsulko.com>
2 months agospl: mmc: properly annotate fallthrough
Andre Przywara [Thu, 27 Mar 2025 15:32:56 +0000 (15:32 +0000)]
spl: mmc: properly annotate fallthrough

Depending on the various MMC boot configurations, we might end up with
trying filesystem mode when a raw image boot failed. This fall-through
in the switch/case statement is explained in a comment, but this is not
visible to the compiler, which still will complain.

Add the proper compiler-visible annotation, to allow enabling the
compiler check in the future.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 months agoMerge patch series "acpi: simplify updating ACPI table header checksum"
Tom Rini [Tue, 8 Apr 2025 21:23:06 +0000 (15:23 -0600)]
Merge patch series "acpi: simplify updating ACPI table header checksum"

Heinrich Schuchardt <heinrich.schuchardt@canonical.com> says:

Introduce a new function to update ACPI table headers.
This allows to simplify the existing code.

Link: https://lore.kernel.org/r/20250321232121.251800-1-heinrich.schuchardt@canonical.com
2 months agoMerge patch series "Change DRAM message and add RAM doc"
Tom Rini [Tue, 8 Apr 2025 21:20:33 +0000 (15:20 -0600)]
Merge patch series "Change DRAM message and add RAM doc"

Neha Malcom Francis <n-francis@ti.com> says:

This short series is an ongoing effort to make RAM utilization clearer for
easier debugging and understanding of code. Intention is for users to quickly
be able to identify the CONFIGs needed to modify for their RAM usecase.

Link: https://lore.kernel.org/r/20250319140327.301266-1-n-francis@ti.com
2 months agoata: ahci: remove bad free
Vincent Stehlé [Mon, 24 Mar 2025 08:34:06 +0000 (09:34 +0100)]
ata: ahci: remove bad free

In the case of a memory allocation error, the ahci_port_start() function
tries to free the `pp' pointer.
This pointer was not dynamically allocated but does in fact point to an
element of the port[] array member of the struct ahci_uc_priv.
Remove the erroneous call to free() to fix this.

Fixes: 4782ac80b02f ("Add AHCI support to u-boot")
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Jason Jin <jason.jin@freescale.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
2 months agoemulation: qemu-sbsa: Fill in correct ITS ID
Patrick Rudolph [Thu, 20 Mar 2025 12:51:58 +0000 (13:51 +0100)]
emulation: qemu-sbsa: Fill in correct ITS ID

The ACPI IORT and ACPI MADT needs to use the same IDs when referencing
GIC ITS. The GIC-v3 ITS driver uses dev_seq(dev) to generate a unique ID
for the MADT, but qemu sbsa-ref hardcodes it.
Currently it's not the same ID, breaking interrupt routing on the OS.

Don't assume it's 0 and fetch it from the device instead.

TEST: Fixes non working IRQs in QEMU sbsa-ref.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2 months agoemulation: qemu-sbsa: Move ITS node into GICv3 node
Patrick Rudolph [Thu, 20 Mar 2025 12:51:57 +0000 (13:51 +0100)]
emulation: qemu-sbsa: Move ITS node into GICv3 node

According to the binding [1] the ITS node should be a subnode of the
GICv3 node. Thus move it now that the driver binds subnodes as well.

1: https://www.kernel.org/doc/Documentation/devicetree/bindings/interrupt-controller/arm%2Cgic-v3.txt

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2 months agoarm: gic-v3: Scan for subnodes
Patrick Rudolph [Thu, 20 Mar 2025 12:51:56 +0000 (13:51 +0100)]
arm: gic-v3: Scan for subnodes

According to the binding [1] the ITS node should be a subnode of the
GICv3 node. Since the ITS node has it's own driver, manually probe for
possible subnodes after binding since dm_scan_fdt() is not recursive.

1: https://www.kernel.org/doc/Documentation/devicetree/bindings/interrupt-controller/arm%2Cgic-v3.txt

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2 months agotiny-printf: Improve %X formatting
Christoph Niedermaier [Thu, 20 Mar 2025 19:01:47 +0000 (20:01 +0100)]
tiny-printf: Improve %X formatting

If tiny printf is used with 0x%08X (upper case X) the output is
always 0x00000000. It could be confusing if upper case instead
of lower case is used intentionally or accidentally because the
actual value is not output. To avoid this confusion, treat output
of %X as %x. As a compromise for tiny printf, the hex value is
then output correctly, but in lower case. This is done to keep it
tiny printf small.

Signed-off-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Marek Vasut <marex@denx.de>
2 months agoarm: simplify updating ACPI table header checksum
Heinrich Schuchardt [Fri, 21 Mar 2025 23:21:20 +0000 (00:21 +0100)]
arm: simplify updating ACPI table header checksum

Use acpi_update_checksum() to update table header.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
2 months agoqemu-sbsa: simplify updating ACPI table header checksum
Heinrich Schuchardt [Fri, 21 Mar 2025 23:21:19 +0000 (00:21 +0100)]
qemu-sbsa: simplify updating ACPI table header checksum

Use acpi_update_checksum() to update table header.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 months agox86/acpi: simplify updating header checksum
Heinrich Schuchardt [Fri, 21 Mar 2025 23:21:18 +0000 (00:21 +0100)]
x86/acpi: simplify updating header checksum

Use acpi_update_checksum() for updating ACPI table header checksum.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
2 months agoacpi: simplify updating header checksum
Heinrich Schuchardt [Fri, 21 Mar 2025 23:21:17 +0000 (00:21 +0100)]
acpi: simplify updating header checksum

Use acpi_update_checksum() for updating ACPI table header checksum.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
2 months agoacpi: new function acpi_update_checksum()
Heinrich Schuchardt [Fri, 21 Mar 2025 23:21:16 +0000 (00:21 +0100)]
acpi: new function acpi_update_checksum()

Introduce a new function to update ACPI table headers.
This allows to simplify the existing code.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 months agodoc: memory: Add documentation for system RAM
Neha Malcom Francis [Wed, 19 Mar 2025 14:03:27 +0000 (19:33 +0530)]
doc: memory: Add documentation for system RAM

Add documentation for system RAM utilization in U-Boot.

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
2 months agoboard_f: Modify DRAM message
Neha Malcom Francis [Wed, 19 Mar 2025 14:03:26 +0000 (19:33 +0530)]
board_f: Modify DRAM message

The message "DRAM:  2 GiB (effective 32 GiB)" can be a little confusing,
modify the message s/effective/total to make it more evident.

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
2 months agoMerge tag 'ubifixes-for-2025.07-rc1' of https://source.denx.de/u-boot/custodians...
Tom Rini [Tue, 8 Apr 2025 21:07:23 +0000 (15:07 -0600)]
Merge tag 'ubifixes-for-2025.07-rc1' of https://source.denx.de/u-boot/custodians/u-boot-ubi

ubi fixes for v2025.07-rc1

- ubi: fix bug creating partitions for non-existent volumes
  from Oskar Nilsson

2 months agoMerge patch series "Improve pytest runtime"
Tom Rini [Tue, 8 Apr 2025 19:54:50 +0000 (13:54 -0600)]
Merge patch series "Improve pytest runtime"

Tom Rini <trini@konsulko.com> says:

One thing that Simon Glass has noted is that our pytest run time keeps
getting longer. Looking at:
https://source.denx.de/u-boot/u-boot/-/pipelines/25011/test_report?job_name=sandbox%20test.py%3A%20%5Bfast%20amd64%5D
we can see that some of the longest running tests are a little puzzling.
It turns out that we have two ways of making filesystem images without
requiring root access and one of them is significantly slower than the
other. This series changes us from using virt-make-fs to only using the
mk_fs helper that currently resides in test_ut.py which uses standard
userspace tools. The final result can be seen at:
https://source.denx.de/u-boot/u-boot/-/pipelines/25015/test_report?job_name=sandbox%20test.py%3A%20%5Bfast%20amd64%5D
and the tests changed here now run much quicker.

Link: https://lore.kernel.org/r/20250320140030.2052434-1-trini@konsulko.com
2 months agoDockerfile: Update to drop virt-make-fs packages
Tom Rini [Thu, 20 Mar 2025 13:59:31 +0000 (07:59 -0600)]
Dockerfile: Update to drop virt-make-fs packages

Now that we do not need nor want people to use virt-make-fs for
filesystem tests, remove the related packages from the installation
list.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agodoc/develop/py_testing.rst: Update section on filesystem images
Tom Rini [Thu, 20 Mar 2025 13:59:30 +0000 (07:59 -0600)]
doc/develop/py_testing.rst: Update section on filesystem images

Now that we have no users of "virt-make-fs" nor users of "sudo" for
creating disk images update the documentation. We remove packages that
are no longer required (and related text) as well as be firm in our
wording around not using "sudo".

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agotest/py: Rework test_efi_secboot to not use virt-make-fs
Tom Rini [Thu, 20 Mar 2025 13:59:29 +0000 (07:59 -0600)]
test/py: Rework test_efi_secboot to not use virt-make-fs

The problem with using "virt-make-fs" to make a filesystem image is that
it is extremely slow. Switch to using the fs_helper functions we have
instead from the filesystem tests as these can add files to images and
are significantly faster and still do not require root access.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agotest/py: Rework test_efi_capsule to not use virt-make-fs
Tom Rini [Thu, 20 Mar 2025 13:59:28 +0000 (07:59 -0600)]
test/py: Rework test_efi_capsule to not use virt-make-fs

FIXME: Reword more

The problem with using "virt-make-fs" to make a filesystem image is that
it is extremely slow. Switch to using the fs_helper functions we have
instead from the filesystem tests as these can add files to images and
are significantly faster and still do not require root access.

The main change here is that our mount point directory has changed from
"test_efi_capsule" to "scratch" and so we need to update other functions
too. As the disk image that we get created doesn't have a GPT, invoke
sgdisk to do a conversion first.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agotest/py: Rework test_eficonfig to not use virt-make-fs
Tom Rini [Thu, 20 Mar 2025 13:59:27 +0000 (07:59 -0600)]
test/py: Rework test_eficonfig to not use virt-make-fs

The problem with using "virt-make-fs" to make a filesystem image is that
it is extremely slow. Switch to using the fs_helper functions we have
instead from the filesystem tests as these can add files to images and
are significantly faster and still do not require root access.

As this test already had a number of internal functions, add a
prepare_image function to do this part of the test.

Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agotest/py: Rework test_efi_bootmgr to not use virt-make-fs
Tom Rini [Thu, 20 Mar 2025 13:59:26 +0000 (07:59 -0600)]
test/py: Rework test_efi_bootmgr to not use virt-make-fs

The problem with using "virt-make-fs" to make a filesystem image is that
it is extremely slow. Switch to using the fs_helper functions we have
instead from the filesystem tests as these can add files to images and
are significantly faster and still do not require root access.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agotest/py: Fix a problem with setup_image
Tom Rini [Thu, 20 Mar 2025 13:59:25 +0000 (07:59 -0600)]
test/py: Fix a problem with setup_image

While we can be passed an image size to use, we always called qemu-img
with 20M as the size. Fix this by using the size parameter.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agotest/py/tests: Move "setup_image" from test_ut.py to fs_helper.py
Tom Rini [Thu, 20 Mar 2025 13:59:24 +0000 (07:59 -0600)]
test/py/tests: Move "setup_image" from test_ut.py to fs_helper.py

The generic function in test_ut.py to create a disk image with partition
table can be useful outside of test_ut.py so move it to be available
more clearly.

To make this a bit more easily used library function, make use of
check_call directly rather than calling things though u_boot_utils. In
turn, to more easily handle stdin here, use the shell "printf" utility
to pass sfdisk the specification to create as we do not have an actual
file descriptor to use here.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agotest/py: Rework test_xxd to not use virt-make-fs
Tom Rini [Thu, 20 Mar 2025 13:59:23 +0000 (07:59 -0600)]
test/py: Rework test_xxd to not use virt-make-fs

The problem with using "virt-make-fs" to make a filesystem image is that
it is extremely slow. Switch to using the fs_helper functions we have
instead from the filesystem tests as these can add files to images and
are significantly faster and still do not require root access.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agotest/py: Rework test_cat to not use virt-make-fs
Tom Rini [Thu, 20 Mar 2025 13:59:22 +0000 (07:59 -0600)]
test/py: Rework test_cat to not use virt-make-fs

The problem with using "virt-make-fs" to make a filesystem image is that
it is extremely slow. Switch to using the fs_helper functions we have
instead from the filesystem tests as these can add files to images and
are significantly faster and still do not require root access.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agodoc: release_cycle: fix next release version
Dario Binacchi [Tue, 8 Apr 2025 06:28:28 +0000 (08:28 +0200)]
doc: release_cycle: fix next release version

The release commit for version v2025.04 forgot to update the next
version (i. e. v2025.07) in the section where information about the
merge window is provided.

Fixes: 34820924edbc ("Prepare v2025.04")
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 months agoMerge branch 'next'
Tom Rini [Mon, 7 Apr 2025 22:40:02 +0000 (16:40 -0600)]
Merge branch 'next'

Note that this undoes the changes of commit cf6d4535cc4c ("x86:
emulation: Disable bloblist for now") as that was intended only for the
release due to time.

2 months agoubi: fix bug creating partitions for non-existent volumes
Oskar Nilsson [Wed, 26 Mar 2025 09:22:44 +0000 (10:22 +0100)]
ubi: fix bug creating partitions for non-existent volumes

The part_get_info_ubi() function was incorrectly returning 0 (success)
when a UBI volume was not found for a given partition index. This caused
the part_create_block_devices() function in blk-uclass.c to continue
creating devices for non-existent partitions up to MAX_SEARCH_PARTITIONS

Fix the issue by returning -1 when a volume is not found, signaling to
the part_create_block_devices() function that no more valid volumes
exist.

Before patch, 128 blk_partition are created:
Class   Index  Probed  Driver        Name
-------------------------------------------------
root        0  [ + ]  root_driver    root_driver
thermal     0  [   ]  imx_thermal    |-- imx_thermal
simple_bus  0  [ + ]  simple_bus     |-- soc
mtd         0  [ + ]  mxs-nand-dt    |   |-- nand-controller@1806000
blk         0  [   ]  ubi_blk        |   |   `-- nand-controller@1806000.blk
partition   0  [   ]  blk_partition  |   |       |-- nand-controller@1806000.blk:1
...
partition 127  [   ]  blk_partition  |   |       `-- nand-controller@1806000.blk:128

After patch, the expected blk_partition are created:
Class   Index  Probed  Driver        Name
-------------------------------------------------
root        0  [ + ]  root_driver    root_driver
thermal     0  [   ]  imx_thermal    |-- imx_thermal
simple_bus  0  [ + ]  simple_bus     |-- soc
mtd         0  [ + ]  mxs-nand-dt    |   |-- nand-controller@1806000
blk         0  [   ]  ubi_blk        |   |   `-- nand-controller@1806000.blk
partition   0  [   ]  blk_partition  |   |       |-- nand-controller@1806000.blk:1
partition   1  [   ]  blk_partition  |   |       |-- nand-controller@1806000.blk:2
partition   2  [   ]  blk_partition  |   |       |-- nand-controller@1806000.blk:3
partition   3  [   ]  blk_partition  |   |       `-- nand-controller@1806000.blk:4
simple_bus  1  [ + ]  simple_bus     |   |-- bus@2000000

Signed-off-by: Oskar Nilsson <onilsson@rums.se>
Cc: Kyungmin Park <kmpark@infradead.org>
Cc: Heiko Schocher <hs@denx.de>
Cc: Alexey Romanov <avromanov@salutedevices.com>
Changed in v2:
 - Change return from -1 to -ENOENT
Reviewed-by: Heiko Schocher <hs@denx.de>
2 months agoRevert "Merge patch series "pxe: Precursor series for supporting read_all() in extlin...
Tom Rini [Mon, 7 Apr 2025 18:35:13 +0000 (12:35 -0600)]
Revert "Merge patch series "pxe: Precursor series for supporting read_all() in extlinux / PXE""

This reverts commit 8bc3542384e3a1219e5ffb62b79d16dddc1b1fb9, reversing
changes made to 698edd63eca090a2e299cd3facf90a0b97bed677.

There are still problems with this series to work out.

Link: https://lore.kernel.org/u-boot/CAFLszTjw_MJbK9tpzVYi3XKGazcv55auBAdgVzcAVUta7dRqcg@mail.gmail.com/
Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agoPrepare v2025.04 v2025.04
Tom Rini [Mon, 7 Apr 2025 21:57:55 +0000 (15:57 -0600)]
Prepare v2025.04

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agobuildman: update PyYAML requirement
Heinrich Schuchardt [Mon, 7 Apr 2025 06:47:12 +0000 (08:47 +0200)]
buildman: update PyYAML requirement

On Ubuntu 25.04 installing the dependency pyyaml 6.0 fails with

    License classifiers are deprecated

Update PyYAML to the current release.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 months agoefi_loader: stop network in EXIT_BOOT_SERVICES
Heinrich Schuchardt [Sat, 5 Apr 2025 06:58:12 +0000 (08:58 +0200)]
efi_loader: stop network in EXIT_BOOT_SERVICES

It has been reported that memory corruption can occurred because network
packages where received after EXIT_BOOT_SERVICES. See the thread
starting at [1].

We try to remove all drivers when EXIT_BOOT_SERVICES is called. But

* Some network drivers don't call their own stop method when removed.
* Some network drivers don't have a remove method.
* Some devices have CONFIG_DM_DEVICE_REMOVE=n.

Let's call eth_halt() in EXIT_BOOT_SERVICES explicitly.

[1]
https://lore.kernel.org/all/C101B675-EEE6-44CB-8A44-83F72182FBD6@kohlschutter.com/

Cc: Michael Brown <mcb30@ipxe.org>
Reported-by: Christian Kohlschütter <christian@kohlschutter.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Michael Brown <mcb30@ipxe.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Christian Kohlschütter <christian@kohlschutter.com>
2 months agoboot: call dhcp_run in pxe bootmethod
Heiko Stuebner [Wed, 2 Apr 2025 21:50:25 +0000 (23:50 +0200)]
boot: call dhcp_run in pxe bootmethod

A recent change tried to speed up EFI booting by not calling dhcp_run
from eth_bootdev_hunt() every time. PXE so far relied on that dhcp_run
call to get an IP address.

Fix that by adding a dhcp_run call to the pxe bootflow, with autoload
disabled to only get the ip address and nothing else.

Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Fixes: 1f68057e0320 ("net: eth_bootdev_hunt() should not run DHCP")
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2 months agombedtls: remove incorrect attribute type checker
Raymond Mao [Fri, 4 Apr 2025 14:05:25 +0000 (07:05 -0700)]
mbedtls: remove incorrect attribute type checker

S/MIME Capabilities (OID: 1.2.840.113549.1.9.15) attributes are
expected to be algorithms but neither data nor MS Inderect Data,
thus the checker for data type is incorrect.

This patch fixes a capsule authentication failure with PKCS#7
message that contains S/MIME capabilities, which formed by the EDK2
GenerateCapsule tool.

S/MIME Capabilities are not common attributes in an EFI capsule,
thus this failure cannot be reproduced with the capsules generated
via mkeficapsule.

Fixes: 7de0d155cce7 ("mbedtls: add PKCS7 parser porting layer")
Reported-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
2 months agox86: emulation: Disable bloblist for now
Tom Rini [Fri, 4 Apr 2025 16:36:17 +0000 (10:36 -0600)]
x86: emulation: Disable bloblist for now

As reported by Niklas Sombert, enabling bloblist on these platforms
means that we currently don't pass SMBIOS tables on to later stages. For
the v2025.04 release, disable bloblists as that is sufficient to restore
functionality and we will address the underlying problem for the next
release.

Link: https://lore.kernel.org/u-boot/c1dc7446-d1d0-4ef2-b201-09fc612aa8db@uni-duesseldorf.de
Reported-by: Niklas Sombert <niklas.sombert@uni-duesseldorf.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agoMerge patch series "Enable MUX_MMIO at SPL stage"
Tom Rini [Sat, 5 Apr 2025 15:35:30 +0000 (09:35 -0600)]
Merge patch series "Enable MUX_MMIO at SPL stage"

Anurag Dutta <a-dutta@ti.com> says:

This series enables MUX_MMIO at SPL stage for j7200 and j721e
as it is required for successful hyperflash boot.

Test logs :
https://gist.github.com/anuragdutta731/b4c79ef8da56d8c50b38d953c9da4d45

Link: https://lore.kernel.org/r/20250320063004.1069653-1-a-dutta@ti.com
2 months agoarm: mach-k3: k3-ddr.h: Include spl.h
Neha Malcom Francis [Thu, 20 Mar 2025 06:27:33 +0000 (11:57 +0530)]
arm: mach-k3: k3-ddr.h: Include spl.h

Include spl.h to avoid definition errors in custom builds.

Fixes: commit bc07851897bd ("board: ti: Pull redundant DDR functions to a common location and Fixup DDR size when ECC is enabled")
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
2 months agoarm: mach-k3: j721e: Split out J7200 SoC support from J721e
Andrew Davis [Wed, 19 Mar 2025 18:54:58 +0000 (13:54 -0500)]
arm: mach-k3: j721e: Split out J7200 SoC support from J721e

Currently in j721e_init.c we check which firewalls to remove using
the board configuration (e.g CONFIG_TARGET_J721E_R5_EVM). We do this
as J721e and J7200 have different IP and firewalls but use the same
SoC definition (SOC_K3_J721E) even though they are different SoCs.

The idea was they would be similar enough that they both could use
the same SoC config to help with common code sharing. Board checks
would then be used differentiate.

This has grown far too messy to maintain any more, especially now
that there is more than one board using J721e (EVM, SK, Beagle AI64).
As differentiation is done based on board, every one of these boards
would have to have checks added for them. Instead let's split J7200
support out from J721e like how normal new SoC support is done.

This patch touches several subsystems and could not be split much better
as when we add SOC_K3_J7200 we want to make use of it in all spots that
once used the combined SOC_K3_J721E so we can turn off SOC_K3_J721E when
building for J7200 boards.

Signed-off-by: Andrew Davis <afd@ti.com>
2 months agoarm: dts: k3: Remove leftover file after OF_UPSTREAM
Andrew Davis [Wed, 19 Mar 2025 15:15:50 +0000 (10:15 -0500)]
arm: dts: k3: Remove leftover file after OF_UPSTREAM

The file k3-am62a7.dtsi is part of upstream DT and should
have been removed when migrating to OF_UPSTREAM but must
have been missed. Do this here.

Signed-off-by: Andrew Davis <afd@ti.com>
2 months agoconfigs: j721e_evm_a72_defconfig: Enable MUX_MMIO at SPL
Anurag Dutta [Thu, 20 Mar 2025 06:30:04 +0000 (12:00 +0530)]
configs: j721e_evm_a72_defconfig: Enable MUX_MMIO at SPL

MUX_MMIO is required in SPL stage in order to boot hyperflash
successfully. Add configs to enable MUX_MMIO in SPL stage.

Signed-off-by: Anurag Dutta <a-dutta@ti.com>
2 months agoconfigs: j7200_evm_a72_defconfig: Enable MUX_MMIO at SPL
Anurag Dutta [Thu, 20 Mar 2025 06:30:03 +0000 (12:00 +0530)]
configs: j7200_evm_a72_defconfig: Enable MUX_MMIO at SPL

MUX_MMIO is required in SPL stage in order to boot hyperflash
successfully. Add configs to enable MUX_MMIO in SPL stage.

Signed-off-by: Anurag Dutta <a-dutta@ti.com>