summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2025-12-24cmd: bdinfo: provide long help with all optionsQuentin Schulz
Document the bdinfo -a, -e and -m options in the long help, but only when they can be used. The string concatenation is a bit odd with two newlines, but it does render properly once in U-Boot CLI. Tested-by: Michal Simek <[email protected]> Signed-off-by: Quentin Schulz <[email protected]>
2025-12-24cmd/bdinfo: LMB and device-tree are not relatedHeinrich Schuchardt
The usage of the LMB library and the device-tree source are not related. Remove the dependency in the bdinfo output and adjust the unit test. Reviewed-by: Ilias Apalodimas <[email protected]> Signed-off-by: Heinrich Schuchardt <[email protected]>
2025-12-24test: dm: clk_ccf: clean up assert statementsHeinrich Schuchardt
* Expected values must always be the first arguments. * Long values on 64 bit systems require ut_asserteq_64() for checking Signed-off-by: Heinrich Schuchardt <[email protected]>
2025-12-22Merge tag 'v2026.01-rc5' into nextTom Rini
Prepare v2026.01-rc5
2025-12-18test/py, buildman: Update filelock package versionTom Rini
The GitHub dependabot tool has reported a "medium" priority bug CVE-2025-68146, with this package. Update to the patched version. Reported-by: GitHub dependabot Signed-off-by: Tom Rini <[email protected]>
2025-12-18Merge tag 'u-boot-socfpga-next-20251217' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-socfpga into next This pull request brings together a set of fixes and enhancements across the SoCFPGA platform family, with a focus on MMC/SPL robustness, EFI boot enablement, and Agilex5 SD/eMMC support. CI: https://source.denx.de/u-boot/custodians/u-boot-socfpga/-/pipelines/28776 Highlights: * SPL / MMC: o Fix Kconfig handling for SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE o Correct raw sector calculations and respect explicit sector values when loading U-Boot from MMC in SPL o Adjust raw MMC loading logic for SoCFPGA platforms * EFI boot: o Permit EFI booting on SoCFPGA platforms o Disable mkeficapsule tool build for Arria 10 where unsupported * Agilex5: o Upgrade SDHCI controller from SD4HC to SD6HC o Enable MMC and Cadence SDHCI support in defconfig o Add dedicated eMMC device tree and defconfig for Agilex5 SoCDK o Revert incorrect GPIO configuration for SDIO_SEL o Refine U-Boot DT handling for SD and eMMC boot variants * SPI: o Allow disabling the DesignWare SPI driver in SPL via Kconfig * Board / configuration fixes: o Enable random MAC address generation for Cyclone V o Fix DE0-Nano-SoC boot configuration o Remove obsolete or conflicting options from multiple legacy SoCFPGA defconfigs
2025-12-12Revert "clk: Return value calculated by ERR_PTR"Tom Rini
While this change was intended to fix a mistake in the code, of calling the ERR_PTR macro but not making use of the result, it seems that functionally platforms depend on the loop not existing here. The TI K3 families of platforms for example were broken by this commit. This reverts commit fe780310cfa8bf5a093894b5cd7fe85c6b02fd91. Reported-by: Nishanth Menon <[email protected]> Reviewed-by: Andrew Goodbody <[email protected]> Reviewed-by: Nishanth Menon <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2025-12-11Merge tag 'u-boot-dfu-next-20251211' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-dfu into next u-boot-dfu-next-20251211: CI: https://source.denx.de/u-boot/custodians/u-boot-dfu/-/pipelines/28724 Android: * Fix 8-byte alignment for newer versions of libfdt
2025-12-10test: dm: fdtdec: Validate FDT size in unit testAdriana Nicolae
The current FDT decoding tests calculate the memory required for FDT manipulation by directly adding a fixed margin to fdt_totalsize(gd->fdt_blob). The static analyzer flagged "gd->fdt_blob->totalsize" as a tainted value being passed to fdt_open_into(). Ensure the size is validated by checking that the total size is within a reasonable maximum FDT limit for unit tests. Signed-off-by: Adriana Nicolae <[email protected]>
2025-12-08Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-riscv ↵Tom Rini
into next CI: https://source.denx.de/u-boot/custodians/u-boot-riscv/-/pipelines/28674 - riscv: Implement private GCC library - mpfs: Add MPFS CPU Implementation - andes: Stop disabling device tree relocation and some minor fixes - sifive: Stop disabling device tree relocation - starfive: Cleanup size types and typos
2025-12-08Merge tag 'v2026.01-rc4' into nextTom Rini
Prepare v2026.01-rc4
2025-12-08test: provide unit tests for the RISC-V private GCC libraryHeinrich Schuchardt
Add unit tests for the functions for counting leading and trailing zero bits. Signed-off-by: Heinrich Schuchardt <[email protected]>
2025-12-06Merge patch series "test/py: fit: Deduplicate the test"Tom Rini
This series from Marek Vasut <[email protected]> cleans up some of the FIT pytests we have and then extends mkimage to support including the TEE in FIT images when using "-f auto" to create the resulting FIT. Link: https://lore.kernel.org/r/[email protected]
2025-12-06mkimage: Add support for bundling TEE in mkimage -f autoMarek Vasut
Introduce two new parameters to be used with mkimage -f auto to bundle TEE image into fitImage, using auto-generated fitImage. Add -z to specify TEE file name and -Z to specify TEE load and entry point address. This is meant to be used with systems which boot all of TEE, Linux and its DT from a single fitImage, all booted by U-Boot. Example invocation: " $ mkimage -E -A arm -C none -e 0xc0008000 -a 0xc0008000 -f auto \ -d arch/arm/boot/zImage \ -b arch/arm/boot/dts/st/stm32mp135f-dhcor-dhsbc.dtb \ -z ../optee_os/out/arm-plat-stm32mp1/core/tee-raw.bin \ -Z 0xde000000 \ /path/to/output/fitImage " Documentation update and test are also included, the test validates both positive and negative test cases, where fitImage does not include TEE and does include TEE blobs. Acked-by: Quentin Schulz <[email protected]> Signed-off-by: Marek Vasut <[email protected]>
2025-12-06test/py: fit: Deduplicate the testMarek Vasut
Introduce generate_and_check_fit_image() and call it with various parameters to test various configurations of the fitImage. This is identical to the existing test, expect for the code duplication. Reviewed-by: Quentin Schulz <[email protected]> Signed-off-by: Marek Vasut <[email protected]>
2025-12-05Merge patch series "clk: Return value calculated by ERR_PTR"Tom Rini
Andrew Goodbody <[email protected]> says: Smatch reported an error where a value calculated by ERR_PTR was not used. Fixing this to return the generated value led to a test failure which meant updating the sandbox clock code so that it would still cause the tests to pass with the above correction. Debugging this problem led to a SIGSEGV which is addressed in 1/3. Possible memory leaks noticed are addressed in 3/3. Link: https://lore.kernel.org/r/[email protected]
2025-12-05clk: Return value calculated by ERR_PTRAndrew Goodbody
In clk_set_default_get_by_id ret is passed to ERR_PTR but nothing is done with the value that this calculates which is obviously not the intention of the code. This is confirmed by the code around where this function is called. Instead return the value from ERR_PTR. Then fixup the sandbox code so that the test dm_test_clk does not fail as it relied on the broken behaviour. Finally disable part of the test that does not work correctly with CLK_AUTO_ID This issue found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-12-05test/py: android: Point fdt command to aligned addressesMarek Vasut
Newer versions of libfdt strictly check whether the FDT blob passed to them is at 8-byte aligned offset, if it is not, then the library fails checks with -FDT_ERR_ALIGNMENT . Currently, 'abootimg get dtb --index=1 addr size' may return non 8-byte aligned FDT address which points directly into the abootimg. Copy the result into temporary location before validation to avoid FDT alignment check failure. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mattijs Korpershoek <[email protected]>
2025-12-05Merge patch series "test: let UNIT_TEST imply CONSOLE_RECORD"Tom Rini
Heinrich Schuchardt <[email protected]> says: Many C unit tests are not executed if CONFIG_CONSOLE_RECORD is not set. Hence Tom suggested to let UNIT_TEST imply CONSOLE_RECORD. The first patch makes the skipped C unit tests visible. The rest of the series deals with hidden bugs in our tests. The 'fdt get value' command returned incorrect values on low-endian systems. So this needed fixing too. Link: https://lore.kernel.org/r/[email protected]
2025-12-05test: let UNIT_TEST imply CONSOLE_RECORDHeinrich Schuchardt
The cmd and the log test suites rely on CONFIG_CONSOLE_RECORD. The log test suite is always built if CONFIG_UNIT_TEST=y. The print_do_hex_dump test relies on CONFIG_HEXDUMP. Imply it too. Signed-off-by: Heinrich Schuchardt <[email protected]>
2025-12-05cmd: fix 'fdt get value'Heinrich Schuchardt
The 32bit cells of a device-tree property are big-endian. When printing them via 0x08x we must first convert to the host endianness. Remove the restriction to 20 bytes length. This would not allow to read an SHA256 value. Signed-off-by: Heinrich Schuchardt <[email protected]>
2025-12-05test: cmd/bdinfo: consider PPC architecture specific infoHeinrich Schuchardt
On the power architecture the bdinfo command prints architecture specific information. The test needs to accept these output lines. Signed-off-by: Heinrich Schuchardt <[email protected]>
2025-12-05test: relax cread_test time constraintHeinrich Schuchardt
The ppce500 is not as fine grained as expected. Signed-off-by: Heinrich Schuchardt <[email protected]>
2025-12-05test: fix cmt/msr testHeinrich Schuchardt
The original value of the first variable msr (0x200) is not controlled by U-Boot. Don't make any assumption. Signed-off-by: Heinrich Schuchardt <[email protected]>
2025-12-05test: consider endianness in print_display_bufferHeinrich Schuchardt
Hexdumps for types other then byte look different in dependence of the endianness. Signed-off-by: Heinrich Schuchardt <[email protected]>
2025-12-05test: fix bdinfo_test_all boot_params expectationHeinrich Schuchardt
The value of boot_params is device specific and non-zero on many boards. Signed-off-by: Heinrich Schuchardt <[email protected]>
2025-12-05test: correct comments in test/cmd/font.cHeinrich Schuchardt
The test relates to the 'font' and not to the 'fdt' command. Signed-off-by: Heinrich Schuchardt <[email protected]>
2025-12-05test: the cmd/font test requires the sandboxHeinrich Schuchardt
The font test makes assumptions about video devices and selected fonts that may not hold true on other configurations like qemu-x86_64_defconfig. Signed-off-by: Heinrich Schuchardt <[email protected]>
2025-12-05test: do not assume memory size 256 MiB in cmd_test_meminfoHeinrich Schuchardt
256 GiB is the default memory size of the sandbox. But in our CI other boards like qemu-x86_64_defconfig run with a different memory size. Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]>
2025-12-05test: cmd_exit_test depends on CONFIG_HUSH_PARSERHeinrich Schuchardt
The exit command is not available if CONFIG_HUSH_PARSER=n Signed-off-by: Heinrich Schuchardt <[email protected]>
2025-12-05test: bdinfo: correct expected X86 arch infoHeinrich Schuchardt
Skipping to the line starting with tsc reaches the tsc_base output not the final tsc output. Expect all the X86 specific lines in the bdinfo output. Signed-off-by: Heinrich Schuchardt <[email protected]>
2025-12-05test: print_do_hex_dump test depends on HEXDUMPHeinrich Schuchardt
Skip the test if CONFIG_HEXDUMP=n Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]>
2025-12-05test: don't test for CONFIG_UNIT_TEST twiceHeinrich Schuchardt
Makefile already checks CONFIG_UNIT_TEST. There is point in checking it in test/Makefile again. Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]>
2025-12-05test: print_display_buffer must consider 64bit supportHeinrich Schuchardt
Function print_buffer() does not support printing u64 on 32bit systems. Signed-off-by: Heinrich Schuchardt <[email protected]>
2025-12-05test: cmd/bdinfo: consider ARM architecture specific infoHeinrich Schuchardt
On ARM the bdinfo command prints architecture specific information. The test needs to accept these output lines. Signed-off-by: Heinrich Schuchardt <[email protected]> Acked-by: Ilias Apalodimas <[email protected]>
2025-12-05test: Let pytest indicate skipped C unit testsHeinrich Schuchardt
We invoke the ut command in test_ut.py. Currently we only check for failures. Instead we should also indicate if sub-tests were skipped. With this change we will get output like the following for skipped tests: test/py/tests/test_ut.py ..sssss......ss..............s.sssss.s.s... ================================ short test summary info ================================ SKIPPED [1] test/py/tests/test_ut.py:597: Test addrmap addrmap_test_basic has 1 skipped sub-test(s). SKIPPED [1] test/py/tests/test_ut.py:597: Test bdinfo bdinfo_test_eth has 4 skipped sub-test(s). Signed-off-by: Heinrich Schuchardt <[email protected]>
2025-12-04test: strlcat: Fix SPDX licenseSean Anderson
When I modified this code I meant to accept the LGPL offer to convert the license to GPL. However, while there is an LGPL 2.1, the next version of the GPL after 2.0 is 3.0. Fix the license version Fixess: c4ac52f55d9 ("test: Add test for strlcat") Signed-off-by: Sean Anderson <[email protected]>
2025-12-04Merge patch series "Add support for SM3 secure hash"Tom Rini
Heiko Schocher <[email protected]> says: Add SM3 secure hash, as specified by OSCCA GM/T 0004-2012 SM3 and described at https://datatracker.ietf.org/doc/html/draft-sca-cfrg-sm3-02 TPMv2 defines hash algo sm3_256, which is currently not supported and prevented TPMv2 chip with newer firmware to work with U-Boot. Seen this on a ST33TPHF2XI2C u-boot=> tpm2 init u-boot=> tpm2 autostart tpm2_get_pcr_info: too many pcrs: 5 Error: -90 u-boot=> Implement sm3 hash, so we can fix this problem. Link: https://lore.kernel.org/r/[email protected]
2025-12-04test: cmd: fix a typo in md5 testHeiko Schocher
In dm_test_cmd_hash_md5 accidentially sha256 hash ist used. Use the correct md5 hash instead. Signed-off-by: Heiko Schocher <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]>
2025-12-04test: cmd: hash: add unit test for sm3_256Heiko Schocher
add simple test for sm3 256 hash Signed-off-by: Heiko Schocher <[email protected]>
2025-12-02boot/bootfdt: Add smbios3-entrypoint to FDT for non-EFI bootsAdriana Nicolae
The Linux kernel can discover SMBIOS tables through two primary methods: 1. Via EFI tables, when using EFI boot; 2. Via the 'smbios3-entrypoint' property in the /chosen node of the device tree. When U-Boot boots a Linux kernel using a non-EFI command ("bootm", "bootz", or "booti"), the kernel relies on the device tree to detect the hardware. If SMBIOS tables are available in U-Boot, they should be passed to the kernel via this device tree property. This patch modifies boot_fdt_prepare(), to inject the SMBIOSv3 table address into the device tree if there is a table generated by U-boot. The "board_fdt_chosen_smbios" is weak in order to leave the possibilty for specific boards to select custom SMBIOS addresses. The changes in this patch are added in the context of supporting this device tree property in linux kernel: https://lkml.org/lkml/2025/10/24/1393 Device tree schema was updated to include the "smbios3-entrypoint" node in pull request: https://github.com/devicetree-org/dt-schema/pull/177 Signed-off-by: Adriana Nicolae <[email protected]>
2025-11-28test/py: Use aligned address for overlays in 'extension' testMarek Vasut
The 'extension' test would set 'extension_overlay_addr' variable to decimal 4096 due to conversion in python. The 'extension_overlay_addr' is however sampled using env_get_hex("extension_overlay_addr", 0); which converts the 4096 to 0x4096 and uses that as DT overlay address, which is unaligned. Fix this by setting extension_overlay_addr to 0x1000 as intended, which is aligned. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Tom Rini <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]>
2025-11-28sandbox: Fix DT compiler address warnings in sandbox DTsMarek Vasut
Trivially fix the following warnings in sandbox DTs, which show up with DTC 1.7.2. Fill in the missing address and adjust emulated I2C address to fit the 7bit address limit: " arch/sandbox/dts/sandbox.dtsi:138.30-140.5: Warning (i2c_bus_reg): /i2c@0/sandbox_pmic: I2C bus unit address format error, expected "40" arch/sandbox/dts/sandbox.dtsi:146.18-161.5: Warning (i2c_bus_reg): /i2c@0/emul: I2C bus unit address format error, expected "ff" arch/sandbox/dts/sandbox.dtsi:148.4-17: Warning (i2c_bus_reg): /i2c@0/emul:reg: I2C address must be less than 7-bits, got "0xff". Set I2C_TEN_BIT_ADDRESS for 10 bit addresses or fix the property " " arch/sandbox/dts/.test.dtb.pre.tmp:912.18-926.5: Warning (i2c_bus_reg): /i2c@0/emul: I2C bus unit address format error, expected "ff" arch/sandbox/dts/.test.dtb.pre.tmp:913.4-17: Warning (i2c_bus_reg): /i2c@0/emul:reg: I2C address must be less than 7-bits, got "0xff". Set I2C_TEN_BIT_ADDRESS for 10 bit addresses or fix the property arch/sandbox/dts/.test.dtb.pre.tmp:928.30-931.5: Warning (i2c_bus_reg): /i2c@0/sandbox_pmic: I2C bus unit address format error, expected "40" " Fix up pmic test to match. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Heiko Schocher <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]>
2025-11-24Merge tag 'v2026.01-rc3' into nextTom Rini
Prepare v2026.01-rc3
2025-11-21test: cmd/fdt: do not use fixed buffer addressesHeinrich Schuchardt
The location of memory depends on the board. Do not assume memory at fixed memory locations. Use memalign() instead to allocate a buffer. Acked-by: Ilias Apalodimas <[email protected]> Signed-off-by: Heinrich Schuchardt <[email protected]>
2025-11-21test: common/print: do not use fixed buffer addressesHeinrich Schuchardt
The location of memory depends on the board. Do not assume memory at fixed memory locations. Use calloc() instead to allocate buffers. Acked-by: Ilias Apalodimas <[email protected]> Signed-off-by: Heinrich Schuchardt <[email protected]>
2025-11-21test: cmd/bdinfo: consider arch_print_bdinfo() outputHeinrich Schuchardt
On x86 commit 9b35dbc93fd4 ("x86: Show the timestamp counter with bdinfo") has added another bdinfo output line. On RISC-V commit 66b5ee9c558e ("riscv: add RISC-V fields to bdinfo command") implemented arch_print_bdinfo(). Update the bdinfo test accordingly. Fixes: 9b35dbc93fd4 ("x86: Show the timestamp counter with bdinfo") Fixes: 66b5ee9c558e ("riscv: add RISC-V fields to bdinfo command") Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Heinrich Schuchardt <[email protected]>
2025-11-21test: cmd/bdinfo: make no flash assumptionHeinrich Schuchardt
The location and size of flash is device-dependent. Do not make any assumption about the location and size. Reviewed-by: Simon Glass <[email protected]> Acked-by: Ilias Apalodimas <[email protected]> Signed-off-by: Heinrich Schuchardt <[email protected]>
2025-11-21test: cmd/fdt: do not assume RNG device existsHeinrich Schuchardt
In fdt_test_chosen() currently we test if DM_RNG is configured. CONFIG_DM_RNG=y does not imply that a RNG device actually exists. For instance QEMU may be called with -device virtio-rng-device or not. The current test framework evicts the virtio RNG device even if QEMU is called with -device virtio-rng-device. In the fdt_test_chosen() check if a RNG device exists. Ignore 'No RNG device' messages. Acked-by: Ilias Apalodimas <[email protected]> Signed-off-by: Heinrich Schuchardt <[email protected]>
2025-11-21test: fdt_test_apply requires CONFIG_OF_LIBFDT_OVERLAYHeinrich Schuchardt
The `fdt apply` sub-command is only available if CONFIG_OF_LIBFDT_OVERLAY is enabled. Signed-off-by: Heinrich Schuchardt <[email protected]>