Commit Graph

98489 Commits

Author SHA1 Message Date
Simon Glass
4b9e71cccf test/py: Tidy up pylint warnings in spawn
There are quite a few warnings which makes it confusing when editing
this file. Resolve the easy ones, with these remaining:

  55:0: R0913: Too many arguments (7/5) (too-many-arguments)
  91:0: R0902: Too many instance attributes (14/7) (too-many-instance-attributes)
  136:12: W0702: No exception type(s) specified (bare-except)
  246:4: R0912: Too many branches (14/12) (too-many-branches)

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-23 12:17:34 -06:00
Simon Glass
c9c686b043 test/py: Tidy up pylint warnings in console_sandbox
There are quite a few warnings which makes it confusing when editing
this file. Resolve them.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-23 12:17:32 -06:00
Simon Glass
6dd942f120 test/py: Tidy up pylint warnings in console_sandbox
There are quite a few warnings which makes it confusing when editing
this file. Resolve the easy ones, leaving:

  125:0: R0902: Too many instance attributes (14/7) (too-many-instance-attributes)
  212:4: R0912: Too many branches (14/12) (too-many-branches)
  271:4: R0913: Too many arguments (6/5) (too-many-arguments)
  271:4: R0912: Too many branches (13/12) (too-many-branches)
  454:8: W0702: No exception type(s) specified (bare-except)
  531:8: W0702: No exception type(s) specified (bare-except)

Rename wait_for_boot_prompt() so it is clear that it is an internal
function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-23 12:16:43 -06:00
Simon Glass
5683831563 test/py: Tidy up comments in ConsoleBase()
Some of the attributes are missing comments. Add these and tidy up a
few existing ones.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-23 12:16:43 -06:00
Simon Glass
4f1e711579 test/py: Tidy up pylint warnings in console_base
There are quite a few warnings which makes it confusing when editing
this file. Resolve the easy ones, leaving:

  125:0: R0902: Too many instance attributes (14/7) (too-many-instance-attributes)
  212:4: R0912: Too many branches (14/12) (too-many-branches)
  271:4: R0913: Too many arguments (6/5) (too-many-arguments)
  271:4: R0912: Too many branches (13/12) (too-many-branches)
  454:8: W0702: No exception type(s) specified (bare-except)
  531:8: W0702: No exception type(s) specified (bare-except)

Rename wait_for_boot_prompt() so it is clear that it is an internal
function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-23 12:16:43 -06:00
Simon Glass
c07812cc5a test/py: Log the PYTHONPATH on error
When no hook scripts are found, log the PYTHONPATH to aid debugging. Use
a separate variable to avoid an error on Python 3.10 and a pylint 3.3.4
warning:

   E0001: Parsing failed: 'f-string expression part cannot include a
      backslash (conftest, line 311)' (syntax-error)

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-23 12:16:43 -06:00
Simon Glass
4eeb84fb23 Merge branch 'qemk' into 'master'
x86: emulation: Tweaks to fit better with lxd

See merge request u-boot/u-boot!130
2025-07-23 01:59:03 +00:00
Simon Glass
317cd2073e x86: emulation: Use bootstd to boot
Use the normal bootflow command to boot an OS.

Series-to: u-boot
Cover-letter:
x86: emulation: Tweaks to fit better with lxd
This series includes some changes so that the 64-bit x86 QEMU build can
be used with LXD.

This includes moving to Q35 and setting up a bootstd command.
END

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-22 19:27:19 -06:00
Simon Glass
5db07904c5 x86: emulation: Move the x86_64 build to Q35
Q35 is newer and has a native PCI Express bus. Move to using this by
default.

Update the QEMU script to select the correct machine.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-22 14:39:37 -06:00
Simon Glass
912ed79a33 x86: emulation: Sync the defconfigs
Sync defconfigs for both QEMU builds.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-22 14:39:33 -06:00
Simon Glass
a19b43ab72 Merge branch 'snap' into 'master'
emulation: Drop the snap description

See merge request u-boot/u-boot!129
2025-07-22 18:24:53 +00:00
Simon Glass
90acabc390 emulation: Drop the snap description
To allow us to build for an EFI snap, drop the QEMU description. The
snapcraft files are kept in separate repos:

  https://code.launchpad.net/~sjg1/u-boot/+git/u-boot-concept-efi
  https://code.launchpad.net/~sjg1/u-boot/+git/u-boot-concept-qemu/+ref/master

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-22 12:24:24 -06:00
Simon Glass
a3d82ed485 Merge branch 'snap' into 'master'
emulation: snap: Add python3-setuptools

See merge request u-boot/u-boot!128
2025-07-22 15:19:11 +00:00
Simon Glass
f999808c5c emulation: snap: Add python3-setuptools
Add a missing build-package which did not show up in local testing.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-22 09:16:43 -06:00
Simon Glass
fc213cf3b5 Merge branch 'snap' into 'master'
emulation: Add a snap description

