Commit Graph

98113 Commits

Author SHA1 Message Date
Simon Glass
339bd5f0cf fdt: Support reading FDT from standard passage
Add an option to receive the FDT using standard passage from a previous
phase. Rename the FDT source to 'passage' to match the old terminology,
which was only partially added.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-29 17:21:36 +01:00
Simon Glass
86104769ba fdt: Redo devicetree setup
The existing logic for handling receiving a devicetree from a previous
phase is quite complicated. Simplify it in preparation for introducing
standard passage.

Add a Kconfig called OF_PASSAGE which indicates that the devicetree
must come from standard passage.

Series-changes: 3
- Add new patch to redo how a devicetree is set up

Series-changes: 4
- Drop now-unused label

Series-changes: 5
- Use OF_PASSAGE here instead of OF_BLOBLIST

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-29 17:21:36 +01:00
Simon Glass
e60873c8f3 passage: Support an incoming passage
Plumb in the ability for U-Boot proper to accept an incoming standard
passage from a previous phase, such as SPL or TF-A. This allows data to
be passed from binary to binary when firmware is booting.

Series-changes: 2
- Rebase to master
- Rework global_data for new stdpass convention

Series-changes: 3
- Move passage.h into this patch
- Add passage_valid() to decide if stdpass was provided
- Move arch_passage_entry() into this patch
- Make the global_data fields present only when needed

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-29 17:21:36 +01:00
Simon Glass
e2670b665d spl: Rename jump_to_image_no_args()
This is about to become a misnomer since with standard passage we need to
pass arguments to U-Boot. Rename the function.

Also rename the local variable to 'jumper' to avoid a conflict.

Series-changes: 2
- Split the jump_to_image_no_args() change into its own patch

Signed-off-by: Simon Glass <sjg@chromium.org>
Change-Id: Ieb1fd7a5478ba1dfe3a58666ed586e83b0641590
2025-05-29 17:21:36 +01:00
Simon Glass
3e940f2082 x86: Move Intel GNVS file into the common include directory
Move this so we can include it from sandbox, needed since it is in a
bloblist and must have a check.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-29 17:21:36 +01:00
Simon Glass
a99c0fd10c spl: Tidy up the header includes
These are out of order. Fix them.

Signed-off-by: Simon Glass <sjg@chromium.org>
Change-Id: Ie563607416a8f7504c69b46ce608c1c1df75caa6
2025-05-29 17:21:36 +01:00
Simon Glass
14cce62f78 emulation: fdt: Allow using U-Boot's device tree with QEMU
At present it is impossible to change the qemu_arm64 defconfig to
obtain a devicetree from the U-Boot build.

This is necessary for FIT validation, for example, where the signature
node must be compiled into U-Boot.

A proposed change to QEMU to allow device tree additions has been
blocked for several years. The only known workaround is to use QEMU's
dumpdtb option, merge in the signature node manually, disable
OF_HAS_PRIOR_STAGE and then start QEMU with special arguments. This is
complicated enough that it is documented in U-Boot[1].

Unfortunately the only way to disable OF_HAS_PRIOR_STAGE at present is
to hack the Kconfig.

Add a new QEMU_MANUAL_DTB Kconfig option which makes OF_HAS_PRIOR_STAGE
optional, thus avoiding needing to patch U-Boot to get this working.

This seems a clearer solution than just making OF_HAS_PRIOR_STAGE
visible, since that symbol is intended to be set automatically by each
platform.

Series-to: u-boot
Series-cc: trini
Series-cc: Peter Maydell <peter.maydell@linaro.org>
Series-cc: Andrew Phelps <andrew.phelps@canonical.com>
Series-cc: ilias
Series-changes: 2
- Add a new QEMU-specific Kconfig instead
- Move patch into the standard-passage series

Series-changes: 3
- Fix 'usiing' typo
- Add mention of QEMU_MANUAL_DTB in doc/

[1] https://docs.u-boot.org/en/latest/develop/devicetree/dt_qemu.html
Link: https://patchwork.kernel.org/project/qemu-devel/patch/20210926183410.256484-1-sjg@chromium.org/#24481799

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Tom Rini <trini@konsulko.com>
2025-05-29 17:21:36 +01:00
Simon Glass
6c1e1062ac scripts: build-qemu: Support xPL with ARM
Add a -x flag to build/run xPL instead of the normal build.

