432 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
Simon Glass
64850634f0 test: Enhance the ut command to pass test arguments
Update the ut command to permit passing arguments to tests.

Usage: ut -f fs test_name key1=value1 key2=value2

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-14 09:14:41 -07:00
Simon Glass
754a755e4a malloc: Record caller backtrace for each allocation
When CONFIG_MCHECK_HEAP_PROTECTION is enabled, use backtrace_str() to
capture the caller information for each malloc/calloc/realloc/memalign
call. This information is stored in the mcheck header and can be viewed
with 'malloc dump'.

Add a flag to disable the backtrace when the stack is corrupted, since
the backtrace code tries to walks the invalid stack frames and will
crash.

Note: A few allocations made during libbacktrace initialisation may
not have caller info since they occur during the first backtrace call.

Example output showing caller info:
    18a1d010   90  used  log_init:453 <-board_init_r:774
    18a1d0a0 6060  used  membuf_new:420 <-console_record
    18a3b840   90  used  of_alias_scan:911 <-board_init_

Fix up the backtrace test to avoid recursion.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-10 05:53:03 -07:00
Simon Glass
ee8e9bf104 malloc: Add malloc dump command to walk the heap
Add a new 'malloc dump' command that walks the dlmalloc heap from start
to end, printing each chunk's address, size (in hex), and status
(used/free/top). This is useful for debugging memory allocation issues.

When CONFIG_MCHECK_HEAP_PROTECTION is enabled, the caller string is
also shown if available.

Example output:
    Heap dump: 18a1d000 - 1ea1f000
         Address        Size  Status
    ----------------------------------
        18a1d000          10  (chunk header)
        18a1d010          90  used
        18adfc30          60  <free>
        18adff90     5f3f030  top
        1ea1f000              end
    ----------------------------------
    Used: c2ef0 bytes in 931 chunks
    Free: 5f3f0c0 bytes in 2 chunks + top

Expand the console-record size to handle this command.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-10 05:53:03 -07:00
Simon Glass
d8b19014d7 malloc: Add call counters for malloc, free, realloc
Add counters to track the number of calls to malloc(), free(), and
realloc(). These are displayed by the 'malloc info' command and
accessible via malloc_get_info().

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-10 05:53:03 -07:00
Simon Glass
cfbee94582 malloc: Add 'malloc' command with 'info' subcommand
Add a command to display malloc heap statistics, showing total heap
size and memory currently in use.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-10 05:53:03 -07:00
Simon Glass
69d2f4ab58 video: truetype: Use pre-allocated buffer for glyph rendering
The TrueType console driver calls malloc/free for every character
rendered, which causes significant memory fragmentation and allocation
traffic.

Add CONFIG_CONSOLE_TRUETYPE_GLYPH_BUF to enable a pre-allocated buffer
in the driver's private data. The buffer starts at 4KB and grows via
realloc() as needed. When rendering a glyph, use this buffer to avoid
malloc/free for normal characters.

The buffer is allocated lazily after relocation to avoid consuming
early malloc space before the full heap is available.

Add CONFIG_VIDEO_GLYPH_STATS (default y on sandbox) to track the number
of glyphs rendered. Use 'font info' to view the count.

Series-changes: 2
- Rename the Kconfig to just enable the feature: always allocate

Co-developed-by: Claude Opus 4 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-10 05:53:00 -07:00
Simon Glass
f716e618b8 doc: Add TKey full disk encryption documentation
Add comprehensive documentation for TKey-based full disk encryption:

- doc/usage/tkey-fde.rst: Main documentation covering the TKey FDE
  workflow, key derivation process, U-Boot integration, the
  tkey-fde-key.py script usage, creating test images, troubleshooting,
  and security considerations

- Add cross-references from related documentation pages including
  blkmap, bootflow, luks, and tkey command references

- Update luks.rst with a section on hardware-backed key derivation

Series-to: concept
Cover-letter:
luks: Complete TKey implementation
This series finishes off the TKey implementation, including an expo
menu (bootctl), a Python script to automate common operations and some
documentation to pull it all together.
END

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-08 05:22:18 -07:00
Simon Glass
67ed14f985 luks: Add -p flag for pre-derived master key
Add a -p flag to the luks unlock command that allows passing a
hex-encoded pre-derived master key, skipping the KDF step. This is
useful when the master key has been derived externally, such as from a
hardware security module.

