Commit Graph

238 Commits

Author SHA1 Message Date
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
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
Simon Glass
546c5dcc17 chid: doc: Describe how the CHID feature works
Provide some developer documentation for this new feature.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-04 07:08:25 -06:00
Simon Glass
7737e3c1d5 chid: Add subcommand for dealing with variants
Add a 'chid list' command to display the values for all CHID variants.
Also add 'chid detail' to see all details about a variant.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-04 07:08:25 -06:00
Simon Glass
93f35ef78a chid: Provide a command to access chid features
Provide a simple command which supports showing the information which
goes into calculating a CHID. The information is obtained entirely from
SMBIOS tables at present.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-04 07:08:24 -06:00
Simon Glass
650430935d smbios: Expand the documentation
Quite a few SMBIOS features are not yet described in the documentation.
Add a new section the 'usage' and add more to the developer
documentation, including how to use the devicetree to provide values.

Add some links between usage docs, developer docs and the command.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-04 07:08:24 -06:00
Simon Glass
f74db7258c sysreset: Add -c flag for explicit cold reset
Add support for reset -c flag to explicitly request cold reset.
This provides symmetry with -w (warm) and -u (firmware UI) flags.

For EFI apps, this performs EFI_RESET_COLD which does a full system
reboot without going to firmware setup interface.

Series-to: concept
Series-cc: heinrich
Cover-letter:
efi: Improve integration of the app with a Shim environment
This series collects together various small fixes and improvements which
make it easier to use the U-Boot EFI app in a bootflow which includes
Shim:

- 'Reset' back to the caller (e.g. EDK2)
- Machine reset using cold and warm reset
- Reset and enter the firmware UI
- Shim command now supports persistent debug
- Bootmenu shows the real media for each bootflow rather than just 'efi'
END

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-02 08:51:40 -06:00
Simon Glass
96adc477be sysreset: Add SYSRESET_TO_FIRMWARE_UI with reset -u support
Add new SYSRESET_TO_FIRMWARE_UI reset type to allow resetting directly
to firmware UI. This is implemented via the reset command's new -u flag.

For the EFI app, this sets the EFI_OS_INDICATIONS_BOOT_TO_FW_UI bit in
the OsIndications variable before performing a warm reset, causing the
firmware to boot to its setup interface.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-02 08:51:26 -06:00
Simon Glass
9fdab58b86 sysreset: Support a hot reset
In some cases we may wish to return back to the program which started
U-Boot. Add the concept of a 'hot' reset, to support this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-02 08:51:25 -06:00
Simon Glass
a5f843f0f2 shim: Add a flag to make the setting persistent
Provide a -n flag to 'shim debug' so that the setting persists across
reboots.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-02 08:45:36 -06:00
Simon Glass
370247c724 efi: doc: Add documentation for about efidebug boot
So far this subcommand is undocumented. Provide some notes.

Also show a better error when 'efidebug boot rm' fails.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-02 08:45:36 -06:00
Simon Glass
2a374c390e efidebug: Support sorting with efidebug memmap
Provide a -s option to sort the memory map in order of address. Add
documentation while we are here. Also fix an errant extra line before
do_efi_show_media()

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-02 08:45:36 -06:00
Simon Glass
b16f6499cf efidebug: doc: Indent the media output correctly
The lines after the 'edidebug media' command are only intended three
spaces, but it should be four. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 9390344c35 ("efi: Add a uclass column to efidebug media command")
2025-09-02 08:45:36 -06:00
Simon Glass
8132f56189 efi: fdt: Provide a command to sync the reserve-memory node
Provide a command to sync reserved-memory with EFI's version of reserved
memory.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-28 13:21:32 -06:00
Simon Glass
0dc72120b7 fdt: Add a command to show reserved-memory regions
Add a new 'fdt reserved' subcommand that displays all reserved memory
regions defined in the device tree's /reserved-memory node. This command
provides a formatted table showing the ID, name, start address, and size
of each reserved memory region.

