Commit Graph

1726 Commits

Author SHA1 Message Date
Simon Glass
bca5edfcf6 checkpatch: Allow AI Co-developed-by without matching Signed-off-by
When a patch is co-developed with an AI assistant, the Co-developed-by
tag typically uses a noreply email address. Since Signed-off-by requires
a real person with a valid email address, skip the name/email mismatch
warning when the Co-developed-by email contains "noreply@".

Cover-letter:
checkpatch: Sync with Linux v6.18
This series syncs checkpatch.pl with Linux v6.18 and adds several
U-Boot-specific improvements:

- Fix patman's checkpatch message parsing for consecutive messages
- Allow test macros (UNIT_TEST, etc.) immediately after function close
- Allow AI Co-developed-by tags without requiring matching Signed-off-by
END

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-25 14:31:00 -07:00
Simon Glass
6ad7f66b1c checkpatch: Allow test macros immediately after function close
U-Boot test declarations (e.g., FS_TEST, UNIT_TEST) should immediately
follow the closing brace of the test function with no blank line.

Add an exception to the blank-line-after-declaration check for *TEST
macros, and add a new check that warns if there IS a blank line before
a test declaration macro.

Update the patman test to handle duplicate warnings now that message
parsing correctly separates consecutive checkpatch messages.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-25 14:31:00 -07:00
Simon Glass
8a12c56e54 checkpatch: Sync with Linux v6.18
Update checkpatch.pl from Linux v6.18, adding U-Boot-specific checks:

- Add --u-boot option to enable U-Boot-specific warnings
- Add debug/printf to $logFunctions
- Add u_boot_struct_name() for driver struct naming conventions
- Add u_boot_line() with checks for uclass, livetree API, commands,
  IS_ENABLED usage, strl* functions, CONFIG symbols, barred includes,
  fdt/initrd relocation, skip_board_fixup, and driver model schema

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-25 14:31:00 -07:00
Heinrich Schuchardt
83b07f6647 scripts: add volatge to spelling.txt
To avoid future misspells add volatge to spelling.txt.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
(cherry picked from commit 0be26928bf)
2025-12-19 22:37:20 -07:00
Simon Glass
2812864362 check_linker_lists: Enhance detection of alignment problems
When linker-inserted padding breaks list integrity, pointer arithmetic
like (end - start) / sizeof(struct) produces garbage. GCC optimizes
division by constants using multiplicative inverses, which only works
when the dividend is an exact multiple. With padding, outputs like
"Running -858993444 bloblist tests" appear instead of the correct count.

Enhance the linker list checking script to detect these problems by
adding symbol size tracking using nm -S. This enables:

1. Padding detection: Compare symbol sizes to gaps. If gap > size,
   padding was inserted, breaking contiguous array assumptions.

2. Pointer arithmetic bugs: Check if (end - start) marker span is a
   multiple of struct size.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-13 16:28:53 -07:00
Simon Glass
857835fbf2 scripts: Add tkey_fde_key.py for TKey disk encryption
Add a Python script for TKey-based full disk encryption key generation
and disk encryption operations:

- Generate hardware-backed encryption keys using TKey's Ed25519
  signature and SHA-256 hashing
- Encrypt disk images with LUKS using the derived keys
- Open LUKS encrypted disks using the derived keys
- Support for both interactive password input and file/stdin input
- Automatic TKey device detection via USB enumeration

The script derives deterministic encryption keys from a password and
the TKey's unique device identifier, suitable for unlocking encrypted
root filesystems at boot time.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-08 05:22:18 -07:00
Simon Glass
1ecf365eab efi: Drop the message about building the EFI capsule
This message is not very useful, so drop it.

Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-11-12 08:40:05 -07:00
Simon Glass
3a801fde21 scripts: Provide a way to use custom firmware
Update both build-efi and build-scripts to allow a -c option to provide
custom firmware. This makes the scripts more generally useful.

