140 Commits

Author SHA1 Message Date
Simon Glass
545acab06c travis-ci: add qemu-riscv64_smode* test environments
Provide test environments for running
qemu-riscv64_smode and qemu-riscv64_smode_acpi.

These use the OpenSBI implementation provided by QEMU and
pass main u-boot as -kernel parameter.

ACPI is enabled for both boards. We still expect the boards to use
QEMU's device-tree as control device-tree.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
(cherry picked from d94ebdd2c823ce8776723184cda960dcd2954711)
Remove the rva23s64 CPU since we don't have that in our QEMU:
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-27 11:09:13 -07:00
Simon Glass
073cddf846 Revert "test: hooks: Update qemu-riscv64 config for S-mode with OpenSBI"
This reverts commit 5f66188fd5.
2025-12-27 10:14:32 -07:00
Simon Glass
b5b75c768e test: hooks: Add more ellesmere config files
Add configuration files for qemu-riscv32_smode, qemu-riscv64_smode,
qemu-riscv64_smode_acpi, qemu_arm64_acpi, and qemu_arm64_lwip boards.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-26 20:09:09 -07:00
Simon Glass
5f66188fd5 test: hooks: Update qemu-riscv64 config for S-mode with OpenSBI
Update the qemu-riscv64 hook config to use OpenSBI as the BIOS and load
U-Boot as the kernel, which is required for S-mode operation.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-26 20:09:09 -07:00
Simon Glass
227cc00fd8 test: hooks: Add missing ellesmere config files
Add configuration files for qemu-arm-sbsa, qemu-ppce500, and
qemu-xtensa-dc233c boards.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-26 20:09:09 -07:00
Simon Glass
092588090a test: hooks: Add a symlink for tasman
Add a symlink to ellesmere so we can run tests on tasman.

Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-01 15:57:27 +00:00
Simon Glass
878b4a0842 hooks: Add ellesmere riscv64_spl board
Add a symlink for this board to the travis-ci board.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-18 13:56:05 -06:00
Simon Glass
b7fe69a08f hooks: ellesmere: Add a coreboot board
Add a coreboot board which can run under QEMU on ellesmere.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-18 13:56:05 -06:00
Simon Glass
f9f05c7237 hooks: Allow writing the console log to a file
Labgrid has a --log-output option to allow writing its log output to a
file. Add a way to control this from Labgrid's U-Boot scripts.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-21 16:44:01 -06:00
Simon Glass
327d8cb960 hooks: Pass the verbose flag to labgrid
The V variable includes the -v flag if verbose operation is requested
in Labgrid. Add it to the console cmdline.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-21 16:44:01 -06:00
Simon Glass
c0aed65cdf hook: Add hooks for okoro
Provide a symlink so that tests can run on okoro (a laptop).

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-12 12:53:22 +02:00
Simon Glass
c1ce4fcc9c hooks: x86: Enable support for a random-number generator
Enable the virtio-rnd-pci device in QEMU so that fdt_test_chosen() can
operated.

Since overlays are enabled for qemu-x886_64

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-11 21:12:11 +02:00
Simon Glass
ad6854b4fb hooks: Support passing all params to labgrid
At present Labgrid only gets a subset of the variables when running
pytests. Use the 'vars' environment variable instead, so that all of
them are provided.

This allows the board config to be adjusted in a test.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-06-07 16:51:23 +00:00
Heinrich Schuchardt
88aa63226b hooks: travis-ci: qemu-riscv64_na: add a second network interface
U-Boot allows to have multiple network interfaces and switching between
these. This functionality cannot be tested if QEMU only emulates a single
NIC.

Provide a QEMU configuration with multiple network interfaces.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-28 10:43:10 +01:00
Simon Glass
8aba967257 hooks: ellemere: Add qemu_arm/64_spl board
These are similar to the existing qemu_arm/64 targets, except that the
'bios' is image.bin (containing both SPL and U-Boot) rather than in
u-boot.bin

They will be used for testing standard passage on QEMU

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-28 10:43:10 +01:00
Simon Glass
db9fffb83b hooks: travis-ci: Add qemu_arm/64_spl board
These are similar to the existing qemu_arm/64 targets, except that the
'bios' is image.bin (containing both SPL and U-Boot) rather than in
u-boot.bin

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-28 10:43:10 +01:00
Tom Rini
2bf21f0805 hooks: Add support for FVP emulator and fiptool
This adds support for the vexpress_fvp platforms. In order to do that we
need to add support for calling fiptool to update an existing "fip" file
with our U-Boot build. We also need to support launching the FVP
emulator itself. This is a little tricky in that we need to use "telnet"
to reach the created serial ports and cannot just use an existing
file descriptor for our needs. Finally, we add in conf files for
vexpress_fvp to make use of this, and a symlink for the
vexpress_fvp_bloblist platform.

