2829 Commits

Author SHA1 Message Date
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
9e1888ee68 input: Add a command to show mouse input
This reads mouse input and shows it on the terminal. It is useful for
testing mice.

Change-Id: Ifebe6452f38904689e3e2142fc08a623131ed0de
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-15 03:26:35 -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
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
b6d164bceb smbios: Provide a sandbox test
Create a sandbox test for the smbios command. This checks that the
expected output is produced.

Drop the unnecessary 0x before each address, since U-Boot uses hex by
default.

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
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
bd78e82720 boot: Move obtaining the label into a common file
The 'bootflow list' command supports looking at the EFI device-path when
available. Move this piece into a common function so it can be used
elsewhere.

This updates the output from 'bootflow list'.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-02 08:45:35 -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
f73b3aaab8 efi: Use abuf when reading EFI variables
The abuf interface provides a nicer abstraction of the data and size of
EFI variables.

Create a new efi_read_var() function and export it so it can be used
elsewhere. Adjust the existing efi_dump_single_var() to use it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-28 05:21:49 -06:00
Simon Glass
b0025aa2b0 boot: Show the underlying bootflow device in the app
Within the app all media devices are 'efi' so it isn't useful to show
that as the media. Look up the media-type of the underlying device, e.g.
'usb' or 'nvme'. This is a lot more helpful, and can make it easy to see
which bootflows relates to internal media and which to external, for
example.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-28 05:21:49 -06:00
Simon Glass
e6f9a0ae58 boot: Show the device path for EFI bootflows
If the bootflow relates to the EFI bootmeth, show the device path along
with the other info.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-28 05:21:49 -06:00
Simon Glass
14e35376ab efi: Implement efidebug show drivers in the app
Adjust the code slightly to support the final subcommand in efidebug
that is currently unavailable in the app: 'efidebug drivers'.

Drop the now-unused app_not_supported() function.

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
c70aa53c2a lib: Rename fdt_print() to fdt_print_path()
Rename the function to better indicate that it prints from a specific path
in the device tree.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-developed-by: Claude <noreply@anthropic.com>
2025-08-27 12:44:42 -06:00
Simon Glass
dd6f8cfbcb lib: Split fdt_print() into separate library file
Move fdt_print() function from cmd/fdt.c to a new lib/fdt_print.c file
to make it available as a library function for other code to use.

Move and rename is_printable_string(), making it available as well.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-27 12:44:42 -06:00
Simon Glass
4412d9c3cf bdinfo: Show the pager page_len value
Show the actual value being used by the pager, if enabled.

Series-changes: 2
- Add new patch to show the pager page_len value

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-26 14:36:07 -06:00
Simon Glass
ccdb52faf0 console: Update conio command to show uclass
When an stdio device is provided by a driver model device, optionally
show the uclass.

Be careful to avoid increasing code size, since this is a common
command.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-26 06:02:03 -06:00
Simon Glass
249bb45cb3 console: Update coninfo to use sdev instead of dev
The 'dev' variable is generally used for driver model, so change
do_coninfo() to use sdev, to avoid confusion.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-26 06:02:03 -06:00
Simon Glass
82732edd5a bdinfo: Show the serial device
Show the name of the serial device with the 'bdinfo' command.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-25 06:54:00 -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
ba43199ce9 efi: nvedit: Place variables in an alist before printing them
Rather than printing as we go, add variables to an alist so they can be
printed when all variables are present.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-22 08:23:17 -06:00
Simon Glass
ceb8cb140e efi: Refactor error handling in efi_dump_var_all()
Rather than freeing the variable in several places, put it at the end.
Assume failure by default, returning success only if all steps passed.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-22 08:23:17 -06:00
Simon Glass
5247ae8219 efi: Rename var_name64 to name in efi_dump_var_all()
This variable name is quite long. There is only one 'name' (the variable
name) and it has to be u16 as it is an EFI variable. So rename it to
'name'.

Signed-off-by: Simon Glass <sjg@chromium.org>
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
b6c3c5ec6a efi: Enable access to efi variables from the app
Enable the 'setenv -e' feature.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-22 08:23:17 -06:00
Simon Glass
9a7c744421 efi: Show component names and other info with efidebug dh
If a component name is available, show it, along with the supported
languages.