Avoid a conflict with the existing 'fdt resize' command. Update the docs
and add a test.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-28 06:55:49 -06:00
Simon Glass
a945ee1098 efi: Add an efi subcommand to show the loaded image
Sometimes it is useful to see the device-path of the app itself. Add a
new 'efi image' command for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-28 06:55:49 -06:00
Simon Glass
27f066d157 efi: Add a command to help with shim
Shim is a program which normally comes before U-Boot in the boot
process. But when the app runs first, it can sometimes chain Shim since
that is what is contained within the bootaa64.efi file, for example.

Add a simple command for dealing with shim. For now it only supports
enabling verbosity.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-28 05:21:49 -06:00
Simon Glass
9390344c35 efi: Add a uclass column to efidebug media command
Add a new column to the 'efidebug media' command that shows the likely
uclass for each EFI media device based on its device path.

This uses the new efi_dp_guess_uclass() function which looks through an
EFI device-path to determine the corresponding uclass.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-28 05:21:48 -06:00
Simon Glass
c9c937170f efi: Add a way to show media devices
Add a new 'efidebug media' subcommand to show media devices and their
device-paths.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-27 16:51:47 -06:00
Simon Glass
31bd3547bb cmd: Add -s flag to printenv -e for sorted output
Add support for sorting EFI variables by name when using printenv -e.
The -s flag sorts variables alphabetically before display, useful when
dealing with large numbers of variables.

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

Series-to: concept
Series-cc: heinrich
Cover-letter:
efi: Improvements to env print -e
Printing EFI variables can be quite verbose, with many hundreds of lines
of text. Part of this is because GUIDs and hex dumps are included. It
can also be hard to find a few variables visually in an unsorted list.

This series makes the feature more user-friendly:
- Puts verbose output behind a -v flag, so that 'env print -e' behaves
  more like 'env print'
- Adds a -s option to sort the list
END
Series-links: 1:15
2025-08-22 08:23:17 -06:00
Simon Glass
b60fd4dae9 efi: Change env print -e to show only names by default
Change the default behavior of 'printenv -e' to show only EFI variable
names. The previous verbose output is now available with the -v flag.
This makes the command more user-friendly for quick variable listing.

Update documentation to reflect the new behavior and provide examples
of all three output modes: default (names only), -n (details without
hex dump), and -v (full verbose output).

It might be nicer to use -d to enable the dump, rather than have it on
by default.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-22 08:23:17 -06:00
Simon Glass
aec5fbeee8 boot: Support bootm restart
Normally bootm proceeds sequentially through the various states, from
'start' to 'go'.

In some cases we want to load the devicetree from one FIT and the kernel
and ramdisk from another. This requires two bootm commands.

Of course it is possible to just do a second 'bootm start' to load the
kernel. But that removes all record of the devicetree from the
boot_images information, so it is then not provided to the OS.

Add a 'restart' subcommand which allows more images to be loaded,
without erasing those already loaded.
2025-07-28 13:06:51 +12:00
Simon Glass
d47981424c doc: Flesh out the documentation for bootm
This lacks details about the subcommands, so add a description of the
boot flow and the subcommands which are available.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-28 13:04:31 +12:00
Simon Glass
bbd1cc14c1 virtio: Provide a command to list virtio devices
U-Boot only supports a subset of the devices supported by QEMU. For
example, U-Boot does not currently support the vsock device.

It is helpful to see what devices are provided by QEMU and whether there
is a driver for it in U-Boot.

Add a new 'virtio list' command to provide this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-09 23:33:26 +02:00
Simon Glass
b82b94d6c4 virtio: doc: Document the virtio command
Add documentation for this command, including some examples.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-09 23:33:25 +02:00
Simon Glass
2fdacb4753 qfw: Add a subcommand to decode the QEMU E820 data
Provide a simple command to display the memory map described by this
table.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-09 23:33:25 +02:00
Simon Glass
d75533b613 qfw: Add a subcommand to read a QEMU file into memory
Provide a simple command to read a named file into memory.