Adjust the normal flow (without -p) to use a key derived on the TKey
output. While that works OK with LUKS1, the 32-byte value is not long
enough to work with LUKS2.

Update the documentation to describe the new flag.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-07 17:18:57 -07:00
Simon Glass
cee822e941 backtrace: Strip the source tree prefix from filenames
Display relative paths instead of absolute paths in backtrace output,
making the output cleaner and more portable across different build
environments.

This works by adding a SRCTREE define to lib/backtrace.c and stripping
it from filenames when printing.

Series-to: concept
Series-cc: heinrich
Cover-letter:
backtrace: Add runtime support for looking at the backtrace
In some cases the backtrace contains useful information, such as whether
a particular function was called earlier in the stack.

This series provides a very simple backtrace library, along with some
sandbox-specific functions to allow it to work. It is designed such that
another arch could implement it.

A new 'backtrace' command provides access to the backtrace.
END

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-01 15:42:04 +00:00
Simon Glass
b174084ef9 backtrace: Add a command
Add a new 'backtrace' command which prints the current call stack, which
is useful for debugging. The command is enabled by CONFIG_CMD_BACKTRACE

Add docs and a test.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-01 15:42:04 +00:00
Simon Glass
5e381f02ee luks: Support disk unlock using a TKey
Add a -t option to the 'luks unlock' command to allow a TKey to be used
to unlock a disk. The password is used as the user-supplied secret (USS)
in this case.

Series-to: concept
Cover-letter:
luks: Integrate support for a TKey
This series illustrates how to use a Tillitis TKey to unlock an
encrypted disk. This has the advantage that the key depends on a
physical key in the user's posession as well as the usual passphrase.

The TKey handles the key derivation, so this series includes logic to
skip that step when a TKey is used.

The 'luks unlock' command provides a -t flag to use a TKey.

It also provides a small pytest fix to ease conflicts with Labgrid
integration.
END

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Series-links: 1:63
2025-11-17 06:59:47 -07:00
Simon Glass
9c97e30ef6 tkey: Allow selecting the TKey device by name
Enhance the 'tkey connect' command to allow the device name to be
specified. This will be useful in tests.

Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-11-14 12:00:31 -07:00
Simon Glass
505a3e3af8 luks: Update docs and tests for LUKSv2
Add documentation for the new LUKSv2 feature and update LUKSv1 to
mention the more common algorithm.

Update the tests to use LUKSv2 for mmc12

Series-to: concept
Series-cc: heinrich
Cover-letter:
luks: Provide support for LUKSv2
Modern systems mostly use LUKSv2 as it is more secure that v1. This
series provides an implementation of this feature, making use of the
existing 'luks unlock' command.

One interesting part of this series is a converter from JSON to FDT, so
that U-Boot's existing ofnode interface can be used to access the
hierarchical data in JSON text. This obviously results in quite a bit
of new code, but it is more robust than trying to parse the text
directly using strstr(), etc. The choice of JSON for LUKS was presumably
made with larger code bases in mind, rather than a firmware
implementation.
END

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Series-links: 1:58
2025-11-11 05:44:08 -07:00
Simon Glass
1dcfa2ecbb test: Shorten the encrypt_passphrase parameter for FsHelper
This is very long and the 'encrypt' part is implied by the passphrase.
Shorten it to just 'passphrase'.

Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-11-11 04:15:03 -07:00
Simon Glass
dfb03773ca luks: Add detection of LUKS partition
Provide a function which can detect a LUKS partition. Add a test, using
mmc11

Series-to: concept
Cover-letter:
luks: Provide basic support for unlocking a LUKS1 partition
With full-disk encryption (FDE) it is traditional to unlock a LUKS
partition within userspace as part of the initial ramdisk passed to
Linux. The user is prompted for a passphrase and then the disk is
unlocked.

This works well but does have some drawbacks:
- firmware has no way of knowing whether the boot will success
- the 'passphrase' prompt comes quite late in the boot, which can be
  confusing for the user
