summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2025-05-11efi_loader: fix dtbdump output color and formatAdriano Cordova
Imitate in dtbdump what initrddump does for color, newlines and input handling. The output parsing in the CI is strict and with the current output the CI is not recongnizing the prompt '=>'. Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-05-05bootm: improve error message when gzip decompression buffer is too smallAristo Chen
Currently, when decompressing a gzip-compressed image during bootm, a generic error such as "inflate() returned -5" is shown when the buffer is too small. However, it is not immediately clear that this is caused by CONFIG_SYS_BOOTM_LEN being too small. This patch improves error handling by: - Detecting Z_BUF_ERROR (-5) returned from the inflate() call - Suggesting the user to increase CONFIG_SYS_BOOTM_LEN when applicable - Preserving the original return code from zunzip() instead of overwriting it with -1 By providing clearer hints when decompression fails due to insufficient buffer size, this change helps users diagnose and fix boot failures more easily. Signed-off-by: Aristo Chen <aristo.chen@canonical.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2025-05-02Merge patch series "Qualcomm: cleanup OF_LIVE fixup and fix RB1/2"Tom Rini
Caleb Connolly <caleb.connolly@linaro.org> says: Introduce a new event to signal that the live tree has been built, allowing boards to perform fixups on the tree before devices are bound. Crucially this allows for devices to be enabled or disabled, but also allows for properties that are parsed during the bind stage to be modified (such as dr_mode for dwc3). With this in place, mach-snapdragon is switched over to use the event and some hacky U-Boot specific DT overrides (which had to be undone prior to booting an image) are removed in favour of fixing up the livetree (which is not passed on to further boot stages). Finally, some minor fixes are made for the QCM2290 RB1 board, the sdcard is enabled and it now uses USB host mode in U-Boot like it's bigger sibling the RB2. Link: https://lore.kernel.org/r/20250411-livetree-fixup-v2-0-1236823377bb@linaro.org
2025-05-02event: signal when livetree has been builtCaleb Connolly
OF_LIVE offers a variety of benefits, one of them being that the live tree can be modified without caring about the underlying FDT. This is particularly valuable for working around U-Boot limitations like lacking USB superspeed support on Qualcomm platforms, no runtime OTG, or peripherals like the sdcard being broken (and displaying potentially worrying error messages). Add an event to signal when the live tree has been built so that we can apply fixups to it directly before devices are bound. Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2025-05-01Merge tag 'dm-pull-mayday' of git://git.denx.de/u-boot-dmTom Rini
Support for calculating video damage
2025-05-01efi_loader: GOP: Add damage notification on BLTAlexander Graf
Now that we have a damage tracking API, let's populate damage done by UEFI payloads when they BLT data onto the screen. Signed-off-by: Alexander Graf <agraf@csgraf.de> Reported-by: Da Xue <da@libre.computer> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> [Alper: Add struct comment for new member] Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Link: https://lore.kernel.org/u-boot/20230821135111.3558478-10-alpernebiyasak@gmail.com/
2025-05-01efi_loader: fix typo initd_sz to initrd_szAdriano Cordova
Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2025-05-01efi_loader: bootbin: do not load an initrd if none is providedAdriano Cordova
Do not try to create an initrd device path nor try to register an initrd with the EFI_LOAD_FILE2_PROTOCOL if none is provided. Handle initrd installation in efi_binary_run_dp with efi_install_initrd, imitating what is done for the fdt. Fixes: 36835a9105c ("efi_loader: binary_run: register an initrd") Reported-by: Weizhao Ouyang <o451686892@gmail.com> Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com> Tested-by: Weizhao Ouyang <o451686892@gmail.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2025-04-28Merge patch series "bloblist: fix the overriding of fdt from bloblist"Tom Rini
This series from Raymond Mao <raymond.mao@linaro.org> fixes some cases of passing the device tree to U-Boot via standard passage and then ensures that we set the environment variable of the device tree correctly in this case. Link: https://lore.kernel.org/r/20250331224011.2734284-1-raymond.mao@linaro.org
2025-04-28bloblist: fix the overriding of fdt from bloblistRaymond Mao
When a bloblist is valid and contains fdt, it explicitly means a previous boot stage is passing transfer list compliant with Firmware Handoff specification, thus the fdt from bloblist should not be overridden with the ones from board or env variables. Fixes: 70fe23859437 ("fdt: Allow the devicetree to come from a bloblist") Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2025-04-25efi_loader: print image load address in StartImageHeinrich Schuchardt
When starting image add the image load address to the debug output. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-04-25efi_loader: build with HII configuration protocolHeinrich Schuchardt
Without the HII configuration protocol the debug version of the UEFI shell cannot be used. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-04-24smbios: Do not look up children of invalid nodesSamuel Holland
If there is no UCLASS_SYSINFO device available, parent_node will be ofnode_null(). Calling ofnode_find_subnode() then triggers an assertion: drivers/core/ofnode.c:598: ofnode_find_subnode: Assertion `ofnode_valid(node)' failed. Check for a valid parent_node, not just that OF_CONTROL is enabled. Fixes: 44ffb6f0ecaf ("smbios: Allow properties to come from the device tree") Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
2025-04-23Merge patch series "Uthreads"Tom Rini
Jerome Forissier <jerome.forissier@linaro.org> says: This series introduces threads and uses them to improve the performance of the USB bus scanning code and to implement background jobs in the shell via two new commands: 'spawn' and 'wait'. The threading framework is called 'uthread' and is inspired from the barebox threads [2]. setjmp() and longjmp() are used to save and restore contexts, as well as a non-standard extension called initjmp(). This new function is added in several patches, one for each architecture that supports HAVE_SETJMP. A new symbol is defined: HAVE_INITJMP. Two tests, one for initjmp() and one for the uthread scheduling, are added to the lib suite. After introducing threads and making schedule() and udelay() a thread re-scheduling point, the USB stack initialization is modified to benefit from concurrency when UTHREAD is enabled, where uthreads are used in usb_init() to initialize and scan multiple busses at the same time. The code was tested on arm64 and arm QEMU with 4 simulated XHCI buses and some devices. On this platform the USB scan takes 2.2 s instead of 5.6 s. Tested on i.MX93 EVK with two USB hubs, one ethernet adapter and one webcam on each, "usb start" takes 2.4 s instead of 4.6 s. Finally, the spawn and wait commands are introduced, allowing the use of threads from the shell. Tested on the i.MX93 EVK with a spinning HDD connected to USB1 and the network connected to ENET1. The USB plus DHCP init sequence "spawn usb start; spawn dhcp; wait" takes 4.5 seconds instead of 8 seconds for "usb start; dhcp". [1] https://patchwork.ozlabs.org/project/uboot/list/?series=446674 [2] https://github.com/barebox/barebox/blob/master/common/bthread.c Link: https://lore.kernel.org/r/20250418141114.2056981-1-jerome.forissier@linaro.org
2025-04-23lib: time: hook uthread_schedule() into udelay()Jerome Forissier
Introduce a uthread scheduling loop into udelay() when CONFIG_UTHREAD is enabled. This means that any uthread calling into udelay() may yield to uthread and be scheduled again later. There is no delay in the scheduling loop because tests have shown that such a delay can have a detrimental effect on the console (input drops characters). Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-04-23uthread: add uthread_mutexJerome Forissier
Add struct uthread_mutex and uthread_mutex_lock(), uthread_mutex_trylock(), uthread_mutex_unlock() to protect shared data structures from concurrent modifications. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2025-04-23uthread: add cooperative multi-tasking interfaceJerome Forissier
Add a new internal API called uthread (Kconfig symbol: UTHREAD) which provides cooperative multi-tasking. The goal is to be able to improve the performance of some parts of U-Boot by overlapping lengthy operations, and also implement background jobs in the U-Boot shell. Each uthread has its own stack allocated on the heap. The default stack size is defined by the UTHREAD_STACK_SIZE symbol and is used when uthread_create() receives zero for the stack_sz argument. The implementation is based on context-switching via initjmp()/setjmp()/ longjmp() and is inspired from barebox threads [1]. A notion of thread group helps with dependencies, such as when a thread needs to block until a number of other threads have returned. The name "uthread" comes from "user-space threads" because the scheduling happens with no help from a higher privileged mode, contrary to more complex models where kernel threads are defined. But the 'u' may as well stand for 'U-Boot' since the bootloader may actually be running at any privilege level and the notion of user vs. kernel may not make much sense in this context. [1] https://github.com/barebox/barebox/blob/master/common/bthread.c Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-04-22Merge patch series "ut: fix print_guid() and enable UNIT_TEST for qemu_arm64"Tom Rini
Jerome Forissier <jerome.forissier@linaro.org> says: There is a bug in the print_guid() unit test in test/common/print.c when PARTITION_TYPE_GUID is not enabled but either CMD_EFIDEBUG or EFI are. The first patch fixes the issue and the second one enables UNIT_TEST in the qemu_arm64 defconfig so that the unit tests are run in CI (this platform has CMD_EFIDEBUG so the bug applies). Link: https://lore.kernel.org/r/20250416074839.1267396-1-jerome.forissier@linaro.org
2025-04-22lib/uuid.c: use unique name for PARTITION_SYSTEM_GUIDJerome Forissier
The name defined for PARTITION_SYSTEM_GUID in list_guid[] depends on configuration options. It is "system" if CONFIG_PARTITION_TYPE_GUID is enabled or "System Partition" if CONFIG_CMD_EFIDEBUG or CONFIG_EFI are enabled. In addition, the unit test in test/common/print.c is incorrect because it expects only "system" (or a hex GUID). Make things more consistent by using a clear and unique name: "EFI System Partition" whatever the configuration, and update the unit test accordingly. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2025-04-19efi_selftest: check executing in EL2Heinrich Schuchardt
UEFI binaries should be executed in EL2 or EL1 even if U-Boot is started in EL3. Provide a unit test. Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-04-14Merge patch series "Static initcalls"Tom Rini
Jerome Forissier <jerome.forissier@linaro.org> says: This series replaces the dynamic initcalls (with function pointers) with static calls, and gets rid of initcall_run_list(), init_sequence_f, init_sequence_f_r and init_sequence_r. This makes the code simpler and the binary slighlty smaller: -2281 bytes/-0.21 % with LTO enabled and -510 bytes/-0.05 % with LTO disabled (xilinx_zynqmp_kria_defconfig). Execution time doesn't seem to change noticeably. There is no impact on the SPL. The inline assembly fixes, although they look unrelated, are triggered on some platforms with LTO enabled. For example: kirkwood_defconfig. CI: https://source.denx.de/u-boot/custodians/u-boot-net/-/pipelines/25514 Link: https://lore.kernel.org/r/20250404135038.2134570-1-jerome.forissier@linaro.org
2025-04-14initcall: remove initcall_run_list()Jerome Forissier
Now that all initcalls have been converted to static calls, remove initcall_run_list(). Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2025-04-13efi_loader: Moved the generated ESL file to objtreeIlias Apalodimas
Tom reports that generating the ESL file we need for authenticated capsule updates fails to work on azure which expects a RO git tree. Move it to $(objtree) Reported-by: Tom Rini <trini@konsulko.com> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-04-11Merge patch series "Switch to using $(PHASE_) in Makefiles"Tom Rini
Tom Rini <trini@konsulko.com> says: This series switches to always using $(PHASE_) in Makefiles when building rather than $(PHASE_) or $(XPL_). It also starts on documenting this part of the build, but as a follow-up we need to rename doc/develop/spl.rst and expand on explaining things a bit. Link: https://lore.kernel.org/r/20250401225851.1125678-1-trini@konsulko.com
2025-04-11Kbuild: Always use $(PHASE_)Tom Rini
It is confusing to have both "$(PHASE_)" and "$(XPL_)" be used in our Makefiles as part of the macros to determine when to do something in our Makefiles based on what phase of the build we are in. For consistency, bring this down to a single macro and use "$(PHASE_)" only. Signed-off-by: Tom Rini <trini@konsulko.com>
2025-04-11efi_selftest: remove un-needed NULL checksBryan Brattlof
Because we've already returned early in the event 'handle' is NULL we don't need these extra not NULL checks. Remove them Signed-off-by: Bryan Brattlof <bb@ti.com> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-04-11acpi: select CONFIG_BLOBLISTHeinrich Schuchardt
Since commit 53d5a221632e ("emulation: Use bloblist to hold tables") `make qemu-riscv64_smode_defconfig acpi.config && make` fails with qfw_acpi.c:146:(.text.evt_write_acpi_tables+0xc): undefined reference to `bloblist_add' Build with bloblist support. Fixes: 53d5a221632e ("emulation: Use bloblist to hold tables") Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-04-11efi_loader: Move public cert for capsules to .rodataIlias Apalodimas
commit ddf67daac39d ("efi_capsule: Move signature from DTB to .rodata") was reverted in commit 47a25e81d35c ("Revert "efi_capsule: Move signature from DTB to .rodata"") because that's what U-Boot was usually doing -- using the DT to store configuration and data. Some of the discussions can be found here [0]. (Ab)using the device tree to store random data isn't ideal though. On top of that with new features introduced over the years, keeping the certificates in the DT has proven to be problematic. One of the reasons is that platforms might send U-Boot a DTB from the previous stage loader using a transfer list which won't contain the signatures since other loaders are not aware of internal U-Boot ABIs. On top of that QEMU creates the DTB on the fly, so adding the capsule certificate there does not work and requires users to dump it and re-create it injecting the public keys. Now that we have proper memory permissions for arm64, move the certificate to .rodata and read it from there. [0] https://lore.kernel.org/u-boot/CAPnjgZ2uM=n8Qo-a=DUkx5VW5Bzp5Xy8=Wgmrw8ESqUBK00YJQ@mail.gmail.com/ Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Tested-by: Jonathan Humphreys <j-humphreys@ti.com> # on TI sk-am62p-lp Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on AML-A311D-CC Tested-by: Raymond Mao <raymond.mao@linaro.org>
2025-04-11efi_loader: handle malloc() errorsVincent Stehlé
The new_packagelist() function of the HII Protocols implementation is calling malloc() without checking its return code; fix this. Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de> Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org> Cc: Tom Rini <trini@konsulko.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-04-11efi_loader: Print extra information from the bootmgrIlias Apalodimas
Instead of just printing the label, add information for the Device path as well so it's easier to see if we are booting from disk, network etc Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-04-11efi: Fix efiboot for payloads loaded from memoryChristian Kohlschütter
Calling bootefi on an address that was loaded from memory (e.g., cramfs or SPI flash via "sf read", etc.), currently results in the EFI binary not being able to access the EFI image device path. For example, iPXE would fail with an error "EFI could not get loaded image's device path: Error 0x7f39e082 (https://ipxe.org/7f39e082)". This is due to an incomplete special-case in efi_binary_run, where a new device path was created but not used in all required places. Fix the in-memory special case, set the "bootefi_device_path" to the generated "file_path". iPXE will now boot, and report the device path as "/MemoryMapped(0x0,0xSTART,0xLEN)" Signed-off-by: Christian Kohlschütter <christian@kohlschutter.com> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-04-11efi_loader: binary_run: register an initrdAdriano Cordova
Add support to install an initrd when running an EFI binary with efi_binary_run Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-04-11efi_loader: efi_load_initrd: provide a memory mapped initrdAdriano Cordova
U-Boot can pass an initrd to subsequent boot stages via the EFI_LOAD_FILE2_PROTOCOL. The current implementation only supports this functionality via the efi boot manager: the initrd is taken from the load options of the BootCurrent variable. This commit adds support for registering a memory mapped initrd, e.g. loaded from a FIT image. For now this new method takes precedence over loading the initrd from the BootCurrent variable (if both are present) because the BootCurrent variable is not cleared on exiting the boot manager. Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-04-11efi: Make FDT extra space configurablePawel Kochanowski
U-Boot currently reserves only 0x3000 bytes when copying the FDT in copy_fdt(), which may not be sufficient if additional nodes (such as FMAN firmware) are added later. This patch uses the exisitng SYS_FDT_PAD to reserve space for FDT fixup instead of hardcoded value. This change prevents potential corruption when resizing FDT after EFI boot, especially when firmware like FMAN requires additional space. Signed-off-by: Gabriel Nesteruk <gnesteruk@sii.pl> Signed-off-by: Pawel Kochanowski <pkochanowski@sii.pl> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-04-11efi_loader: Install the ACPI table from the bloblistSimon Glass
When BLOBLIST_TABLES is used, the ACPI tables are not currently added to the list of EFI tables. While we don't want to create a new memory region, we do want to tell EFI about the tables. Fix this by covering this case. At some point the non-bloblist code can likely be removed. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: 3da59ee9579 ("efi_loader: Avoid mapping the ACPI tables twice") Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2025-04-11board: remove capsule update support in set_dfu_alt_info()Jonathan Humphreys
Now that capsule update sets the dfu_alt_info environment variable explicitly, there is no need to support it in the set_dfu_alt_info() function. Decouple SET_DFU_ALT_INFO from EFI_CAPSULE_FIRMWARE_FIT and EFI_CAPSULE_FIRMWARE_RAW. For many boards, this was the only use of set_dfu_alt_info() so remove the function entirely. Fixes: a9e6f01a941f ("efi: Define set_dfu_alt_info() for boards with UEFI capsule update enabled") Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com> Signed-off-by: Michal Simek <michal.simek@amd.com> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> # for board/libre-computer/* Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Wadim Egorov <w.egorov@phytec.de> # for
2025-04-11efi_firmware: set EFI capsule dfu_alt_info env explicitlyJonathan Humphreys
The current implementation of EFI capsule update uses set_dfu_alt_info() to set the dfu_alt_info environment variable with the settings it requires. However, set_dfu_alt_info() is doing this for all DFU operations, even those unrelated to capsule update. Thus other uses of DFU, such as DFU boot which sets its own value for the dfu_alt_info environment variable, will have that setting overwritten with the capsule update setting. Similarly, any user defined value for the dfu_alt_info environment variable would get overwritten when any DFU operation was performed, including simply performing a "dfu 0 list" command. The solution is stop using the set_dfu_alt_info() mechanism to set the dfu_alt_info environment variable and instead explicitly set it to the capsule update's setting just before performing the capsule update's DFU operation, and then restore the environment variable back to its original value. This patch implements the explicit setting and restoring of the dfu_alt_info environment variable as part of the EFI capsule update operation. The fix is fully implemented in a subsequent patch that removes the capsule update dfu_alt_info support in set_dfu_alt_info(). Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-04-08Merge patch series "Annotate switch/case fallthrough cases"Tom Rini
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
2025-04-08use proper fallthrough annotationsAndre Przywara
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>
2025-04-08zlib: annotate switch/case fallthrough casesAndre Przywara
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>
2025-04-08Merge patch series "acpi: simplify updating ACPI table header checksum"Tom Rini
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
2025-04-08tiny-printf: Improve %X formattingChristoph Niedermaier
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>
2025-04-08acpi: simplify updating header checksumHeinrich Schuchardt
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>
2025-04-08acpi: new function acpi_update_checksum()Heinrich Schuchardt
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>
2025-04-08Merge branch 'next'Tom Rini
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.
2025-04-06efi_loader: stop network in EXIT_BOOT_SERVICESHeinrich Schuchardt
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>
2025-04-06mbedtls: remove incorrect attribute type checkerRaymond Mao
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>
2025-04-03Merge patch series "membuff: Add tests and update to support a flag for ↵Tom Rini
empty/full" Simon Glass <sjg@chromium.org> says: The membuff implementation curently has no tests. It also assumes that head and tail can never correspond unless the buffer is empty. This series provides a compile-time flag to support a 'full' flag. It also adds some tests of the main routines. The data structure is also renamed to membuf which fits better with U-Boot. There may be some cases in the code which could be optimised a little, but the implementation is functional. Link: https://lore.kernel.org/r/20250318152059.1464369-1-sjg@chromium.org
2025-04-03membuf: Minor code-style improvementsSimon Glass
Show the start in end in the comment. Comment a missing variable in membuf_readline() and fix its line length. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03membuf: Correct implementation of membuf_dispose()Simon Glass
This should free the pointer, not the address of the pointer. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>