Skip this test on sandbox for now, as it doesn't support this feature in
its emulation of QEMU.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-09 23:33:25 +02:00
Simon Glass
1541ec049b qfw: Add a subcommand to show QEMU arch-specific details
There are a few selectors in a different region which contain what seems
to be arch-specific information. Add a way to display this. So far it
only works on x86.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-09 23:33:25 +02:00
Simon Glass
6d80f5476b qfw: Add a subcommand to show ACPI-loader details
QEMU provides a table containing the ACPI tables and information on how
to relocate them to any suitable memory address. Add a command to show
this information.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-09 23:33:25 +02:00
Simon Glass
af7eb623d0 qfw: Add a subcommand to show the main QEMU details
There are quite a few values provided by QEMU and used by U-Boot, for
which it isn't possible to see the values. Add a new 'qfw dump' command
to support this.

Skip this test on sandbox for now, as it doesn't support this feature in
its emulation of QEMU.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-09 23:33:24 +02:00
Simon Glass
9d9f440c7a qfw: Add more fields and a heading to qfw list
Update the command to show the size and selected file, since this is
useful information at times. Add a heading so it is clear what each
field refers to.

Add a simple test as well.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-09 23:26:02 +02:00
Simon Glass
18d944716e doc: efi_loader: Tidy up the bootefi-command docs
There are backslashes in some of the tags which seems to be unnecessary.
Remove then.

Change the word 'either' to 'any' since there are three options.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2025-06-09 23:27:37 +00:00
Simon Glass
c652ad11fe bootstd: Tidy up help for boot flags
The help for 'bootflow scan' is missing some flags. Tidy this up and
update the docs as well, keeping the flags in alpha order.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-06-02 08:25:41 -06:00
Simon Glass
d93f42d6e3 bootstd: Provide a command to select the bootdev order
It is sometimes useful to select or override the default bootdev order.
Add a command for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-02 09:45:32 -06:00
Gabriel Dalimonte
f12f27d2e0 fs: fat: add rename
The implementation roughly follows the POSIX specification for
rename() [1]. The ordering of operations attempting to minimize the chance
for data loss in unexpected circumstances.

The 'mv' command was implemented as a front end for the rename operation
as that is what most users are likely familiar with in terms of behavior.

The 'FAT_RENAME' Kconfig option was added to prevent code size increase on
size-oriented builds like SPL.

[1] https://pubs.opengroup.org/onlinepubs/9799919799/functions/rename.html

Signed-off-by: Gabriel Dalimonte <gabriel.dalimonte@gmail.com>
2025-05-01 05:56:47 -06:00
Simon Glass
abcfdc2510 acpi: Support checking checksums
When the ACPI tables come from an earlier bootloader it is helpful to
see whether the checksums are correct or not. Add a -c flag to the
'acpi list' command to support that.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-15 08:49:43 +00:00
Simon Glass
777c7a0c20 test: Update documentation
Update documentation for how to write tests and the 'ut' command.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-16 14:11:28 +00:00
Simon Glass
f1ea51a032 doc: Update ut documentation
Update documentation for the 'ut' command, since it has changed a
little.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-08 13:50:15 +00:00
Simon Glass
870fffb5a7 efi_loader: Add a command to show the EFI log
Add a simple command which lists the log. Avoid creating any new records
when this command is invoked.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-12-18 19:47:44 -07:00
Simon Glass
ab0887ffdf bootstd: Add a simple command to list images
Add a new 'bootstd images' command, which lists the images which have
been loaded.

Update some existing tests to use it. Provide some documentation about
images in general and this command in particular.

Use a more realistic kernel command-line to make the test easier to
follow.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-12-05 11:00:23 -07:00