Reviewed-by: Harrison Mutai <harrison.mutai@arm.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2025-05-28 10:43:10 +01:00
Simon Glass
246ff47cad hooks: ellesmere: Add QEMU config for riscv, arm, x86
Add symlinks so that the (non-labgrid) lab works on ellesmere.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-28 10:43:10 +01:00
Simon Glass
a3bc8151d1 hooks: labgrid: Deal with strange Python error
Add a way to work around an unexplained Python message which appears
sometimes with Python 3.12.3

Make the file executable while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-28 10:43:10 +01:00
Tom Rini
de8159447b hooks: sifive_unleashed: Rename conf file back
When renaming the py file for this platform we shouldn't have renamed
the conf file as well.

Fixes: 133ff81950f9 ('sifive_unleashed: Rename "spi-nor_qemu" variant to "spi_nor_qemu"')
Signed-off-by: Tom Rini <trini@konsulko.com>
2025-05-28 10:43:10 +01:00
Tom Rini
0262541809 hooks: sifive_unleashed: Rename "spi-nor_qemu" variant to "spi_nor_qemu"
Given how files are searched and parsed,
py/travis-ci/u_boot_boardenv_sifive_unleashed_spi-nor_qemu.py was not
being used due to the dash in the name. Use an underbar for consistency.

Signed-off-by: Tom Rini <trini@konsulko.com>
2025-05-28 10:43:10 +01:00
Edi Feschiyan
576d24dba7 hooks: labgrid: Add wrapper scripts around using labgrid-client for device control
General usage for these hooks is documented in the README.md file. In
terms of implementation, To start with, we add a common file to ensure
that all required environment variables are set. Next, we add a console
script which calls labgrid-console. We also add a reset script that
behaves similarly. For writing files a wrapper around using
labgrid-client sd-mux is provided and then both Raspberry Pi an TI K3
platforms have writers provided. Sample board conf files can be found in
the bin/konsulko-labgrid directory.

Reviewed-by: Simon Glass <sjg@chromium.org>
Co-developed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Edi Feschiyan <edi.feschiyan@konsulko.com>
2025-05-28 10:43:10 +01:00
Simon Glass
08a888fa52 hooks: Provide some basic scripts for Labgrid integration
With Labgrid we don't need to specify the various methods, except for
the console, which simply calls labgrid-client.

This allows supporting any boards in your lab, without adding per-board
configuration to these hooks.

Provide ellesmere files as an example lab-configuration.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-28 10:43:09 +01:00
Simon Glass
d4c96886ec hooks: Add .none scripts for power off/on
These methods don't have a 'none' method right now, but it will be
needed for Labgrid. Add these scripts.

Note that these are not used by the existing integration, which requires
that boards can be powered off and on.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-28 10:43:09 +01:00
Simon Glass
d4c7435a96 hooks: Create a common file for test scripts
The top part of each of the u-boot-test-* files is common. Put it in
a common script file to avoid duplication and to allow it to be
replaced for the Labgrid-sjg integration.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2025-05-28 10:43:09 +01:00
Simon Glass
dfc6993eab hooks: qemu_arm64_tpl: Add a new board
Add this new board, to support testing the relocating SPL loader.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2025-05-28 10:43:09 +01:00
Patrick Rudolph
cb5d48aea1 hooks: travis-ci: Add qemu-arm-sbsa-ref
Add support for testing sbsa-ref via QEMU. sbsa-ref has two SPI
NOR flash, one for Arm-TF and one for unsecure firmware, providing
ACPI tables to the OS.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2025-05-28 10:43:09 +01:00
Tom Rini
21136e6186 hooks: bin/flashair.rpi: Use kernel= and simplify logic
Rather than guess what we need to name our u-boot.bin file as for it to
boot make use of the kernel= option to always call it u-boot.bin and
then on 64bit platforms (and since future platforms use rpi_arm64 this
list should not grow) also pass in arm_64bit=1.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
2025-05-28 10:43:09 +01:00
Tom Rini
c11157afba hooks: bin/writer.rpi_mount: Use kernel= and simplify logic
Rather than guess what we need to name our u-boot.bin file as for it to
boot make use of the kernel= option to always call it u-boot.bin and
then on 64bit platforms (and since future platforms use rpi_arm64 this
list should not grow) also pass in arm_64bit=1.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
2025-05-28 10:43:09 +01:00
Heinrich Schuchardt
ffdf39ee1a hooks: travis-ci: SiFive Unleashed: avoid format warning
QEMU expects the file format to be specified even for raw files.
Currently this change only suppresses a warning.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-05-28 10:43:09 +01:00
Jiaxun Yang
9bc634982a hooks: qemu-loongarch64: New board
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2025-05-28 10:43:09 +01:00
Jiaxun Yang
346525fffc hooks: qemu-xtensa-dc233c: New board
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2025-05-28 10:43:09 +01:00
Jiaxun Yang
2f10447cf2 hooks: qemu-arm64be: New board
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2025-05-28 10:43:09 +01:00
Jiaxun Yang
ed46aceb27 hooks: qemu-vexpress*: Pass -audio none
Those boards have build in sound card which cause
problems on CI runner.

