4708 Commits

Author SHA1 Message Date
Simon Glass
a603e20179 doc: malloc: Add a section on finding memory leaks
Document the practical workflow for detecting and diagnosing memory
leaks in U-Boot, particularly in sandbox builds. This covers:

- Using ut_check_delta() in unit tests for leak detection
- Comparing heap dumps with malloc_dump_to_file()
- Using malloc traffic logging to trace allocations
- Verifying debug functions don't affect heap state
- A step-by-step practical workflow

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2026-01-03 12:41:42 -07:00
Simon Glass
1d306039ce malloc: Add an option to disable mcheck-backtrace collection
Backtrace collection is relatively expensive and can significantly slow
down malloc()-heavy code when mcheck is enabled.

Add a new CONFIG_MCHECK_BACKTRACE option (default y) to allow disabling
backtrace collection while keeping the other mcheck features (canaries,
double-free detection, etc.) enabled. This allows using mcheck with less
overhead when caller information is not needed.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2026-01-03 12:41:32 -07:00
Simon Glass
7856369dc2 cmd: malloc: Add a command to show the malloc log
Add a command interface for the malloc-traffic log:
- malloc log start: Start recording allocations
- malloc log stop: Stop recording
- malloc log: Dump the recorded entries

Example output:

  => malloc log
  Malloc log: 29 entries (max 524288, total 29)
   Seq  Type                   Ptr      Size  Caller
  ----  --------  ----------------  --------  ------
     0  free              16a016e0         0  free_pipe_list:2001
                <-parse_stream_outer:3208 <-parse_file_outer:3300
     1  alloc             16a01b90        20  hush_file_init:3277
                <-parse_file_outer:3295 <-run_pipe_real:1986

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2026-01-03 12:41:32 -07:00
Simon Glass
1d0df266dc malloc: Add a log for malloc() traffic
Add a malloc()-traffic log that records all malloc()-related calls with
their addresses, sizes, and caller information. This is useful for
debugging allocation patterns and finding the source of allocations that
lack caller info in heap dumps.

Each entry stores:
- Operation type (alloc/free/realloc/memalign)
- Pointer address
- Size (and old size for realloc)
- Full caller backtrace string

On sandbox, the log buffer is allocated from host memory using
os_malloc(), so it does not affect U-Boot's heap. The size is
controlled by CONFIG_MCHECK_LOG_SIZE (default 512K entries).

If the log fills up, it wraps around (circular buffer) and a warning
is shown when dumping to indicate how many entries were lost.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2026-01-03 12:40:44 -07:00
Simon Glass
3f453d0110 video: truetype: Add a scratch buffer to use malloc() less
The stb_truetype library performs around 5 allocations per character
rendered, totalling approximately 26KB of temporary memory. This creates
significant malloc/free overhead and heap fragmentation.

Add a scratch buffer mechanism that pre-allocates memory once during
probe and reuses it for each character. The buffer is reset at the start
of each putc_xy() call, and allocations come from this buffer using a
simple bump allocator with 8-byte alignment.

If the scratch buffer is exhausted (e.g. for very complex glyphs), the
allocator falls back to malloc transparently.

The scratch buffer is controlled by two new Kconfig options:
- CONSOLE_TRUETYPE_SCRATCH: Enable/disable the feature (default y)
- CONSOLE_TRUETYPE_SCRATCH_SIZE: Buffer size in bytes (default 32KB)

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2026-01-03 12:39:14 -07:00
Simon Glass
b4f6fdbcd2 sandbox: Add -M option to disable mcheck at runtime
Add a command-line option (-M or --no_mcheck) to disable mcheck heap
protection at runtime. When mcheck is disabled, the wrapper functions
pass through directly to the underlying allocator without adding
headers or checking for corruption.

This is useful for debugging when mcheck interferes with test results,
such as when memory-leak detection reports false positives due to
accumulated allocations from other tests.

Changes:
- Add disable_mcheck flag to sandbox_state
- Add mcheck_set_disabled() function to mcheck API
- Modify dlmalloc wrappers to bypass mcheck when disabled
- Add stub for when MCHECK_HEAP_PROTECTION is not enabled
- Document the new option in sandbox.rst

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2026-01-03 12:39:14 -07:00
Simon Glass
e77755ed85 sandbox: Add gprof profiling support
Add a GPROF=1 build option to enable gprof profiling for sandbox. This
adds the -pg flag to both compiler and linker when GPROF=1 is set,
following the same pattern as the existing FTRACE option.

