Currently qfw_locate_file() always prints error messages when it can't
find a file. This causes unwanted error output in qemu_get_bootcmd()
when the optional "opt/u-boot/bootcmd" file doesn't exist.
Adjust qfw_locate_file() to be silent, with a new qfw_locate_file_msg()
that shows messages.
This allows callers to choose whether missing files should generate
error messages.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
QEMU creates ACPI tables but doesn't include FPDT (Firmware Performance
Data Table). Add FPDT generation in qfw_acpi.c following the same
pattern as BGRT.
Move the acpi_write_fpdt() function from acpi_table.c to acpi_extra.c so
that is available even when CONFIG_ACPIGEN is disabled.
This allows QEMU x86_64 builds to provide firmware boot timing
information to the operating system.
Disable this for qemu-riscv64_smode_acpi as it is near the code-size
limit.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Export the qfw_locate_file() function to allow other modules to locate
files in the QEMU firmware config without loading them into memory.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
It is useful to show a boot logo when starting up. Add the BGRT table
after the QEMU-provided tables.
Signed-off-by: Simon Glass <sjg@chromium.org>
Cover-letter:
emulation: Improve ACPI support for qemu-x86_64
When running under QEMU U-Boot obtains its ACPI tables from QEMU, since
it has the require information. This works well in most cases.
QEMU also provides SMBIOS tables, but U-Boot doesn't currently use those
on x86. This creates problems if a VM environment is expecting to see
particular values (e.g. those which it passed to QEMU!) when booting. So
this series switches QEMU on x86 to use those SMBIOS tables.
Finally, there is a facility in EFI for showing a boot logo, via a BGRT
table. QEMU does not provide this itself, so this series augments the
ACPI tables with a new BGRT table containing a suitable logo.
END
QEMU provides a table indicating the checksums to be calculated. U-Boot
already handles this, so we don't need to compute the checksums at the
end. Drop this unnecessary code.
Signed-off-by: Simon Glass <sjg@chromium.org>
Update this function to make use of the new support for reading qfw
files, this simplifying it considerably.
Fix up the header order while we are here.
Signed-off-by: Simon Glass <sjg@chromium.org>
The existing code reads a single byte into a 32-bit variable. It works
fine but is a bit confusing. There is no need to read only one byte, so
update it to read the whole 32 bits.
Series-to: u-boot
Cover-letter:
emulation: Expand qfw and virtio commands
This series adds various features to the qfw command, mostly targeting
x86-specific features:
- commands to show the E820, ACPI-loader, etc. provided by QMEU
- unit tests for the qfw command
- virtio subcommand to list the devices
The bdinfo command contains some useful printing function which could be
used more generally in U-Boot. This series moves those into the lib/
directory and renames them to be more generic.
Various clean-ups are included, such as documentation for the virtio
fw_cfg selectors.
This series includes some minor test/ fixes noticed when creating this
series.
It also brings in a few qconfig patches which didn't make it into the
main U-Boot tree.
END
Signed-off-by: Simon Glass <sjg@chromium.org>
This file provide common functions related to QFW, so move it into
driver/qfw with the other code.
Series-to: concept
Cover-letter:
emulation: Restructure the Kconfig
At present ARM and x86 use differently named symbols to mean similar
things. For x86, board/emulation/Kconfig contains the targets, but ARM
has them in a different file. While ARM uses ARCH_QEMU to mean QEMU,
x86 uses VENDOR_EMULATION.
This series adjusts the Kconfig for emulation targets on x86 and ARM, to
improve consistency.
A new arch-neutral MACH_QEMU is introduced. This is enabled for all
ARM/x86 emulation targets. Furture work could add this for other archs
too.
END
Signed-off-by: Simon Glass <sjg@chromium.org>
There seems to be enough QFW code now to have its own directory. Move
the files there before adding more.
Signed-off-by: Simon Glass <sjg@chromium.org>