Search the available CHIDs to determine the device on which U-Boot is
running. Use this to select the correct compatible string.
Signed-off-by: Simon Glass <sjg@chromium.org>
When CONFIG_CHID is enabled, U-Boot must have access to a set of CHIDs
which it can use to identfy the hardware it is running on.
Add support for reading a hwids/compatible.hwidmap file in the board
directory and including the information in the board's devicetree.
This works by running the hwids_to_dtsi.py.py script and putting the
result in the dtsi_include_list variable.
Signed-off-by: Simon Glass <sjg@chromium.org>
Add a Python script to convert Hardware ID files (as produced by
'fwupd hwids') into a devicetree format suitable for use within U-Boot.
Provide a simple test as well.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Describe how this feature works and provide some helpful links.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
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 table of variants which indicates which fields are included in
each. Use this to calculate the CHID for a variant. Add some tests to
cover this.
Provide a constant for the length of a uuid.
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>
Microsoft uses information from SMBIOS tables to determine the device
Windows is running on. This same approach has been adopted by fwupd and
other projects.
The information is used to create a list of Computer Hardware
Identifiers (CHIDs) which are used to select firmware builds, etc.
The EFI app needs to support this approach so it can map CHIDs to the
associated compatible string.
Introduce a header file for CHIDs and a function which can extract the
necessary information from the SMBIOS tables.
Further work will deal with actually calculating CHIDs.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
The compatible string cannot be detected on the host so is not shown by
fupdtool. Add a simple text file to provide the mapping.
Signed-off-by: Simon Glass <sjg@chromium.org>
Provide some CHIDs for the app, so it can locate the compatible strings.
These are taken from Stubble commit bac4edb14be, with the original files
generated by running 'fwupdtool hwids' on each device.
Signed-off-by: Simon Glass <sjg@chromium.org>
Some common smbios settings are not included with sandbox. Add these to
test.dts so the data is more meaningful.
Update smbios tests to match the new devicetree values.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Add kerneldoc documentation for SMBIOS information structure types:
- Type 0: BIOS Information
- Type 2: Baseboard Information
- Type 3: System Enclosure Information
- Type 4: Processor Information
Add an enum for the enclosure type too.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Document the SMBIOS Type 1 structure so it is clear what each field
means. Update struct smbios_header also.
Co-developed-by: Claude <noreply@anthropic.com>
Add comments for smbios_entry and update those for smbios3_entry to
follow kerneldoc style.
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>
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>
Since each table starts with a header, it isn't very useful to have a
separate pointer for the (generic) header and another for the whole
table. Also, casting is a bit of a pain.
Update smbios_get_header() so that it returns a const void * so that it
is possible to directly assign it to the appropriate SMBIOS table's
pointer.
Signed-off-by: Simon Glass <sjg@chromium.org>
This function skips over every second table. Fix it by dropping the
extra iterator update.
Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: a68c0625aa ("smbios: coreboot: Update smbios_get_header() to..")
Split the v5 GUID generation into separate big-endian and little-endian
functions with shared common code.
The big-endian version is used for CHIDs and standard UUID v5
operations, while the little-endian version seems to be needed for EFI
GUID compatibility.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
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>
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>
At present reset just exits the U-Boot app and returns to the caller.
Add support for proper warm and cold resets, with 'hot' reset preserving
the current behaviour.
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>
It is handy to have the pager in the app, since some output can be quite
long. Enable the console mux since the pager feature depends on it.
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 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")
This crept in a while back, so let's drop it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 184fc0379d ("bootflow: bootmeth_efi: Handle fdt not available.")
Make use of bootflow_guess_label() to get the label for a menu, since it
provides more information for the EFI app.
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>
All files in this directory relate to EFI, so set the log category
consistently.
Series-to: concept
Series-cc: heinrich
Cover-letter:
efi: A few minor improvements
This series mostly tidies up the efidebug command, but includes a few
other pieces as well.
END
Signed-off-by: Simon Glass <sjg@chromium.org>
Series-links: 1:20
Some headers use the __efi_runtime macro in their declarations. With the
app we do not have a separate runtime sections, so define this to be
empty. This allows the headers to be included from the app.
Signed-off-by: Simon Glass <sjg@chromium.org>
The device path is updated if an image is used, so move the setting of
*device_pathp lower, to take account of this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 73ad2d9909 ("efi: Move efi_bootflow_run() to a common file")
Obtain EFI's view of reserved memory and ensure that everything
mentioned there is present in a devicetree reserved-memory node. This
ensures that the OS doesn't try to access memory it shouldn't.
Series-to: concept
Series-cc: heinrich
Cover-letter:
efi: App and devicetree improvements
This series improves U-Boot's EFI app support and adds new functionality
for managing devicetree reserved-memory regions.
The main focus is on enhancing memory management when running as an EFI
application. A new mechanism is introduced to sync EFI reserved-memory
regions (such as runtime services and ACPI tables) with the devicetree's
/reserved-memory nodes. This ensures that Linux doesn't inadvertently use
memory regions that EFI firmware has reserved.
The main improvements are:
- New 'fdt reserved' command to display devicetree reserved-memory regions
- New 'efi memsync' command to synchronize EFI memory map with devicetree
- Enhance EFI application support with better memory region handling
- Improve EFI debugging commands and device path handling
- Better integrate EFI boot services and devicetree setup
There are a few other minor thigns:
- Enhance efidebug commands with media device and driver information
- Expose EFI device-paths in a few places in bootstd
- Improve bootflow device reporting
- ARM-specific fixes for exception level handling
This series addresses many of the issues found in booting Linux on
Qualcomm X-Elite laptops using the EFI app.
END
Signed-off-by: Simon Glass <sjg@chromium.org>
The EFI app cannot make the EFI GOP available to Linux directly, since
it calls exit-boot-services before booting Linux. The easiest way to
provide an early console is with the simple-framebuffer feature. Add
this node to the devicetree if the feature is enabled.
Co-developed-by: Claude <noreply@anthropic.com>
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>
When booting Linux with EFI the devicetree memory-map is ignored and
Linux calls through EFI to obtain the real memory map.
When booting Linux from the EFI app, without EFI, we must pass the
reserved memory onto Linux using the devicetree.
Add a function to support this. It reads the EFI memory-map and adds any
missing regions to the reserved-memory node.
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>
Add a new helper which lists the subnodes of the reserved-memory node.
This can be helpful when checking the devicetree before booting.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>