Usage:
  make GPROF=1 sandbox_defconfig all
  ./u-boot -T -c "ut dm"
  ...
  gprof u-boot gmon.out

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2026-01-03 12:39:14 -07:00
Simon Glass
8d23e827d5 ext4l: doc: Document ext4l_msgs environment variable
Add documentation for the ext4l_msgs environment variable which
controls whether the ext4l filesystem driver prints mount messages
when probing an ext4 filesystem.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2026-01-01 14:27:30 -07:00
Simon Glass
2b72029986 video: Correct the U-Boot logo
Update the ReadTheDocs documentation to use the correct U-Boot logo
from the original 2023 website, stickers and coins. This includes the
project name.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2026-01-01 14:27:24 -07:00
Simon Glass
84a64607a3 sandbox: Add --quiet_vidconsole option to speed up output
When running sandbox with lots of console output, the vidconsole slows
things down significantly since it renders truetype fonts to the
internal framebuffer. Add a -Q/--quiet_vidconsole command-line option
that removes vidconsole from stdout and stderr, using only the serial
console.

This can provide a ~300x speedup for output-heavy operations.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2026-01-01 14:27:12 -07:00
Simon Glass
20a8d1869b test: Add parallel test execution support
Running the full test suite takes a long time. It would be useful to
distribute tests across multiple sandbox instances to speed up testing.

Add support for running tests in parallel across multiple sandbox
instances. Each worker runs a subset of tests based on its worker ID.

Add -P<n>:<w> option to the ut command where n is the total number of
workers and w is this worker's ID (0 to n-1). Tests are distributed
by index modulo number of workers.

Series-to: u-boot
Series-cc: heinrich
Cover-letter:
test: Various improvements to unit-test infrastructure

This series adds several improvements to the unit-test infrastructure:

- Move disk images to the persistent-data directory so they don't
  pollute the source tree
- Add a way to keep pytest-created artefacts for faster iteration on
  C tests
- Add a helper to simplify running manual unit tests from Python
- Allow combined flags with the ut command (e.g. -Efm)
- Add a -E flag to emit machine-readable result lines
- Add a -P flag to distribute tests across parallel workers
- Add -m as an alias for -f (force manual tests)

These changes make it easier to run and debug tests, especially when
iterating on C test code.
END

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-29 16:18:51 +00:00
Simon Glass
dc6bbb7bdf doc: ut: Document return value
Add documentation for the return value of the ut command:
- Returns 0 on success if all tests pass
- Returns 1 on failure if any test fails
- Skipped tests do not cause a failure

Also explain when tests may be skipped and how to detect skipped tests
programmatically using the -E flag.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-29 16:18:51 +00:00
Simon Glass
e3708e22ca test: Add a flag to emit per-test result lines
The ut command shows test output but does not provide a machine-readable
indication of whether each individual test passed or failed. External
tools must rely on heuristics like scanning for failure patterns in the
output.

Add a -E flag that emits an explicit result line after each test:
  Result: PASS: test_name: file.c
  Result: FAIL: test_name: file.c

This allows tools to reliably determine per-test pass/fail status
without fragile pattern matching. The flag is optional to maintain
backward compatibility with existing scripts.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-29 16:18:51 +00:00
Simon Glass
9844bfd977 test: ut: Add -m as alias for the -f flag
Add -m as an alias for the -f flag which forces manual tests to run.
This provides consistency with external test runners that will use -m
for "manual" tests.

Also update the documentation to explain what manual tests are, and fix
a typo ("types" -> "times") in the -r description.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-29 16:18:51 +00:00
Simon Glass
1dd04b3fcb test: py: Add --persist flag to keep test artefacts
When iterating on C test code, the Python fixtures that create disk
images run each time, even though the images have not changed. This
slows down the development cycle unnecessarily.

Add a -P/--persist option to prevent cleanup of test-generated files
like disk images. This allows re-running C tests directly, without
re-running the Python fixture each time.

Update the ext4l test to respect the persist flag.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-29 16:18:51 +00:00
Simon Glass
4bb6fac020 doc: Drop the PARSE progress message
This message is not needed since sphinx is now running in quiet mode.