Drop the existing -c for --spice since it conflicts and is also is bit
hard to remember.

Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-11-12 06:09:52 -07:00
Simon Glass
7c1597588d scripts: build-efi: Allow including other files
Provide a way to include a directory of files in the firmware image
created by build-efi

This is useful for including a U-Boot environment, for example.

Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-11-12 06:09:52 -07:00
Simon Glass
b9eb028294 scripts: Makefile.lib: Fix image .S generation for out-of-tree builds
The conditional filter checking for "drivers/video/images" in $(obj)
fails for out-of-tree builds where $(obj) contains the full build path.
Fix the wildcard pattern (%drivers/video/images) so files are matched
correctly.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-11-03 06:49:40 +01:00
Simon Glass
a12023a01a scripts: build-efi: Write uboot.env file for bootcmd support
When running U-Boot as an EFI application under EDK2/OVMF, U-Boot doesn't
have direct access to QEMU's fw_cfg interface. To support the --bootcmd
option, write a uboot.env file to the EFI partition containing the boot
command.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-25 18:19:23 +01:00
Simon Glass
2c415606fd scripts: Support --bootcmd more generally
Add -b as a short alias for --bootcmd to build_helper so it is available
in both build-qemu and build-efi

Move the fw_cfg bootcmd logic to build_helper as well.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-25 18:19:23 +01:00
Simon Glass
6f8131d1a4 scripts: build-qemu: Allow enabling TKey access
Provide a -T/--tkey option to enable access to a USB-attached Tillitis
TKey.

Series-to: concept
Series-cc: heinrich
Series-links: 1:54
Series-version: 2
Cover-letter:
Bootstage and script enhancements
This series collects together a few improvements to the bootstage
subsystem, principally some new tests.

It also adds support for ACPI FPDT which is a way of passing timing
information to the OS.

A bug fix is provided for mouse clicks with expo.

Finally the series includes some new options for the build-efi script
for networking, spice, etc.
END

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-23 19:36:32 +01:00
Simon Glass
357418fc47 scripts: build-efi: Flush output before running QEMU
Complete writing of any output before running QEMU, since otherwise it
does not always appear until QEMU exits (e.g. with 'tee')

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-23 19:36:32 +01:00
Simon Glass
b6d52a75b8 scripts: build-efi: Allow enabling networking
Provide a -N/--net flag to enable networking for the guest.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-23 19:36:32 +01:00
Simon Glass
ab855a1aa4 scripts: build-efi: Support spice integration
Add a -c/--spice flag to enable spice, so that copy/paste works between
the guest and host.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-23 19:36:32 +01:00
Simon Glass
6b7d989d9f tkey: Add the signer firmware
Add a binary for the TKey signer, so that it can be downloaded to the
key when needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-19 12:27:49 +01:00
Simon Glass
935ae7fc6a scripts: build-efi: Use a locally built OVMF image
The standard OVMF image does not include mouse support. Use a locally
built release build instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-18 09:38:25 +01:00
Simon Glass
b1110b1fe7 scripts: build-efi: Use the USB mouse
The USB mouse seems to have an absolute-pointer driver which can be
enabled in OVMF. Switch to this for x86.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-13 14:20:15 +01:00
Simon Glass
fae5a7c0fc scripts: build-qemu: Add --bootcmd option to pass bootcmd via fw_cfg
Add a --bootcmd option to the build-qemu script that allows passing a
boot command to QEMU via fw_cfg. The bootcmd is written to the
"opt/u-boot/bootcmd" fw_cfg entry, which can be read by U-Boot's
EVT_BOOTCMD handler.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-07 06:13:49 -06:00
Simon Glass
ed6674e5be acpi: bgrt: Move the BGRT image into the images directory
Move the BGRT image to use the same video_image linker-list approach
as the other embedded image. Move it into the drivers/video/images
directory and rename it to 'bgrt.bmp' since we know it is an image.