Pass -audio none to disable sound card backends.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2025-05-28 10:43:09 +01:00
Tom Rini
ea62a157ec hooks: writer.ti-k3_mount: Correct the u-boot file to write
We need u-boot.img not u-boot.img.bin to be copied over.

Signed-off-by: Tom Rini <trini@konsulko.com>
2025-05-28 10:43:09 +01:00
Heinrich Schuchardt
a91012b620 hooks: qemu-riscv: enable virtio-rng-device
Linux' KASLR uses the EFI_RNG_PROTOCOL as entropy source. We should
enable CONFIG_DM_RNG in U-Boot. For the EFI unit test for the protocol to
succeed a virtio RNG device has to be provided when invoking QEMU.

Reported-by: Leo Liang <ycliang@andestech.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2025-05-28 10:43:09 +01:00
Tom Rini
7afcebfcf3 hooks: bin/writer.ti-k3_mount: Add support for TI K3 platforms via mount
The TI K3 platforms require a number of things in order to boot. We must
have built both the Cortex-R and Cortex-A configurations (following
their board documents and requirements as these need additional tooling
and binaries). Further, depending on the specific SoC and variant we
need three or four files to be copied to the mount point, with specific
names.  The least fragile way to handle this is that each board conf
file must define the name of the input files to copy (the outputs have
static names).

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
2025-05-28 10:43:09 +01:00
Tom Rini
939a27cfb3 hooks: bin/writer.ti-omap_mount: Add support for TI OMAP-style platforms via mount
In the case of TI OMAP (and similar) platforms, the SD card needs MLO
and u-boot.img to boot, always.  Copy these files over.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
2025-05-28 10:43:09 +01:00
Tom Rini
fea82efcec hooks: bin/writer.rpi*mount: Rework to support all current Pi platforms
Now that we have access to more variables in our "mount" writer scripts,
we can have a single one that covers all Pi variants.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
2025-05-28 10:43:09 +01:00
Tom Rini
ec0bcedc06 hooks: bin/flash.sdwire_common_mount: Switch to sourcing the next writer script
Rather than invoking the script that will write to the mounted directory
as a binary, source it as a script so that it has access to more than
just two parameters.  This will allow us to have the same flexibility in
our writers that other flash methods have.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
2025-05-28 10:43:09 +01:00
Heinrich Schuchardt
e0d82119ac hooks: qemu_arm64_na: enable semihosting
For testing semihosting we need to pass parameter -semihosting.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-05-28 10:43:09 +01:00
Marek Vasut
6268fa7f96 hooks: travis-ci: Add m68k M5208EVBE machine
Add m68k M5208EVBE machine configured to test U-Boot m68k support.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2025-05-28 10:43:09 +01:00
Joel Stanley
ef922e0297 hooks: travis-ci: Add Aspeed AST2600 Qemu configuration
Similar to the AST2500 this machine is emulated by Qemu. It boots from
a 64MB SPI NOR flash device by default.

Signed-off-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
2025-05-28 10:43:09 +01:00
Joel Stanley
a51d4c5255 hooks: ast2500: Simplify Qemu command line
The Aspeed machine in Qemu has appropriate defaults so we don't need to
specify these options.

Signed-off-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
2025-05-28 10:43:09 +01:00
Simon Glass
0d0ae8bb6b hooks: travis-ci: Add tests for booting from coreboot
Add a means of testing a coreboot + U-Boot build using qemu.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-28 10:43:09 +01:00
Heinrich Schuchardt
43b3127f26 hooks: Enable TPMv2 emulation
Provide a QEMU helper script to launch swtpm and add extra parameters to
conf.qemu_arm64_na and conf.qemu_arm_na to provide an emulated TPMv2.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-05-28 10:43:09 +01:00
Tom Rini
a282d5d3f4 hooks: writer: Add imx_raw variant
When flashing the SD card for an imx platform, we need to use
u-boot-with-spl.imx at an offset of 1024 bytes in to the device.

Signed-off-by: Tom Rini <trini@konsulko.com>
2025-05-28 10:43:09 +01:00
Simon Glass
4bcb3a199a hooks: kea: Add samus
Add a config for samus, the Chromebook Pixel 2.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-28 10:43:09 +01:00
Simon Glass
bcee141dd3 hooks: Update sdwire script to wait for umount
Sometimes the umount takes a while. Add the same wait loop as is used for
mount. Also rename the 'done' variable to 'complete' to void confusing it
with the end of the for loop.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-28 10:43:09 +01:00
Simon Glass
e49e2a1b1a hooks: Add wait_raw_device for common code
This code is duplicated in two scripts. Put it into a new wait_raw_device
to avoid this. Also rename the 'done' variable to 'complete' to void
confusing it with the end of the for loop.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-28 10:43:09 +01:00