- specifically it is not possible to provide an integrated 'boot' UI in
  firmware where the user can enter the passphrase
- in a VM environment, the key may be known in advance, but there is no
  way to take advantage of this
- it is not possible to use an encryted disk unless also using a ramdisk

This series makes a small step towards improving U-Boot in this area. It
allows a passphrase to be checked against a LUKS1-encrypted partition.
It also provides read-only access to the unencrypted data, so that files
can be read.
END

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-24 21:02:11 +01:00
Simon Glass
fb5cd8627a luks: Add a subcommand to unlock an encrypted partition
Provide a new 'luks unlock' command which can unlock a LUKS1 partition,
given a passphrase.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-24 21:02:11 +01:00
Simon Glass
22826bf21f luks: Show the JSON information for LUKSv2
Extract the full information for version 2, which is JSON format. Show
this with the 'luks info' command.

Use the mmc12 disk to check this.

Require the JSON for LUKS.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-24 21:02:11 +01:00
Simon Glass
414baddf37 luks: Add a simple command
Add a 'luks' command which allows querying a partition to see if it is
encrypted using LUKS, as well as showing information about a LUKS
partition.

Provide some documentation and a test.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-24 20:12:40 +01:00
Simon Glass
71cea84cc3 sandbox: Add devon and devoff subcommands to sb command
There are quite a few media devices in test.dts which are not enabled by
default, so are not bound on startup. Sometimes it is useful to be able
to use these from the command line.

Add 'sb devon' and 'sb devoff' subcommands to enable and disable devices
from the device tree. For example, running sandbox with -T, then
'sb devon mmc11' enables the mmc11 device mentioned in test.dts

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-24 08:47:38 +01:00
Simon Glass
98425bf676 doc: Provide documentation for the blkmap command
This command lacks documentation in the normal place. Add it.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-24 08:47:38 +01:00
Simon Glass
b7d758612a tkey: Add a command
Add a new 'tkey' command that provides an interface to interact with
Tillitis TKey security tokens. Subcommands include:

   - info: Display device information (UDI, name, version, mode)
   - load: Load and run applications on the TKey
   - pubkey: Get the public key from a signer app
   - getkey: Derive disk encryption keys with password and USS

This command enables U-Boot to use TKey devices for secure key
derivation for full-disk encryption.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-19 12:27:49 +01:00
Simon Glass
9b1ab4b424 expo: Provide a command to dump a cedit expo
Add a new 'cedit dump' command which dumps the contents of an expo for
debugging.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-10 02:24:07 +01:00
Simon Glass
366ae61115 video: Provide a command to list built-in images
Add a new 'video images' command which lists the graphical images that
are compiled into U-Boot. Generally the only one is the logo.

Series-to: concept
Series-cc: heinrich
Cover-letter:
video: Tidy up embedded graphical images
U-Boot includes a few graphical images which are compiled in, such as
the logo and the BGRT logo used for EFI.

At present these are handled by a Makefile rule which looks for files
ending with '_logo.bmp'.

This series moves these into a new drivers/video/images directory and
puts them in a linker list, so it is possible to see what images are
available.

Adding a new image is simpler, just requiring the addition of the normal
'obj-y += file.bmp' rule.

This series also adds a new 'video' command which provides the existing
'setcurs' and 'lcdputs' as subcommands, along with documentation and
tests.

It also adds a more convenient 'write' subcommand.

END
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Series-links: 2:44 1:43
Series-version: 3
2025-10-02 13:51:03 -06:00
Simon Glass
85e1dae80c video: Add a write subcommand
This allows writing strings at particular positions on the display,
using either character or pixel positions.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-10-02 13:50:32 -06:00
Simon Glass
8db8f801ae video: Add video command with subcommands
Add a new 'video' command with 'setcursor' and 'puts' subcommands that
provide an alternative interface to the existing setcurs and lcdputs
commands.

Update the test is updated to test both the legacy commands and the new
'video' command.

Series-changes: 2
- Correct confusing output text which should be 16 instead of 10
- Improve docs for row and col

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-02 13:50:32 -06:00
Simon Glass
4bda6d5454 doc: video: Add docs for video commands
Add documentation and a simple test for the setcurs and lcdputs
commands.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>