Series-changes: 5
- Add RFC for test script

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-29 17:21:36 +01:00
Simon Glass
4db3367f1b Merge branch 'ci' into 'master'
test: run some test commands only if HUSH_PARSER is enabled

See merge request u-boot/u-boot!91
2025-05-29 16:20:47 +00:00
Jerome Forissier
f6e7e8c348 lib/uuid.c: use unique name for PARTITION_SYSTEM_GUID
The name defined for PARTITION_SYSTEM_GUID in list_guid[] depends on
configuration options. It is "system" if CONFIG_PARTITION_TYPE_GUID is
enabled or "System Partition" if CONFIG_CMD_EFIDEBUG or CONFIG_EFI are
enabled. In addition, the unit test in test/common/print.c is incorrect
because it expects only "system" (or a hex GUID).

Make things more consistent by using a clear and unique name: "EFI
System Partition" whatever the configuration, and update the unit test
accordingly.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2025-05-29 16:08:37 +01:00
Heinrich Schuchardt
9d25a85cd6 MAINTAINERS: add qemu-riscv* defconfigs to QEMU RISC-V 'VIRT' BOARD
Add the follow board to VIRT which otherwise would be unmaintained:

* qemu-riscv64_smode_acpi_defconfig

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-05-29 16:07:52 +01:00
Heinrich Schuchardt
0288cbcff8 configs: add qemu-riscv64_smode_acpi_defconfig
Add a configuration that supports ACPI.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-05-29 16:07:52 +01:00
Heinrich Schuchardt
8940d0833b MAINTAINERS: add all qemu_arm64* defconfigs to VIRT
Add the following boards to VIRT which otherwise would be unmaintained.

* qemu_arm64_acpi_defconfig
* qemu_arm64_lwip_defconfig

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-05-29 16:07:51 +01:00
Heinrich Schuchardt
07b59bfa6a configs: add qemu_arm64_acpi_defconfig
Add a qemu_arm64 variant that supports ACPI.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2025-05-29 16:07:51 +01:00
Jerome Forissier
08f52d0c59 configs: enable CONFIG_UNIT_TEST for all qemu* generic targets
The qemu* "generic" targets (i.e. not those emulating a particular
board) are typically used for testing as many features as possible,
especially in CI so it makes sense to have UNIT_TEST enabled for
all of the defconfigs for these targets.

Not enabling UNIT_TEST in qemu-x86_defconfig due to:

    LD      u-boot
  ld.bfd: section .rel.dyn VMA wraps around address space
  ld.bfd: section .start16 LMA [fffff800,fffff86f] overlaps section .rel.dyn LMA [ffffb77c,0002ac93]
  make: *** [Makefile:1824: u-boot] Error 1

Suggested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Drop ppc due to build warning:
test/lib/str.c:230:50: error: left shift count >= width of type [-Werror=shift-count-overflow]
+  230 |                                 simple_itoa((1UL << 63) - 1));

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-29 16:07:51 +01:00
Jerome Forissier
2f15386574 test: run some test commands only if HUSH_PARSER is enabled
Some test commands (such as "false", or the empty string) need
CONFIG_HUSH_PARSER=y. Fix test/cmd/command.c.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2025-05-29 16:07:51 +01:00
Heinrich Schuchardt
3ac9e52bc9 acpi: don't fill FADT, MADT if CONFIG_QFW_ACPI=y
When using the ACPI tables supplied by QEMU, we don't need to build the
FADT and MADT tables in U-Boot.

This patch avoids a build failure

    make qemu-riscv64_smode_defconfig acpi.config

    riscv64-linux-gnu-ld.bfd: lib/acpi/acpi_table.o:
    in function `acpi_write_fadt':
    lib/acpi/acpi_table.c:265:(.text.acpi_write_fadt+0x15c):
    undefined reference to `acpi_fill_fadt'

    riscv64-linux-gnu-ld.bfd: lib/acpi/acpi_table.o:
    in function `acpi_write_madt':
    lib/acpi/acpi_table.c:294:(.text.acpi_write_madt+0x52):
    undefined reference to `acpi_fill_madt'