See merge request u-boot/u-boot!127
2025-07-22 14:08:52 +00:00
Simon Glass
c6cd58b4a5 emulation: Add a snap description
To enable building U-Boot for QEMU as a snap, add an initial snapcraft
file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-22 08:08:05 -06:00
Simon Glass
53d438936d Merge branch 'labf' into 'master'
test/py: Minor improvement to labgrid integration

See merge request u-boot/u-boot!126
2025-07-22 03:38:22 +00:00
Simon Glass
4e875bf63e sandbox: Drop expect_reset from restart_uboot_with_flags()
No caller uses this argument, so drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-21 16:45:43 -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
d40c8f0b87 test/py: Fix a spurious tab in get_details()
One line is indented with tab instead of space. Fix it.

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
4674784f5b test/py: Provide an option to abort on an exception
It is quite tricky to debug problems in the test.py code itself, as when
something goes wrong the exception failure is caught and reported as a
test failure.

Add a -E option to simplify debugging.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-21 16:44:01 -06:00
Simon Glass
6776eb2133 beagleplay: Drop EFI self-tests
These don't actually seem to work, since the rest cannot be handled by
the lab. Disable them.

   Preparing for reset. Press any key...
   FAILED:
   test/py/tests/test_efi_selftest.py:20: in test_efi_selftest_base
       raise Exception('Failures occurred during the EFI selftest')
   E   Exception: Failures occurred during the EFI selftest 48053.8 ms

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-21 16:43:20 -06:00
Simon Glass
290829cc0d Merge branch 'devops' into 'master'
CI: Automate final release workflow with version bumping

See merge request u-boot/u-boot!125
2025-07-18 12:07:44 +00:00
Simon Glass
6a3532c0db CI: Automate final release workflow with version bumping
Introduce a new CI job in .gitlab-ci-release.yml to automate the
creation of project releases.

This change implements two new jobs in .gitlab-ci-release.yml:

1. A version:bump job that runs on a schedule. On the first Monday of an
even-numbered month, it automatically updates the VERSION and PATCHLEVEL
in the Makefile and pushes the change to the master branch.

2. A release:create job that is triggered by the version bump commit. It
creates the final GitLab Release and corresponding Git tag on the commit
containing the updated Makefile.

This ensures that the repository's version is correctly updated and
committed just before the official release tag is applied, creating a
clean and reliable release history.

This single job, designed to run on a schedule, contains logic to:

  - create a final release (e.g. 2025.08) on the first Monday of an
    even-numbered month.
  - create a release candidate (e.g. 2025.07-rc1) on all other
    scheduled days.

This uses official release-cli to create both the git tag and the
corresponding GitLab Release entry automatically.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-18 05:32:55 -06:00
Simon Glass
0c856610a9 Merge branch 'devops' into 'master'
CI: Automate releases with a scheduled job

See merge request u-boot/u-boot!113
2025.07-rc2
2025-07-18 02:44:45 +00:00
Simon Glass
75360e4c45 CI: Automate releases with a scheduled job
Introduce a new CI job in .gitlab-ci-release.yml to automate the
creation of project releases.

This single job, designed to run on a schedule, contains logic to:

  - create a final release (e.g. 2025.08) on the first Monday of an
    even-numbered month.
  - create a release candidate (e.g. 2025.07-rc1) on all other
    scheduled days.

This uses official release-cli to create both the git tag and the
corresponding GitLab Release entry automatically.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-18 02:44:28 +00:00
Simon Glass
5799c8f9b1 Merge branch 'play' into 'master'
CI: Add a beagleplay board

See merge request u-boot/u-boot!124
2025-07-18 02:43:51 +00:00
Simon Glass
a00a473657 CI: Add a beagleplay board
This board is interesting since it has two separate U-Boot builds. Add
it to the sjg lab.

Add the required support for a second build directory.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-17 20:42:00 -06:00
Simon Glass
d3e3575148 Merge branch 'fix-spl' into 'master'
spl: Finish rename of jump_to_image_no_args()

See merge request u-boot/u-boot!123
2025-07-18 01:51:19 +00:00
Simon Glass
dbe7b5ae23 spl: Finish rename of jump_to_image_no_args()
Some uses of this weak function were missed. Fix them.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: e2670b665d
2025-07-17 18:30:01 -06:00
Simon Glass
630c46362a Merge branch 'colib' into 'master'
test: Check booting via a script on an ARM board

See merge request u-boot/u-boot!122
2025-07-15 23:16:10 +00:00
Simon Glass
7c4ce04b1d test: Check booting via a script on an ARM board
Use the Colibri-iMX8x board to check that booting with a U-Boot script
works as expected.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-12 19:04:54 -06:00
Simon Glass
acce346379 Merge branch 'qemj' into 'master'
bootm: Clean up arch-specific, pre-OS clean-up