Series-changes: 2
- Split out docs into its own patch; use video: tag

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-02 13:50:32 -06:00
Simon Glass
6d58e9f8b6 doc: test: Add docs and test for addr_find
Add documentation and a test for this command.

Drop the use of config.h while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-25 09:47:09 -06:00
Simon Glass
6e79f1f503 doc: test: Add docs and test for part_find
Add some documentation and a test for this new command.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-25 09:47:09 -06:00
Simon Glass
801f6a72d3 doc: Fix up the booti examples
The command has been updated but the docs was left behind. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 7f9e630a9e ("boot: Drop hex prefix from the booti image-mov..")
2025-09-24 18:29:39 -06:00
Simon Glass
0df6320119 boot: Provide a bootflow option to fake a boot
Allow using 'bootflow boot -f' to fake a boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-22 11:23:04 -06:00
Simon Glass
424bb755a9 boot: Select the fake-go state explicitly
Rather than always going through this state, require callers to
explicitly request it. This will allow the option to be enabled without
affecting the boot, unless the user expressly requests it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-22 11:23:04 -06:00
Simon Glass
dd80fd963c console: Add a way to quit pager with no further output
Add support for pressing 'q' to throw away any further output until the
prompt is reached.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-22 11:23:04 -06:00
Simon Glass
c7ba355d1f console: Add bypass keypress to disable paging
Add support for pressing 'Q' to put the pager into bypass mode,disabling
further paging for the current session.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-22 11:23:04 -06:00
Simon Glass
cca7523800 video: truetype: Handle rendering of bitmap fonts
Complete the support for this feature by dealing with rendering, the
moving to a particular row/column and scrolling.

Provide a simple test to check that things look right.

Allow omitting the font name to request the default font.

Fix an errant tab nearby.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-19 12:56:01 -06:00
Simon Glass
817fd8201f cmd: chid: Add 'compat' subcommand to find compatible string
Add a new 'chid compat' subcommand that finds the compatible string
matching the current hardware's CHID and sets the fdtcompat environment
variable. This examines the devicetree under /chid for nodes with
hardware-id child nodes containing CHID data that matches the system's
generated CHIDs.

The command prints the found compatible string to the console and
automatically sets the fdtcompat environment variable for use by
other U-Boot commands.

Series-to: concept
Cover-letter:
Selection of devicetree using CHIDs
This series implements support for Microsoft's Computer Hardware
Identifier (CHID) specification in U-Boot. CHIDs provide a standardised
way to identify hardware configurations using SMBIOS data, enabling
automatic selection of appropriate device tree overlays and drivers when
the firmware itself lacks support for devicetree.

The CHID system generates UUIDs from various combinations of hardware
information (manufacturer, product name, BIOS version, etc.) creating a
hierarchy from most to least specific. This allows U-Boot to
automatically select the correct devicetree compatible-string for the
hardware on which it running.

This series includes:

* Core CHID Infrastructure:
   - UUID v5 generation with Microsoft's CHID namespace
   - Support for all 15 CHID variants (HardwareID-00 through HardwareID-14)
   - SMBIOS data extraction and processing

* Devicetree Integration:
   - hwids_to_dtsi.py script to convert CHID files to devicetree .dtsi
   - Automatic inclusion of the .dtsi into the board'' devicetree
   - Runtime compatible-string-selection based on hardware CHIDs

* chid command:
   - chid show - show current hardware information and generated CHIDs
   - chid list - list all supported CHID variants and generated UUIDs
   - chid variants - show information about CHID variant restrictions
   - chid compat - select the compatible string for current hardware

* ARM/EFI Support:
   - CHID mappings for a selection of ARM-based Windows devices
   - Support for Qualcomm Snapdragon platforms (MSM8998, SC7180, SC8180X,
     SC8280XP, SDM850, X1E series)

* Testing:
   - Sandbox tests using mock SMBIOS data
   - CI integration for hwids_to_dtsi validation
   - Validation against Microsoft's ComputerHardwareIds.exe output

Documentation is provided for this new subsystem and associated
commands.
END

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Series-links: 1:22
2025-09-04 07:08:25 -06:00