Series-to: concept
Series-cc: heinrich
Cover-letter:
doc: Silence the sphinx build output
The sphinx/htmldocs build is very noisy, making it hard to see warnings
and errors. This series enables quiet mode for sphinx and removes
various other progress messages, so that only warnings and errors are
shown.
END

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Series-links: 1:93
2025-12-29 08:58:30 -07:00
Simon Glass
115cf877a9 doc: Drop the SPHINX progress message
This message is not needed since sphinx is now running in quiet mode.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-29 08:58:04 -07:00
Simon Glass
6ff8ab75a4 doc: Remove CJK informational message
The "enabling CJK for LaTeX builder" message adds noise to the build
output. Remove the print statement since the functionality is still
enabled.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-29 08:58:02 -07:00
Simon Glass
541a239c0b doc: Silence sub-make output in sphinx builds
Add -s to the sub-make invocation so that the "Nothing to be done"
message is not shown.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-29 08:57:56 -07:00
Simon Glass
da3d0a1501 doc: Enable quiet mode for sphinx builds
The sphinx output is very noisy. Add -q to SPHINXOPTS so that only
warnings and errors are shown.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-29 08:57:49 -07:00
Simon Glass
a6b1cd23a7 cmd: Add fsinfo command
Add the fsinfo command to display filesystem statistics including block
size, total blocks, used blocks, and free blocks. Both raw byte counts
and human-readable sizes are shown.

Example output:
  => fsinfo mmc 0:1
  Block size: 4096 bytes
  Total blocks: 16384 (67108864 bytes, 64 MiB)
  Used blocks: 2065 (8458240 bytes, 8.1 MiB)
  Free blocks: 14319 (58650624 bytes, 55.9 MiB)

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-27 13:35:43 -07:00
Yannic Moog
fa518088ba doc: phytec: imx8mm: add OP-TEE documentation
Add instructions on how to build and package OP-TEE for the
phycore-imx8mm based boards. The build instructions are identical for
phyGATE-Tauri-L and phyBOARD-Polis.
Also fix missig '-' for TF-A build instructions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
2025-12-25 11:20:50 -07:00
Yannic Moog
e0f23b523d doc: phytec: imx8mp: add OP-TEE documentation
Add documentation for the phyBOARD-Pollux i.MX 8M Plus on OP-TEE
integration.
Also add missing '-' to TF-A build instruction while at it.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
2025-12-25 11:20:50 -07:00
Venkatesh Yadav Abbarapu
076489a894 doc: man-page for optee commands
Provide a man-page for the optee command.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
(cherry picked from commit 20e1c18721)
2025-12-24 12:26:34 -07:00
Tom Rini
3f44038f9d doc: Expand what we say about building the docker container a bit
First, try and be slightly clearer about what "buildx" is with respect
to the docker build process.

Second, now that we build the container for both amd64 and arm64, we
should document how to make a docker "builder" that has multiple nodes.
With this one node should be amd64 and one node arm64, and with
reasonably fast arm64 hardware this will be much quicker than using
QEMU.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
(cherry picked from commit e82922ae11)
2025-12-24 05:17:02 -07:00
Kongyang Liu
dd66b9b093 doc: spacemit: bananapi_f3: document Banana Pi F3 board
Add document for Banana Pi F3 board which based on SpacemiT's K1 SoC.

Signed-off-by: Kongyang Liu <seashell11234455@gmail.com>
Signed-off-by: Huan Zhou <pericycle.cc@gmail.com>
Tested-by: Marcel Ziswiler <marcel@ziswiler.com>
Reviewed-by: Yixun Lan <dlan@gentoo.org>
(cherry picked from commit 3cd3f47cae)
2025-12-24 05:17:01 -07:00
Thomas Bonnefille
05f41284f8 doc: add LicheeRV Nano and SG2002 SoC
Provide a page describing the usage of U-Boot on the LicheeRV Nano and a
description of the board.

Signed-off-by: Thomas Bonnefille <thomas.bonnefille@bootlin.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
(cherry picked from commit 62181bbf71)
2025-12-24 05:17:01 -07:00
Christoph Fritz
ec25008142 imx: hab: fix srktool -c usage by removing spaces
The srktool option -c does not allow spaces between certificate
filenames. Only commas (',') should separate the filenames. If spaces
are incorrectly included, srktool will not display an error or warning
message but will only process the first certificate in the list.

So adapt documentation accordingly.

Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
(cherry picked from commit 7cf57825eb)
2025-12-24 05:17:00 -07:00
Garrett Giordano
fa4db38e9c doc: board: phytec: Add phyCORE-AM62ax
Add documentation for PHYTEC phyCORE-AM62ax SoM.

Signed-off-by: Garrett Giordano <ggiordano@phytec.com>
Reviewed-by: Wadim Egorov <w.egorov@phytec.de>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
(cherry picked from commit c3c20a5e3c)
2025-12-24 05:16:59 -07:00
Peng Fan
40e00366f3 imx: Support i.MX91 11x11 EVK board
Add i.MX91 11x11 EVK Board support.
 - Four ddr scripts included w/o inline ecc feature.
 - SDHC/NETWORK/I2C/UART supported
 - PCA9451 supported, default nominal drive mode
 - Documentation added.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit ff9f080e59)