Drop the old bgrt Makefile rule as it is no-longer needed.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-02 13:51:03 -06:00
Simon Glass
d16fbb3f52 video: Support a linker list of images
It is inconvenient to have to access graphical images as independent
symbols. Create a new rule which handles any file mentioned in
drivers/video/images/Makefile

For each graphical image, embed in the image and create a linker-list
entry for it.

Series-changes: 2
- Use Canonical copyright

Series-changes: 3
- Rename it to video_defs.h since we will use it elsewhere

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-02 13:50:57 -06:00
Simon Glass
81e1ce0ea7 script: Use a minimum of 1G of memory for EFI
Since the U-Boot app now requests 512MB (to fit the ramdisk, etc.) and
Tianocore uses some as well, the current 512MB is not enough. Double it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-24 18:29:39 -06:00
Simon Glass
4669ad3785 scripts: Update build-efi/qemu to support disabling pager
The pager can interfere with tests and there is a lab test which uses
the build-efi script. Add an option to disable the pager so that the
labgrid test can request that.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-23 12:22:45 -06:00
Simon Glass
08faed68c3 scripts: Fix RST formatting in release_version.py
Fix line continuation in generate_schedule() that caused Sphinx to fail
with "Bullet list ends without a blank line; unexpected unindent" error.
Add tests to validate RST formatting of generated documentation.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-22 11:23:04 -06:00
Simon Glass
0e944b89ab scripts: Fix conditional syntax for capsule ESL generation
The ifeq/else/endif conditional for capsule_esl_file generation was
incorrectly placed inside the recipe, causing malformed Makefile syntax
that prevented proper dependency resolution. This resulted in build
failures when CONFIG_EFI_CAPSULE_AUTHENTICATE was enabled because the
capsule_esl_file target could not be created from the certificate file.

Move the conditional to properly wrap the rule definitions, allowing
Make to correctly parse and execute the capsule ESL generation rules.

Signed-off-by: Simon Glass <sjg@chromium.org>
Co-developed-by: Claude <noreply@anthropic.com>
2025-09-19 11:42:34 -06:00
Simon Glass
ff37f4218a script: Support mouse with build-efi/qemu scripts
Provide arguments to QEMU to enable a mouse. Note that this does not
work with EFI at present.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-15 04:49:38 -06:00
Simon Glass
c448fc201c CI: Allow empty EXTRAVERSION
This can be empty for final releases, so adjust the logic to cope with
that.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-12 05:05:17 -06:00
Simon Glass
e2dc195820 CI: Correct the release numbering
This is around the wrong way. It should start with rc1 and progress up
from there. Fix this.

Also ensure that releases only happen every second Monday.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-12 05:05:16 -06:00
GitLab CI Runner
4fe2797092 scripts: Add Python-based release version calculation system
Add a Python script to replace shell-based release version calculations
with proper datetime handling:

Features:
- Calculates release versions based on U-Boot's bimonthly schedule
- RC numbering counts backwards from final release (rc1=2wks, rc2=4wks,
  rc3=6wks)
- Dead-period detection for dates too early in release cycle
- Automatic Makefile version updates
- Release documentation generation and updates
- Multiple output formats (shell variables, JSON, version string)

Testing:
- 39 comprehensive test cases covering all scenarios
- 93% test coverage including edge cases and error handling
- Tests for cross-year boundaries, dead periods, and file operations