See merge request u-boot/u-boot!121
2025-07-13 00:07:42 +00:00
Simon Glass
712dd7cebc x86: Drop bootm_announce_and_cleanup()
Now that bootm_final() does most of what we want, drop this separate
function.

Series-to: concept
Cover-letter:
bootm: Clean up arch-specific, pre-OS clean-up
Each arch does something slightly different before booting the OS. Some
archs even do different things depending on the CPU type.

EFT_LOADER has its own special code, regardless of which arch is being
booted.

It is quite hard to know what actually happens in the final milliseconds
before the OS boot.

This series attempts to clean up U-Boot in this area.

The basic approach is to create a new bootm_final() function which is
called by all archs. It provides some flags for a couple of necessary
variations but otherwise it is generic.

RISC-V, x86 and ARM are converted over to use this new function. For
consistency, EFI loader is converted as well.

A noteable change is that EFI_LOADER now does bootstage processing
before boot, if enabled, thus producing a report.

Future work could take this a little further:
- Drop board_quiesce_devices() and rely on driver model for that
- Similarly with udc_disconnect()
- cleanup_before_linux() could use more details as to what it is
  supposed to do, to reduce the number of arch-specific variations
END

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-12 16:25:43 -06:00
Simon Glass
08f9163483 riscv: Drop announce_and_cleanup()
Now that RISC-V's announce_and_cleanup() function matches bootm_final(),
just use the latter.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-12 16:24:31 -06:00
Simon Glass
9571da723b arm: Drop announce_and_cleanup()
Now that ARM's announce_and_cleanup() function includes the same steps
as bootm_final(), just use the latter.

Move over part of a comment which seems useful.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-12 16:24:03 -06:00
Simon Glass
6da757f538 bootm: Move bootm_disable_interrupts() to bootm_final()
Move disabling of interrupts to bootm_final() so it is done for bootm
and EFI boot paths. Drop the now-duplicate calls.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-12 16:22:33 -06:00
Simon Glass
309c53edbb bootm: Drop re-enabling of interrupts on error
The logic in bootm to re-enable interrupts if the OS fails to boot does
not seem very useful, since the board resets immediately afterwards.

Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-12 16:21:34 -06:00
Simon Glass
ec4efd7f0f bootm: Move board_quiesce_devices(void) to bootm_final()
This function is called just before boot, so move it from EFI into the
common bootm_final() function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-12 16:18:52 -06:00
Simon Glass
490dbf1968 bootm: Call cleanup_before_linux() from bootm_final()
Add this call to the bootm_final() function, dropping it from RISC-V

Add a flag to ensure that cleanup_before_linux() is not called when
booting an EFI app.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-12 16:18:52 -06:00
Simon Glass
7482087639 bootm: Move cleanup_before_linux() to bootm.h
Move the declaration of this function to a common header. Make sure it
is included by files which define it.

Fix up a few whitespace problems while here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-12 16:18:34 -06:00
Simon Glass
0cde568159 x86: Add cleanup_before_linux()
This function is not present on x86, but there is an x86-specific
version which is never called. Add the former, making it call the
latter.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-12 16:17:08 -06:00
Simon Glass
898b951842 efi: Drop EFI_GRUB_ARM32_WORKAROUND
This work-around dates from 2019 and grub 2.04 which is quite old. New
builds of grub don't have the problem and old boards presumably use an
older U-Boot, so don't need this.

Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-12 16:16:50 -06:00
Simon Glass
a1ae8de12c riscv: Call bootm_final()
Make use of this function, adding some pieces needed by RISC-V

Drop the udc_disconnect() from EFI_LOADER since it is now done in
bootm_final()

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-12 16:14:47 -06:00
Simon Glass
d095cf76ba riscv: Drop board_quiesce_devices()
This is not used on RISC-V so drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-12 16:14:47 -06:00
Simon Glass
c3b0c2979e x86: Call bootm_final()
The x86 code in bootm_announce_and_cleanup() is very similar to the new
bootm_final() function, so just use the latter. Move over a useful
comment.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-12 16:14:47 -06:00
Simon Glass
bd57096c36 bootm: Do bootstage processing in bootm_final()
Mark kernel start before booting. If enabled, show a bootstage report.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-12 16:13:03 -06:00
Simon Glass
df1d27e51c bootstage: Add some missing dummy functions
Neither bootstage_fdt_add_report() nor bootstage_report() has a dummy
double for when bootstate is disabled. Add them.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-12 16:07:04 -06:00
Simon Glass
1490f70f9d bootm: Add a message when booting
Add a message about starting the kernel. For EFI this will be printed
when boot-services are exited.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-12 16:07:03 -06:00