Also indicate at the top if the handle is a driver, rather than listing
that protocol at the end.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 10:07:17 -06:00
Simon Glass
27893c8309 efi: Update efidebug dh to work with the app
Make use of the boot-time services rather than internal functions, so
that the app can implement this command.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 10:07:17 -06:00
Simon Glass
3637e38ab8 efi: Show the device name only with the EFI loader
The 'efidebug dh' command dereferences a handle to obtain the device
name.

The format of an EFI handle is not defined by the spec, so when running
in the app we cannot assume that the handle can be dereferenced. Even if
the EFI provider happens to be U-Boot it might be a different version.

So don't try display the device name with the app.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 10:07:17 -06:00
Simon Glass
c029c38ad0 efi: Use a local var for a handle with efidebug dh
Rather than repeating handles[i], put it in a variable.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 10:07:17 -06:00
Simon Glass
ed609a9439 efi: Use a function to obtain boot services in efi debug
Rather than accessing the EFI loader's structure, create an
efi_get_boot() function to match that used by the app, so that the
call to protocols_per_handle() can operate in the app as well.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 10:07:17 -06:00
Simon Glass
e82779fb09 efi: Drop the BS macro with efi debug
Even if this is a subtle dig at EFI, it is only used once and there is
not much benefit in retaining it. Access the system-table directly,
instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 10:07:17 -06:00
Simon Glass
4f95b262c8 efi: Drop EFI_CALL() from efidebug command
The intend of this macro is to debug calls from an app. But the efidebug
command is not an app, so it really doesn't make a lot of sense to call
via that macro. Remove EFI_CALL() from do_efi_show_handles() so that the
app can use this code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 10:07:17 -06:00
Simon Glass
acff53b00d efi: app: Support efidebug boot add, rm and order
Enable these commands in the app, since the requires pieces are now in
place.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 09:05:49 -06:00
Simon Glass
59f797f922 efi: app: Implement efidebug boot dump
Seeing the boot order is useful in the app. Everything we need is
present except an implementation of efi_query_variable_info_int(), so
add that and enable 'efidebug boot dump'.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 09:05:49 -06:00
Simon Glass
9a94bdebbf efi: app: Support efidebug show tables
It is useful to be able to see the available tables in the app, so
enable this subcommand. Provide an implementation of efi_get_sys_table()
that works for the EFI loader.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 09:05:49 -06:00
Simon Glass
7a46391c44 efi: app: Support efidebug memmap
It is helpful to see the memory map in some cases, so enable this
subcommand in the app.

Unfortunately we cannot assume that desc_size is the same in the
underlying EFI implementation, so use a variable for that.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 09:05:49 -06:00
Simon Glass
04062f0cbf efi: app: Support the efidebug command
This command is useful for the app, so enable it. For now most of the
subcommands don't work, so provide a message in that case. This seems
better than silently pretending that the subcommand doesn't exist.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 09:05:49 -06:00
Simon Glass
6cbd0a844c efi: Fix up the addr_find command
This command was written before the lmb unification, so does not
currently build. Tidy it up and enable it for the EFI app, by default.

Also allow it to search any partition, not just a FAT one, since we may
have the kernel on ext4

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-19 17:36:44 -06:00
Simon Glass
f6acb6e003 meminfo: Allow for up to 10 hex digits
On platforms where most of the memory is above 4GB, the EFI app may find
itself using addresses with 9 or even 10 digits. Expand the width of the
columns to cope with this.

Add some double bars across digits 9 and 8 so that it is easier to make
the value.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-19 17:36:44 -06:00
Simon Glass
12f3fc10fd smbios: Add support for showing table types 16 and 19
In some cases it is useful to find out the location of physical memory,
e.g. so that the memory@ nodes can be correctly set up in the
devicetree. Add support for parsing this information from the SMBIOS
tables.

Series-to: concept
Series-cc: heinrich
Series-version: 2
Cover-letter:
smbios: Refactor the smbios command and parser
The 'smbios' command has its own code for parsing SMBIOS tables. There
in also lib/smbios-parser.c which parses tables, although only
version 2.

This series moved parsing to lib/ and rationalises the code a little. It
also adds support for a few more tables.

Finally, a hook is added so operation from coreboot can be tested on
ellesmere.
END

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-18 14:00:19 -06:00
Simon Glass
8de843271f smbios: Pass smbios_info to smbios_next_table()
At present smbios_next_table() does not support SMBIOS v2 tables. Pass
in the info struct so that it can check for the end of the tables.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-18 14:00:19 -06:00