Fixes: f5f7962091 ("acpi: x86: Write FADT in common code")
Fixes: 4a3fc0f525 ("acpi: x86: Move MADT to common code")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2025-05-29 16:07:51 +01:00
Heinrich Schuchardt
f0e873fa56 arm: simplify updating ACPI table header checksum
Use acpi_update_checksum() to update table header.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
2025-05-29 16:07:51 +01:00
Heinrich Schuchardt
2dfba5041b qemu-sbsa: simplify updating ACPI table header checksum
Use acpi_update_checksum() to update table header.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29 16:07:51 +01:00
Heinrich Schuchardt
a41cc36db3 x86/acpi: simplify updating header checksum
Use acpi_update_checksum() for updating ACPI table header checksum.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
2025-05-29 16:07:51 +01:00
Heinrich Schuchardt
cbf235cf36 acpi: simplify updating header checksum
Use acpi_update_checksum() for updating ACPI table header checksum.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
2025-05-29 16:07:51 +01:00
Heinrich Schuchardt
23f950abe0 acpi: new function acpi_update_checksum()
Introduce a new function to update ACPI table headers.
This allows to simplify the existing code.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-29 16:07:51 +01:00
Heinrich Schuchardt
da51fe6e13 smbios: select CONFIG_BLOBLIST
Since commit 53d5a22163 ("emulation: Use bloblist to hold tables")
`make qemu-riscv64_smode_defconfig acpi.config && make` fails with

    drivers/misc/qfw_smbios.c:93:(.text.qfw_evt_write_smbios_tables+0xe):
    undefined reference to `bloblist_add'

Build with bloblist support.

Fixes: 53d5a22163 ("emulation: Use bloblist to hold tables")
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-05-29 16:07:51 +01:00
Heinrich Schuchardt
3fe84dc3ac acpi: select CONFIG_BLOBLIST
Since commit 53d5a22163 ("emulation: Use bloblist to hold tables")
`make qemu-riscv64_smode_defconfig acpi.config && make` fails with

    qfw_acpi.c:146:(.text.evt_write_acpi_tables+0xc):
    undefined reference to `bloblist_add'

Build with bloblist support.

Fixes: 53d5a22163 ("emulation: Use bloblist to hold tables")
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Expand bloblist size for minnowmax:
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-29 16:07:50 +01:00
Simon Glass
90154acc03 Merge branch 'ci' into 'master'
test: Bring in the test hooks

See merge request u-boot/u-boot!90
2025-05-28 10:21:58 +00:00
Simon Glass
716e2f864b CI: Update to use the hooks in the U-Boot repo
Now that the hooks are present, make use of them directly rather than
cloning the separate repo.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2025-05-28 10:51:02 +01:00
Simon Glass
e9f7a83074 doc: Tidy up the hooks documentation
Now that these files are within the repo, link the documentation to the
normal U-Boot documentation. Update directory paths and convert it to
rST format.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-28 10:48:04 +01:00
Tom Rini
f60242a69d CI, docs: Install test/py/requirements.txt as well
As noted by Quentin, in CI we should be at least versioning the pytest
that we install. To avoid problems later, go with the whole requirements
file being used. Furthermore, our documentation building for readthedocs
must also have pytest so install the requirements file there as well.

Reported-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
2025-05-28 10:48:04 +01: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
Simon Glass
adf8a52f6f hooks: labgrid-sjg: Add systemd scripts
Add example scripts to start the coordinator and exporter.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-28 10:43:10 +01:00
Simon Glass
5bb493ddaf hooks: labgrid-sjg: Add kea lab
Add the current state of the kea lab as an example to others.

This includes 48 boards, not all of which work.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-28 10:43:10 +01:00
Tom Rini
8e395d853a hooks: py/konsulko-labgrid: Add sample rpi_arm64 / rpi_4 boardenv file
To match up with the sample conf file under bin/konsulko-labgrid, add a
boardenv file for the rpi_4 and rpi_arm64 variants (cannot be shared
with rpi_4_32b as we have aarch64 specific example test files). This
shows how to enable network based tests, including OS boot on the
platform.

Signed-off-by: Tom Rini <trini@konsulko.com>
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
e0780d9ad7 hooks: py: Rename the rest of the boardenv files with "-" in their name
The way that test/py/conftest.py has always worked is that it translates
all "-" to "_" when looking for boardenv files. Rename the few
incorrectly named ones that we had.

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
Venkatesh Yadav Abbarapu
863fe8116b hooks: travis-ci: Skip the saveenv and reset test cases on xilinx zynq qemu
There is an issue with the xilinx zynq qemu qspi driver during the erase
operation in dual parallel configuration, so skip these
tests for now.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Acked-by: Michal Simek <michal.simek@amd.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