The script provides robust release automation for the GitLab CI pipeline
with proper error handling and extensive validation.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org)
2025-09-11 22:00:10 -06:00
Simon Glass
e63307f8c0 efi: Add a missing dependency for capsule_esl_dtsi
The input file is used to process the dtsi, so add a dependency. This
bug was previously masked by a FORCE which was removed in

   7738c4c2d7 Makefile: Avoid FORCE with ESL

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-10 11:37:03 -06:00
Simon Glass
7738c4c2d7 Makefile: Avoid FORCE with ESL
We don't need to force building of the ESL dtsi or capsule file if they
already exist. Drop the FORCE dependencies.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-09 22:58:34 +00:00
Simon Glass
53a402b8c6 Makefile: Avoid FORCE with test overlays
We don't need to force building of these files if they already exist.
Drop the FORCE dependencies.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-09 22:58:34 +00:00
Simon Glass
eeaaa9c448 Makefile: Avoid FORCE with CHID
We don't need to force building of this file if it already exists. Drop
the FORCE dependency.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-09 22:58:34 +00:00
Simon Glass
896268f40e Makefile: Shorten a few quiet build steps
A few of the steps are longer than the 7 characters allowed. Shorten
them so that the build output looks better:

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-09 22:58:34 +00:00
Simon Glass
f379b6570f ulib: scripts: Add a script to support symbol-renaming
When U-Boot is used as a library with other programs, some U-Boot
function names may conflict with the program, or with standard-library
functions. For example, printf() is defined by U-Boot but is typically
used by the program as well.

The easiest solution is to rename symbols in the object file, so that
they appear with a 'ub_' prefix when linked with the program.

Add a new build_api.py script which can:

- rename symbols based on a rename.syms file
- generate a header file (with the renamed symbols) for use by the
  program

This makes use of the 'objcopy --redefine-sym' feature.

The tool has 100% test coverage.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-08 13:09:56 -06:00
Simon Glass
a9e04b5d36 Makefile: Integrate CHID files into the build
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>
2025-09-04 07:08:25 -06:00
Simon Glass
7d793ccadd scripts: Add a tool to convert CHIDs to devicetree
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>
2025-09-04 07:08:25 -06:00
Simon Glass
c6883b8a71 scripts: Add an option for the build directory
When running in CI it is better to specify the build directory rather
than provide a device. Add a --build-dir option.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-12 13:41:05 -06:00
Simon Glass
7c63cdd830 scripts: Correct virtio-sci typo
Fix a small typo in the help.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-08 16:53:16 -06:00
Simon Glass
5f6e2806b0 scripts: build-efi: Enable the display on ARM
Enable the display on ARM devices, so it works when running Tianocore.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-08 16:53:16 -06:00
Simon Glass
79c09c4244 scripts: build-qemu: Always call the run() function
The helper deals with whether we are actually running or not. We want it
to show the arguments even if not. So always call it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-08 16:53:16 -06:00
Simon Glass
0d08920da2 scripts: build-qemu: Enable the display on ARM
ARM devices can use a GPU display, which U-Boot only recented supports.
Enable the option.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-08 16:52:48 -06:00
Simon Glass
219adf6bf8 scripts: build-qemu: Correct networking
Networking is not currently enabled, since the wrong variable is used.
Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-08 15:59:43 -06:00
Simon Glass
654bf17503 scripts: build-qemu: Support Tianocore on ARM
When ARM is selected, use the ARM Tianocore image.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-08 15:59:43 -06:00
Simon Glass
4470f4f729 scripts: build-qemu: Move virtiofsd code into the helper
Move this code into the helper so that build-efi can use it too.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-08 15:59:43 -06:00
Simon Glass
2a6a7e9716 scripts: build-qemu: Move qemu program-name to the helper
Put this in the helper so that we can (later) have it show the correct
error when the virtiofs daemon fails.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-08 15:59:43 -06:00
Simon Glass
a783a7ea64 scripts: build-qemu: Move memory size to the helper
Move this field to the helper so we can (later) have it set up the
virtiofs daemon.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-08 15:59:43 -06:00
Simon Glass
68ec2401ad scripts: Adjust EFI script to support an OS
At present the OS disk conflicts with the boot disk used to hold the
app (or payload). Number the OS disk after that.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-08 14:47:39 -06:00
Simon Glass
f7a683d3f3 scripts: Adjust EFI script to support a root disk
At present the root disk conflicts with the boot disk used to hold the
app (or payload). Use virtio for this disk and number the others after
that.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-05 11:49:30 -06:00