2025-12-24 05:16:58 -07:00
Christoph Niedermaier
e1a3529832 env: Switch the callback static list to Kconfig
Switch the callback static list from the board configuration variable
CFG_ENV_CALLBACK_LIST_STATIC to Kconfig CONFIG_ENV_CALLBACK_LIST_STATIC.

Signed-off-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
Reviewed-by: Marek Vasut <marex@denx.de>
(cherry picked from commit dca82739b9)
2025-12-24 05:16:57 -07:00
GitLab CI
353119a583 docs: Add 2026.02-rc1 to release history 2025-12-22 10:41:07 +00:00
Simon Glass
b64009e9a6 common: Move autoprobe out to board init
Rather than doing autoprobe within the driver model code, move it out to
the board-init code. This makes it clear that it is a separate step from
binding devices.

For now this is always done twice, before and after relocation, but we
should discuss whether it might be possible to drop the post-relocation
probe.

For boards with SPL, the autoprobe is still done there as well.

Note that with this change, autoprobe happens after the
EVT_DM_POST_INIT_R/F events are sent, rather than before.

Link: https://lore.kernel.org/u-boot/20240626235717.272219-1-marex@denx.de/

Signed-off-by: Simon Glass <sjg@chromium.org>
(cherry picked from commit 6995f2c8be)
2025-12-21 06:01:44 -07:00
Tom Rini
a5c7aa53c1 doc/develop/distro.rst: Better document upstream definition of extlinux.conf
First, the "Boot Loader Specification" link has moved to a new location,
so link to that directly. Second, that link does not document as much of
the extlinux.conf format as I recall the old version doing at least.
However, the Syslinux Project wiki is the current location of the documentation
linked to in doc/README.pxe and also has a reference for SYSLINUX. Link
to both of these.

Signed-off-by: Tom Rini <trini@konsulko.com>
(cherry picked from commit cdf6953290)
2025-12-20 08:28:23 -07:00
Olivier L'Heureux
9355f54d9f doc: sandbox: Fix the "sb" command name
The command name was "sbi" instead of "sb" in "doc/usage/cmd/sb.rst",
the file documenting the "sb" command. It is annoying, because the
index in the left panel on the
<https://docs.u-boot.org/en/latest/usage/cmd/sb.html> page shows no
"sb" command, which makes difficult to navigate to the "sb"
documentation.

Fixed the command name: "sbi" -> "sb".

Fixes: ec6d30649c (doc: sandbox: Add docs for the sb command, 2024-10-28)
Signed-off-by: Olivier L'Heureux <olivier.lheureux@mind.be>
Reviewed-by: Simon Glass <sjg@chromium.org>
(cherry picked from commit ea958a0c7d)
2025-12-20 08:27:21 -07:00
Lothar Rubusch
6de50e05f6 doc: develop: Fix typos and wording in gdb.rst
Fix some typos and duplicate words in gdb.rst.

Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com>
Acked-by: Alexander Dahl <ada@thorsis.com>
(cherry picked from commit 763926915f)
2025-12-20 08:27:15 -07:00
Heinrich Schuchardt
7ba8c2d7ae cmd: bootmenu: add parameter -e for UEFI boot options
The bootmenu command can display

* menu entries defined by environment variables
* menu entries defined by UEFI boot options

Not in all cases showing the UEFI boot options is desired.
Provide a new parameter '-e' to select the display of UEFI boot options.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
(cherry picked from commit 5a4ac8a35a)
2025-12-20 08:26:08 -07:00
J. Neuschäfer
34fa3dfb40 doc: fit: Format image tree source example
The example in kernel_fdt.rst is inconsistently indented, making it
difficult to read.

Indent the example with the same standard as the other examples:
Four spaces for the ReST code block and for every nesting level.

Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
(cherry picked from commit 12876f8cd8)
2025-12-19 22:37:09 -07:00
Heinrich Schuchardt
bb6145c8fc cmd/rng: fix long help text
The number of bytes may only be specified if a device number id provided.

Correct the formatting.

Acked-by: Marek Behún <kabel@kernel.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
(cherry picked from commit 528b6b817e)
2025-12-19 22:37:06 -07:00
Tom Rini
42f4b73085 Prepare v2025.01-rc5
Signed-off-by: Tom Rini <trini@konsulko.com>
(cherry picked from commit 3391587e3f)

