summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
46 hoursMerge tag 'v2026.07-rc3' into nextTom Rini
Prepare v2026.07-rc3
9 daysefi_selftest: test hii keyboard layouts moreVincent Stehlé
The HII database test for keyboard layouts register two package lists with two keyboard layouts each, but the test verifies only the GUID of the first keyboard layout. This does not catch the bugs happening with the keyboard layouts after the first one in a package. Verify all the keyboard layout GUIDs in the unit test to prevent this. Signed-off-by: Vincent Stehlé <[email protected]> Cc: Heinrich Schuchardt <[email protected]> Cc: Ilias Apalodimas <[email protected]> Cc: Tom Rini <[email protected]>
9 daysefi_loader: fix hii keyboard layout pointer computationVincent Stehlé
The EFI_HII_KEYBOARD_LAYOUT field `layout_length' is expressed in bytes, but we add it to the `layout' pointer with (scaled) pointer arithmetic. When adding an HII keyboard package with multiple keyboard layouts, this results in only the first layout being added correctly; fix it. Fixes: 8d3b77e36e10 ("efi: hii: add keyboard layout package support") Signed-off-by: Vincent Stehlé <[email protected]> Cc: Heinrich Schuchardt <[email protected]> Cc: Ilias Apalodimas <[email protected]> Cc: Tom Rini <[email protected]> Cc: AKASHI Takahiro <[email protected]>
9 daysefi_loader: fix AllocatePages overlap statusHarsimran Singh Tungal
Return EFI_NOT_FOUND for EFI_ALLOCATE_ADDRESS overlap When efi_allocate_pages() is called with EFI_ALLOCATE_ADDRESS, UEFI expects EFI_NOT_FOUND if the requested address range is already allocated or unavailable. U-Boot currently returns EFI_OUT_OF_RESOURCES when efi_update_memory_map() detects an overlap after a successful lmb_alloc_mem(), which does not match EFI_ALLOCATE_ADDRESS semantics. Return EFI_NOT_FOUND for EFI_ALLOCATE_ADDRESS requests that fail due to an overlapping EFI memory descriptor, while keeping EFI_OUT_OF_RESOURCES for other allocation types. The UEFI specification [1] specifies that EFI_BOOT_SERVICES.AllocatePages must return EFI_NOT_FOUND when the requested address range is unavailable or already allocated; EFI_OUT_OF_RESOURCES applies to non‑address‑specific allocation failures. [1] https://uefi.org/specs/UEFI/2.10_A/07_Services_Boot_Services.html Signed-off-by: Harsimran Singh Tungal <[email protected]> The UEFI specification does not clearly specify the behavior. But let's follow the EDK II precedent here. Reviewed-by: Heinrich Schuchardt <[email protected]>
12 dayssmbios: Do not fall back on devicetree without valid mappingMark Kettenis
The smbios_get_val_si() function may get called for a sysinfo property for which there is no mapping to a devicetree property. Avoid a NULL pointer dereference in this case by skipping the read of the mapped property from the device tree. Fixes: 83b28b55d74f ("smbios: add support for dynamic generation of Type 9 system slot tables") Signed-off-by: Mark Kettenis <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Raymond Mao <[email protected]>
2026-05-12Merge patch series "add memdup_nul(), use it and memdup() in a few places"Tom Rini
Rasmus Villemoes <[email protected]> says: There are quite a few places where we allocate X+1 bytes, initialize the first X bytes via memcpy() and then set the last byte to 0. The kernel has a helper for that, kmemdup_nul(). Introduce a similar one, and start making use of it in a few places. Also the existing memdup() helper can be put to more use. There are lots more places one could modify. But for code shared with host tools, one would need to do some refactoring, putting memdup() and memdup_nul() in their own str-util.c TU which could then also be included in the tools build. Link: https://lore.kernel.org/r/[email protected]
2026-05-12lib/hashtable.c: use memdup_nul() in himport_rRasmus Villemoes
We have memdup_nul() for exactly this pattern of duplicating a block of memory and ensuring there's a nul byte after the copy. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Rasmus Villemoes <[email protected]>
2026-05-12lib/string.c: implement strdup() and strndup() in terms of memdup_nul()Rasmus Villemoes
With the addition of memdup_nul(), strdup() and strndup() can be implemented as one-liners. While not required by POSIX or C, do keep the behaviour of gracefully accepting a NULL source and simply return NULL. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Rasmus Villemoes <[email protected]>
2026-05-12lib/string.c: introduce memdup_nul() helperRasmus Villemoes
This is completely analogous to the linux kernel's kmemdup_nul() helper, apart from the lack of the gfp_t argument: Allocate a buffer of size {len}+1, copy {len} bytes from the given buffer, and add a final nul byte. This pattern exists in a number of places, so this helper can reduce some boilerplate code. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Rasmus Villemoes <[email protected]>
2026-05-12lib/string.c: drop pointless __HAVE_ARCH_STRDUPRasmus Villemoes
There has never been an arch-specific optimized implementation of str[n]dup, nor is there likely to ever be one, because unlike their cousins strlen(), strcpy() and similar that simply read/write the src/dst, the dup functions by definition involve memory allocation. So drop this irrelevant cpp guard. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Rasmus Villemoes <[email protected]>
2026-05-12string: fix prototype of memdup()Rasmus Villemoes
It doesn't make sense to restrict memdup() to only return char* pointers, especially when it is already defined to accept void*. This makes it uglier to use to e.g. duplicate a struct. Make it return void*, just as kmemdup() does in the kernel (and which our kmemdup() in fact also does). While in here, make a small optimization: memcpy() is defined to return the destination register, so we write this in a way that the compiler may do a tail call. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Rasmus Villemoes <[email protected]>
2026-05-12fwu: add helper to get image GUID by type and bank indexDario Binacchi
Introduce fwu_mdata_get_image_guid() to retrieve a specific image GUID from the FWU metadata based on the bank index and image type GUID. This allows identifying the correct partition in multi-bank (A/B) scenarios, ensuring the correct image is targeted depending on the current bank. Signed-off-by: Dario Binacchi <[email protected]> Reviewed-by: Simon Glass <[email protected]> Acked-by: Ilias Apalodimas <[email protected]>
2026-05-12lib: uuid: add partition type GUID for extended bootloaderDario Binacchi
The Extended Boot Loader Partition (XBOOTLDR) is a standard defined by the Discoverable Partitions Specification (DPS) to host boot loader resources outside of the EFI System Partition ([1], [2]). Defining this GUID (bc13c2ff-59e6-4262-a352-b275fd6f7172) allows U-Boot to correctly identify and label these partitions using the "xbootldr" shorthand. [1] https://uapi-group.org/specifications/specs/discoverable_partitions_specification/#extended-boot-loader-partition:~:text=UEFI%20Specification.-,Extended%20Boot%20Loader%20Partition,-bc13c2ff%2D59e6%2D4262 [2] https://uapi-group.org/specifications/specs/boot_loader_specification/ Signed-off-by: Dario Binacchi <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2026-05-11acpi: fix initial RSDT and XSDT sizeHeinrich Schuchardt
When creating the RSDT and the XSDT table they contain no entries. The table size therefore must equal the header size. Without this change a NULL deference has been observed in acpi_find_table() when running `ut dm` on sandbox64_defconfig executed via `sudo ./u-boot -D`. Fixes: 94ba15a3f13f ("x86: Move base tables to a writer function") Fixes: 7e586f69070d ("acpi: Put table-setup code in its own function") Fixes: ab5efd576c4e ("x86: acpi: Adjust order in acpi_table.c") Fixes: 867bcb63e79f ("x86: Generate a valid ACPI table") Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Simon Glass <[email protected]> Update dm_test_acpi_ctx_and_base_tables() in test/dm/acpi.c to expect sizeof(struct acpi_table_header) for the initial table length (instead of sizeof(*rsdt) / sizeof(*xsdt)), and to compute the checksum over header->length bytes rather than the full struct size: Signed-off-by: Simon Glass <[email protected]>
2026-05-08lib: fdtdec: validate bloblist FDT before consuming libfdt sizeRaymond Mao
Coverity Scan defects are observed in fdtdec_apply_bloblist_dtos(), since the live FDT taken from the bloblist is passed to libfdt helpers which consume header size/offset fields: - fdt_open_into() - fdt_pack() Validate the bloblist FDT with fdt_check_full() before calling fdt_open_into() and again after applying overlays before calling fdt_pack(). This makes the libfdt consumers operate on a checked FDT blob while keeping the existing flow unchanged. Also normalize libfdt return codes from this path to errno values, including the overlay callback path through bloblist_apply_blobs(). Fixes: b70cbbfbf94f ("fdtdec: apply DT overlays from bloblist") Addresses-Coverity-ID: CID 645837: (TAINTED_SCALAR) Signed-off-by: Raymond Mao <[email protected]> Reviewed-by: Alexander Sverdlin <[email protected]>
2026-05-05efi_mem_sort: use list_for_each_entry_safe insteadRandolph Sapp
Use list_for_each_entry_safe and comparisons against the current and next efi_mem_desc. This reduces the computation required for merging regions, prevents unnecessary additional iterations of the list, and requires less temporary values. Signed-off-by: Randolph Sapp <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2026-05-05efi_selftest_memory: check for duplicates firstRandolph Sapp
Check for duplicate memory mappings before reporting any incorrect attributes. Could be that second allocation has the correct type while the first doesn't. Knowing there is a duplicate in this scenario is more helpful than just reporting the first mismatch. Signed-off-by: Randolph Sapp <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2026-05-05efi_dt_fixup: use fdtdec_get_boolRandolph Sapp
Use the more straightforward fdtdec_get_bool instead of fdt_getprop and a return code check. Signed-off-by: Randolph Sapp <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]> Reviewed-by: Anshul Dalal <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2026-05-05efi_loader: initialize variables in efi_dp_from_http()Heinrich Schuchardt
When using lwIP, efi_dp_from_http() may fail to initialize ip or mask. Initialize the variables before the call. Addresses-Coverity-ID: 645840 - Uninitialized variables (UNINIT) Reviewed-by: Ilias Apalodimas <[email protected]> Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Heinrich Schuchardt <[email protected]>
2026-05-04fdt: check fdt_pack() return value in fdtdec_apply_bloblist_dtos()Michal Simek
The fdt_pack() function can return an error code, but its return value was not being checked. Add proper error handling to propagate any failure. Also fix typo in comment: "Shink" -> "Shrink". Addresses-Coverity-ID: CID 645839: Error handling issues (CHECKED_RETURN) Signed-off-by: Michal Simek <[email protected]> Reviewed-by: Alexander Sverdlin <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Raymond Mao <[email protected]>
2026-05-01efi_loader: centralize messaging for efi_init_obj_listHeinrich Schuchardt
If efi_init_obj_list() fails we cannot use the UEFI sub-system. * Instead of having messages for this everywhere write an error message in efi_init_obj_list(). * Always use (ret != EFI_SUCCESS) when checking the return value of efi_init_obj_list(). * Remove the return code from the error message as it does not help users to understand which initialization went wrong. Signed-off-by: Heinrich Schuchardt <[email protected]>
2026-05-01efi_loader: correct efi_binary_run_dp() return valueHeinrich Schuchardt
efi_binary_run_dp() is expected to return an efi_status_t value. Reported-by: Simon Glass <[email protected]> Fixes: 6422820ac3e5 ("efi_loader: split unrelated code from efi_bootmgr.c") Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]> Signed-off-by: Heinrich Schuchardt <[email protected]>
2026-05-01efi_loader: correct return value of efi_bootmgr_run()Heinrich Schuchardt
efi_bootmgr_run() is expected to return an efi_status_t value. Reported-by: Simon Glass <[email protected]> Fixes: 0bef4b0123f2 ("cmd: bootefi: move library interfaces under lib/efi_loader") Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]> Signed-off-by: Heinrich Schuchardt <[email protected]>
2026-05-01EFI Loader: Correct dependencies for EFI_HTTP_BOOTTom Rini
As exposed by "make randconfig", we have an issue with the dependencies for EFI_HTTP_BOOT. As this is implemented by running commands (as seen by what it selects) it must depend on CMDLINE as well. Signed-off-by: Tom Rini <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]>
2026-04-27Merge patch series "net: migrate NO_NET out of the networking stack choice"Tom Rini
Quentin Schulz <[email protected]> says: This migrates the net options away from the main Kconfig to net/Kconfig, rename the current NET option to NET_LEGACY to really highlight what it is and hopefully encourage more people to use lwIP, add a new NET menuconfig (but keep NO_NET as an alias to NET=n for now) which then allows us to replace all the "if legacy_stack || lwip_stack" checks with "if net_support" which is easier to read and maintain. The only doubt I have is wrt SYS_RX_ETH_BUFFER which seems to be needed for now even when no network is configured? Likely due to include/net-common.h with PKTBUFSRX? No change in behavior is intended. Only change in defconfig including other defconfigs where NO_NET=y or NET is not set, in which case NO_NET is not set or NET=y should be set in the top defconfig. Similar change required for config fragments. See commit log in patch adding NET menuconfig for details. This was tested based on 70fd0c3bb7c2 ("x86: there is no CONFIG_UBOOT_ROMSIZE_KB_12288"), from within the GitLab CI container trini/u-boot-gitlab-ci-runner:noble-20251013-23Jan2026 and set up similarly as in "build all platforms in a single job" GitLab CI job. #!/usr/bin/env bash set -o pipefail set -eux ARGS="-BvelPEWM --reproducible-builds --step 0" ./tools/buildman/buildman -o ${O} --force-build $ARGS -CE $* ./tools/buildman/buildman -o ${O} $ARGS -Ssd $* O=../build/u-boot/ ../u-boot.sh -b master^..b4/net-kconfig |& tee ../log.txt I can't really decipher the log.txt, but there's no line starting with + which would be an error according to tools/buildman/builder.py help text. Additionally, because I started the script with set -e set and because buildman has an exit code != 0 when it fails to build a board, and I have the summary printed (which is the second buildman call), I believe it means all builds passed. The summary is the following: aarch64: (for 537/537 boards) all +0.0 rodata +0.0 uniphier_v8 : all +1 rodata +1 u-boot: add: 0/0, grow: 1/0 bytes: 1/0 (1) function old new delta data_gz 10640 10641 +1 arm: (for 733/733 boards) all -0.0 rodata -0.0 uniphier_v7 : all -1 rodata -1 u-boot: add: 0/0, grow: 0/-1 bytes: 0/-1 (-1) function old new delta data_gz 11919 11918 -1 opos6uldev : all -3 rodata -3 u-boot: add: 0/0, grow: 0/-1 bytes: 0/-3 (-3) function old new delta data_gz 18778 18775 -3 uniphier_ld4_sld8: all -3 rodata -3 u-boot: add: 0/0, grow: 0/-1 bytes: 0/-3 (-3) function old new delta data_gz 11276 11273 -3 stemmy : all -20 rodata -20 u-boot: add: 0/0, grow: 0/-1 bytes: 0/-20 (-20) function old new delta data_gz 15783 15763 -20 As far as I could tell this data_gz is an automatically generated array when CONFIG_CMD_CONFIG is enabled. It is the compressed .config stored in binary form. Because I'm changing the name of symbols, replacing a menu with a menuconfig, additional text makes it to .config and the "# Networking" section in .config disappears. Here is the diff for the 5 defconfigs listed above, generated with: for f in build/*-m; do diff --unified=0 $f/.config $(dirname $f)/$(basename -a -s '-m' $f)/.config done (-m is the build directory for master, and without the suffix, it's the top commit of this series) """ --- build/opos6uldev-m/.config 2026-04-20 10:53:49.804528526 +0200 +++ build/opos6uldev/.config 2026-04-20 11:03:37.430242767 +0200 @@ -970,4 +969,0 @@ - -# -# Networking -# @@ -975,0 +972 @@ +CONFIG_NET_LEGACY=y --- build/stemmy-m/.config 2026-04-20 11:01:33.653698123 +0200 +++ build/stemmy/.config 2026-04-20 11:04:53.452577311 +0200 @@ -733,4 +732,0 @@ - -# -# Networking -# @@ -738,2 +733,0 @@ -# CONFIG_NET is not set -# CONFIG_NET_LWIP is not set --- build/uniphier_ld4_sld8-m/.config 2026-04-20 11:00:41.605469071 +0200 +++ build/uniphier_ld4_sld8/.config 2026-04-20 11:04:22.226439899 +0200 @@ -997,4 +996,0 @@ - -# -# Networking -# @@ -1002,0 +999 @@ +CONFIG_NET_LEGACY=y --- build/uniphier_v7-m/.config 2026-04-20 10:53:04.019307319 +0200 +++ build/uniphier_v7/.config 2026-04-20 11:03:01.688085486 +0200 @@ -1004,4 +1003,0 @@ - -# -# Networking -# @@ -1009,0 +1006 @@ +CONFIG_NET_LEGACY=y --- build/uniphier_v8-m/.config 2026-04-20 10:43:05.614441175 +0200 +++ build/uniphier_v8/.config 2026-04-20 10:41:03.214852130 +0200 @@ -875,4 +874,0 @@ - -# -# Networking -# @@ -880,0 +877 @@ +CONFIG_NET_LEGACY=y """ This is fine: - Networking menu doesn't exist anymore so "#\n# Networking\n#\n" won't be in .config anymore. - opos6uldev, uniphier_ld4_sld8, uniphier_v7 and uniphier_v8 all have (old) CONFIG_NET enabled, (new) CONFIG_NET will still be set but CONFIG_NET_LEGACY also needs to be defined now to reflect the stack choice (even if default), - stemmy has CONFIG_NO_NET set, which means CONFIG_NET and CONFIG_NET_LWIP are not reachable anymore hence why they don't need to be part of .config, GitLab CI was run on this series (well, not exactly, but it's only changes to the git logs that were made): https://source.denx.de/u-boot/contributors/qschulz/u-boot/-/pipelines/29849 It passes. Link: https://lore.kernel.org/r/[email protected]
2026-04-27simplify NET_LEGACY || NET_LWIP condition with NET conditionQuentin Schulz
Since the move to make NET a menuconfig and NO_NET a synonym of NET=n, when NET is enabled, NET_LEGACY || NET_LWIP is necessarily true, so let's simplify the various checks across the codebase. SPL_NET_LWIP doesn't exist but SPL_NET_LEGACY is an alias for SPL_NET so the proper symbol is still defined in SPL whenever needed. Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Peter Robinson <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2026-04-27rename NET to NET_LEGACYQuentin Schulz
Highlight that NET really is the legacy networking stack by renaming the option to NET_LEGACY. This requires us to add an SPL_NET_LEGACY alias to SPL_NET as otherwise CONFIG_IS_ENABLED(NET_LEGACY) will not work for SPL. The "depends on !NET_LWIP" for SPL_NET clearly highlights that it is using the legacy networking app so this seems fine to do. This also has the benefit of removing potential confusion on NET being a specific networking stack instead of "any" network stack. Signed-off-by: Quentin Schulz <[email protected]> Acked-by: Ilias Apalodimas <[email protected]> Reviewed-by: Peter Robinson <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2026-04-27Merge patch series "Add support for DT overlays handoff"Tom Rini
Raymond Mao <[email protected]> says: The series include refactoring on bloblist and fdtdec to support handoff of multiple DT overlays and applying them into the DT base during setup. All changes are aligned to the spec update for supporting DT overlay handoff[1]. Notes for testing: Currently DT overlay is not yet enabled in TF-A, but with the test patches I provided for TF-A and OP-TEE build, importing a DT overlay blob file from QEMU to TF-A reserved memory is supported. Follow below instructions to build and run for test: $ repo init -u https://github.com/OP-TEE/manifest.git -m qemu_v8.xml Replace your local qemu_v8.xml with [2], which contains all necessary changes in both TF-A and OP-TEE build. $ repo sync $ cd build $ make toolchains $ make ARM_FIRMWARE_HANDOFF=y all Copy and rename your DT overlay blob as 'qemu_v8.dtb' into out/bin $ make ARM_FIRMWARE_HANDOFF=y run-only [1] Add Transfer Entry for Devicetree Overlay https://github.com/FirmwareHandoff/firmware_handoff/pull/74 [2] https://github.com/raymo200915/optee_manifest/blob/dt_overlay_handoff/qemu_v8.xml Link: https://lore.kernel.org/r/[email protected]
2026-04-27fdtdec: apply DT overlays from bloblistRaymond Mao
During FDT setup, apply all existing DT overlays from the bloblist to the base FDT if bloblist is being used for handoff from previous boot stage. According to the Firmware Handoff spec update to support DT overlay [1], an overlay must have the same top-level compatible string as its target base DT has. Before applying the overlays, check whether sufficient space is reserved in the base DT blob, if not, resize the blob to the allowed padded size, which is limited by CONFIG_SYS_FDT_PAD and the bloblist spare space size. After all overlays are applied, resize the merged DT to its actual size. [1] Add Transfer Entry for Devicetree Overlay https://github.com/FirmwareHandoff/firmware_handoff/pull/74 Signed-off-by: Raymond Mao <[email protected]> Reviewed-by: Tom Rini <[email protected]> Tested-by: Michal Simek <[email protected]>
2026-04-27efi_loader: make EFI_HAVE_RUNTIME_RESET a user-selectable optionAswin Murugan
Expose EFI_HAVE_RUNTIME_RESET as a proper Kconfig boolean with a prompt so platforms can explicitly enable or disable advertising the EFI reset runtime service. The current PSCI-based EFI runtime reset implementation is always enabled whenever CONFIG_PSCI_RESET is selected, but it does not support passing the additional arguments required for specialized reset modes. As a result, reboot requests such as bootloader mode or EDL mode cannot be propagated correctly and instead fall back to a normal reboot. By making EFI_HAVE_RUNTIME_RESET user-configurable, platforms that depend on extended PSCI reset can now explicitly disable EFI runtime reset handling even when CONFIG_PSCI_RESET is enabled, ensuring that the kernel retains full control of advanced reboot paths. Default behavior for existing platforms remains unchanged. Signed-off-by: Aswin Murugan <[email protected]> Reviewed-by: Sumit Garg <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Casey Connolly <[email protected]>
2026-04-23lib/Kconfig: Fix SUPPORTS_FW_LOADER optionDavid Lechner
Change the SUPPORTS_FW_LOADER option to be enabled by default. This is a dependency-only option intended to be used like: depends on SUPPORTS_FW_LOADER Instead of having to always remember to do both: depends on CMDLINE depends on ENV_SUPPORT In order to actually work though, the option has to be enabled. Reported-by: Weijie Gao <[email protected]> Closes: https://lore.kernel.org/u-boot/[email protected]/ Fixes: 4ed440e6be80 ("fw_loader: Introduce SUPPORTS_FW_LOADER symbol") Signed-off-by: David Lechner <[email protected]> Reviewed-by: Tom Rini <[email protected]> Tested-by: Weijie Gao <[email protected]>
2026-04-22console: add console_flush_stdin()Gregor Herburger
Add a common helper console_flush_stdin() to drain all pending characters from stdin. This consolidates the open-coded while (tstc()) getchar() pattern that appeared in multiple places across the tree. Signed-off-by: Gregor Herburger <[email protected]> Reviewed-by: Alexander Sverdlin <[email protected]> Reviewed-by: Quentin Schulz <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2026-04-22gunzip: Implement chunked decompressionMarek Vasut
The current gzwrite() implementation is limited to 4 GiB compressed input buffer size due to struct z_stream_s { uInt avail_in } member, which is of type unsigned int. Current gzwrite() implementation sets the entire input buffer size as avail_in and performs decompression of the whole compressed input buffer in one round, which limits the size of input buffer to 4 GiB. Rework the decompression loop to use chunked approach, and decompress the input buffer in up to 4 GiB - 1 kiB avail_in chunks, possibly in multiple decompression rounds. This way, the compressed input buffer size is limited by gzwrite() function 'len' parameter type, which is unsigned long. In case of sandbox build, include parsing of 'gzwrite_chunk' environment variable, so the chunked approach can be thoroughly tested with non default chunk size. For non-sandbox builds, the chunk size is 4 GiB - 1 kiB. The gzwrite test case is extended to test various chunk sizes during gzwrite decompression test. Signed-off-by: Marek Vasut <[email protected]>
2026-04-21Merge patch series "Linux compat improvements and CCF prep"Tom Rini
Casey Connolly <[email protected]> says: This series implements various improvements to Linux header compatibility, largely in preparation for a full port of Linux CCF but many of these changes would also be helpful when porting other drivers. Beside the basic header/compat stuff there are a few larger patches: Patch 1 adds the "%pOF" format specifier to vsprintf, this behaves the same as it does in Linux printing the name of the ofnode, but notably it expects an ofnode pointer rather than a device_node. Patch 2 adds an option to skip doing a full DM scan pre-relocation. Some platforms like Qualcomm don't actually need devices to be probed prior to relocation, it is also quite slow to scan the entire FDT before caches are up. This option gets us to main loop 30-50% faster. Unfortunately it isn't possible to totally skip DM since U-Boot will panic if it can't find a serial port, but the serial uclass code will bind the serial port itself by reading /chosen/stdout-path, however any dependencies like clocks won't be found so this should only be enabled if the serial driver gracefully handles missing clocks. Patch 3 adds [k]strdup_const(), this works the same as the Linux version saving a small amount of memory by avoiding duplicating strings stored in .rodata, this is particularly useful for CCF. Patch 4 adds 64-bit versions of some 32-bit ofnode utilities functions, making it possible to parse 64-bit arrays. Patch 6 provides a simple implementation of kref, this will be used by CCF. Patch 9 adds devm_krealloc() support to devres, it relies on storing allocation sizes in the devres struct which will add a small overhead. Link: https://lore.kernel.org/r/[email protected]
2026-04-21ofnode: add read_u64_array and count_elems_of_sizeCasey Connolly
These are similar to their Linux counterparts, adding helpers for reading arrays of 64-bit values with of_access and fdtdec implementations. Signed-off-by: Casey Connolly <[email protected]>
2026-04-21string: add strdup_const and kstrdup_constCasey Connolly
Extend Linux compat by adding kstrdup_const(), backed by lib/string.c. This leverages U-Boots .rodata section on ARM64 to avoid pointlessly duplicating const strings. This is used by the Linux CCF_FULL port and may be useful elsewhere in U-Boot. Signed-off-by: Casey Connolly <[email protected]>
2026-04-21vsprintf: add %pOFCasey Connolly
This prints a full ofnode path. Signed-off-by: Casey Connolly <[email protected]>
2026-04-17efi_loader: Allow disabling ANSI console queries via KconfigMichal Simek
Commit 4cb724364030 ("efi_loader: Disable ANSI output for tests") introduced efi_console_set_ansi() to suppress ANSI escape sequences during unit tests. Extend this mechanism to be configurable via a new Kconfig option CONFIG_EFI_CONSOLE_DISABLE_ANSI. When CONFIG_EFI_CONSOLE_DISABLE_ANSI is enabled, efi_console_set_ansi(false) is called at the start of efi_setup_console_size(). This prevents query_console_serial() from sending ANSI escape sequences to the terminal, using default 25x80 dimensions instead. This is useful for platforms where the serial console cannot handle ANSI queries. Signed-off-by: Michal Simek <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]>
2026-04-17fwu: Move boottime checks to EVT_POST_PREBOOTMichal Simek
Switch fwu_boottime_checks() from EVT_MAIN_LOOP to EVT_POST_PREBOOT because there is no reason to call FWU so early. FWU triggers EFI stack initialization before all devices are visible which prevents the EFI stack from scanning these devices and adding them to EFI variables. Signed-off-by: Michal Simek <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2026-04-17efi_loader: efi_var_sf: Do not fail on blank SPI FlashMichal Simek
When SPI Flash is blank (first boot or erased), efi_var_from_storage() returns EFI_DEVICE_ERROR because efi_var_restore() fails on invalid magic/CRC. This prevents the EFI subsystem from initializing. Check the magic value before attempting to restore variables. If the magic does not match EFI_VAR_FILE_MAGIC, treat it as an empty store and return EFI_SUCCESS, matching the behavior of the file-based efi_var_file.c which deliberately returns EFI_SUCCESS on missing or corrupted variable files to avoid blocking the boot process. Similarly, if the magic matches but efi_var_restore() fails (e.g. corrupted CRC), log the error but still return EFI_SUCCESS. Suggested-by: John Toomey <[email protected]> Signed-off-by: Michal Simek <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]>
2026-04-13arm: Add ARMv8-M aarch32 supportMarek Vasut
Add configuration for ARMv8-M aarch32 core, which are currently Cortex-M23/M33 cores. These cores are treated similar to ARMv7-M cores, except the code has to be compiled with matching compiler -march=armv8-m.main flag . These cores have no MMU, they have MPU, which is currently not configured. Unlike ARMv7-M, these cores have 512 interrupt vectors. While the SYS_ARM_ARCH should be set to 8, it is set to 7 because all of the initialization code is built from arch/arm/cpu/armv7m and not armv8. Furthermore, CONFIG_ARM64 must be disabled, although DTs for devices using these cores do come from arch/arm64/boot/dts. To avoid excess duplication in Makefiles, introduce one new Kconfig symbol, CPU_V7M_V8M. The CPU_V7M_V8M cover both ARMv7-M and ARMv8-M cores. Signed-off-by: Marek Vasut <[email protected]> Acked-by: Udit Kumar <[email protected]>
2026-04-07lmb: Rework the LMB_ARCH_MEM_MAP symbolTom Rini
This symbol should not be enabled by the user directly but rather selected when implemented in a given platform. This converts all of the current users of this feature and hides the symbol. Signed-off-by: Tom Rini <[email protected]>
2026-04-06Merge branch 'next'Tom Rini
2026-04-03acpi: Correct dependencies for GENERATE_ACPI_TABLETom Rini
In order to build this code, outside of QEMU systems which instead have provided tables that we use, we must select ACPIGEN as well. Signed-off-by: Tom Rini <[email protected]>
2026-04-03global: Audit Kconfig usage of PARTITION_TYPE_GUIDTom Rini
It is not functionally possible to use the code enabled by PARTITION_TYPE_GUID without having EFI_PARTITION be enabled as well. Not all users of the former had ensured that the latter was enabled however, so audit all current users and then as appropriate select or imply EFI_PARTITION as needed. Signed-off-by: Tom Rini <[email protected]>
2026-04-03optee: Correct dependencies for BOOTM_OPTEETom Rini
As exposed by "make randconfig", we have an issue with the dependencies for BOOTM_OPTEE. This symbol needs to select BOOTM_LINUX and in turn depend on the library symbols that have to be enabled for BOOTM_LINUX to be valid (LIB_BOOTI, LIB_BOOTM and LIB_BOOTZ). Reviewed-by: Marek Vasut <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2026-03-27treewide: fix uImage.FIT document pathsDaniel Golle
Commit 488445cefa1 ("doc: Move FIT into its own directory") moved the documentation in doc/uImage.FIT to doc/usage/fit, subsequently all documents and example sources have been converted to reStructuredText. Fix (almost) all of the remaining occurrences of the old path and filenames across the tree. The exception is doc/uImage.FIT/command_syntax_extensions.txt which apparently has been removed entirely, or at least I was unable to locate where that document is now. Signed-off-by: Daniel Golle <[email protected]>
2026-03-25fw_loader: Introduce SUPPORTS_FW_LOADER symbolTom Rini
The implementation of FW_LOADER requires CMDLINE to be enabled, and expressses this. In order to not have to have every users also depends on CMDLINE introduce SUPPORTS_FW_LOADER. This depends on CMDLINE and ENV_SUPPORT and then we have all users depends on SUPPORTS_FW_LOADER. Signed-off-by: Tom Rini <[email protected]>
2026-03-25fdt: Prefer %pap over %llxAlexander Sverdlin
In cases where phys_addr_t/phys_size_t is being printed, it's possible to use tiny-printf-friendly %pap instead of %llx. For instance, in SPL, with tiny-printf: Before the patch: fdtdec_setup_memory_banksize: DRAM Bank #0: start = 0xx, size = 0xx After the patch: fdtdec_setup_memory_banksize: DRAM Bank #0: start = 80000000, size = 40000000 Signed-off-by: Alexander Sverdlin <[email protected]>
2026-03-14efi_vars: Implement SPI Flash storeShantur Rathore
Currently U-Boot uses ESP as storage for EFI variables. Devices with SPI Flash are used for storing environment with this commit we allow EFI variables to be stored on SPI Flash. Signed-off-by: Shantur Rathore <[email protected]> Signed-off-by: Michal Simek <[email protected]> Tested-by: Neil Armstrong <[email protected]> # on AML-S905D3-CC Acked-by: Ilias Apalodimas <[email protected]>