There should be no need to parse the LMB tables manually. Use the
allocation-function provided instead. Adjust the argument checks while
we are here.
Also enable this command for sandbox and the EFI app, so it is built in
CI.
Signed-off-by: Simon Glass <sjg@chromium.org>
This function uses #ifdefs and ends up with a very large indent, Split
it into two separate functions, one for the EFI app and one for other
builds.
Drop the use of config.h while we are here.
Signed-off-by: Simon Glass <sjg@chromium.org>
Recent work removed the if_type member. Update the code to use the new
method for obtaining the interface type.
Use hex so that large partition numbers (>=10) work correctly.
Signed-off-by: Simon Glass <sjg@chromium.org>
The flags contain lots of little pieces of information. Print them out
with the bdinfo command, so the user can look them up if needed.
Signed-off-by: Simon Glass <sjg@chromium.org>
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>
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>
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>