Note: Makefile version changes dropped (base is already at v2025.12).
2025-12-19 22:36:57 -07:00
Michael Walle
c8e20dd902 doc: board: sl28: fix table
Convert the table to a correct reST table syntax.

Signed-off-by: Michael Walle <mwalle@kernel.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 079ae2734c)
2025-12-17 19:32:58 -07:00
Leonard Anderweit
bc29443d55 doc: cosmetic: fwu_updates: Fix formatting
Remove one of the double colon so ..code-block is used for formatting.

Signed-off-by: Leonard Anderweit <l.anderweit@phytec.de>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
(cherry picked from commit 55e8704402)
2025-12-17 18:35:38 -07:00
Jerome Forissier
d550110f06 doc: environment: NET_LWIP dhcp sets ipaddrN, netmaskN and gatewayipN
Document environment variables set by the dhcp command when the network
stack is lwIP.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
(cherry picked from commit d8b0020dde)
2025-12-17 18:35:34 -07:00
Quentin Schulz
955abaf260 doc: board: theobroma-systems: fix feature list in introductions
Board introductions have a feature list which isn't formatted properly
according to rST and is thus rendered incorrectly.

Fix this by adding the missing newlines in the appropriate places.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
(cherry picked from commit c7360f17fb)
2025-12-17 18:35:30 -07:00
Andy Yan
7f9fe04720 doc: coolpi: Fix document style
Add a blank line after title "Specification:" to
make it render correctly html.

And also remove the useless > in bash code block.

Signed-off-by: Andy Yan <andyshrk@163.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
(cherry picked from commit d9825e8d0f)
2025-12-17 18:35:15 -07:00
Johan Jonker
94040d3a94 doc: remove redundant Rockchip bindings
Most Rockchip device tree related bindings are converted to YAML
and available in the U-boot /dts/upstream/Bindings/ directory.
Remove all redundant U-boot entries.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
(cherry picked from commit 4888d1bd0e)
2025-12-17 18:35:10 -07:00
J. Neuschäfer
47a3d716f6 doc: sending_patches: Fix spelling of "its"
Although it has historically been different, the current standard
spelling of the neutral singular possessive pronoun is "its".

Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
(cherry picked from commit a7dc9f3220)
2025-12-17 18:35:04 -07:00
Tom Rini
35f4d47308 Prepare v2025.01-rc4
Signed-off-by: Tom Rini <trini@konsulko.com>
(cherry picked from commit b841e559cd)

[Fixed conflict in Makefile: kept PATCHLEVEL=12, applied EXTRAVERSION=-rc4]
2025-12-17 11:05:42 -07:00
Simon Glass
840c1a6855 pickman: Add tool to compare branch differences
Add a tool to check the number of commits in a source branch
(us/next) that are not in the master branch (ci/master), and find
the last common commit between them.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-16 13:15:19 +00:00
Simon Glass
2b6e3394fb test: Add documentation for test parameters
Add a description of how test parameters work. This helps to make it
easier to write C tests which need setup to be done in Python.

Series-to: concept
Series-cc: heinrich
Cover-letter:
test: Add support for passing arguments to C unit tests
This series adds infrastructure for passing runtime arguments from Python
tests to C unit tests. This makes it easier to support a hybrid testing
approach where Python handles complex setup (filesystem images,
environment configuration) while C handles the actual test logic with
better debuggability.

A few other things are included to make this work:

- A fix for linker list alignment that was causing garbage values like
  "Running -858993444 bloblist tests" due to GCC's magic-number division
  optimization failing when padding breaks exact multiples

- A fix fix for serial output with sandbox, since it sometimes misses
  output at the end when running tests with gnome terminal

- Improvements to the linker-list script to detect padding and
  pointer-arithmetic bugs

- A new UNIT_TEST_ARGS() macro for declaring tests with typed arguments,
  along with argument parsing in the ut command (name=value format)

- Argument-accessor macros ut_str(), ut_int(), and ut_bool() with
  type-checking and bounds validation

- A private buffer (uts->priv) for test-local temporary data, which
  makes it a little easier to write shorter tests

- Tests for the argument feature (test_args) covering type checking,
  bounds checking, and argument-parsing failures

As an example, the basic filesystem tests are converted from pure Python
to C with Python wrappers.

Some improved printf documentation and support for Linux's %pV format
are provided.

The slight increase in size causes qemu-riscv64_spl to fail, so this
series also includes a patch to increase the SPL-malloc() space.
END

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-14 09:52:56 -07:00