4367 Commits

Author SHA1 Message Date
Simon Glass
192c586a5d fit: Change indent from string to int
Change the indent field in fit_print_ctx from a string pointer to an int
number of spaces to indent.

Set the initial indent value to 3 to match IMAGE_INDENT_STRING

Drop indentation from the debug() calls since these are not visible to
users.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-11-19 19:51:46 -07:00
Simon Glass
62a4c7e10a fit: Put the indent string into print context
Move the indent string into struct fit_print_ctx so it is available to
the printing functions. This avoids having to pass it as a separate
parameter.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-11-19 19:50:10 -07:00
Simon Glass
6b6f03c388 fit: Add a context struct for FIT-printing
Create a struct fit_print_ctx to hold the FIT pointer and pass it to all
printing functions instead of passing the FIT pointer directly. This
provides a foundation for adding additional context in the future.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-11-19 19:50:10 -07:00
Simon Glass
0b51f99bf0 fit: Move printing code to its own file
There is enough code here that it makes sense to put it in its own file.
Create a new fit_print.c file, before undertaking future refactoring.

Printing is only included in the main build if CONFIG_FIT_PRINT is
enabled, although it is always included in the tools build.

Add static inlines for existing callers.

Make a few small code-style adjustments, including fixing checkpatch
warnings about over-use of brackets.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-11-19 19:50:09 -07:00
Simon Glass
cca21f0d2f fit: Remove unused len parameter from fit_get_name()
Remove the unused third parameter (len) from fit_get_name(). All uses of
this function pass NULL for this parameter.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-11-19 19:37:40 -07:00
Simon Glass
daf122806e tools: Fix debug() to avoid unused-variable warnings
The debug() macro in mkimage.h expands to nothing when MKIMAGE_DEBUG
is not defined. This causes the compiler to warn about unused variables
that are only referenced in debug() statements.

Fix this using the same approach as the debug_cond() macro.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-11-18 17:02:33 -07:00
Simon Glass
561a7efe58 docker: Add cryptsetup package for LUKS testing
Add cryptsetup to the CI Docker image to enable LUKS encryption tests.
This is needed to create test images.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-24 10:06:04 +01:00
Simon Glass
08dccb40fe docker: Provide a rust toolchain
Install a Rust toolchain in the CI image so that it is possible to build
the Rust examples.

Co-developed-by: Claude <noreply@anthropic.com>
Co-developed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-11 12:51:48 -06:00
Tom Rini
a4001909a8 CI: Update to coreboot 25.03
At this point there's problems rebuilding coreboot-24.08 without manual
intervention. Let us upgrade to a newer version.

Signed-off-by: Tom Rini <trini@konsulko.com>
2025-09-11 12:51:47 -06:00
Simon Glass
3d1982a7a1 u_boot_pylib: Correct docs for run_test_coverage() required
This should be a set, not a list. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-08 12:16:38 -06:00
Simon Glass
b5fb7fefe8 lib: Rename gen_v5_guid() to indicate it is little-endian
Normally v5 GUIDs are big-endian, so rename this function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-04 07:08:24 -06:00
Simon Glass
c3b2c14731 patman: Support autolink when some series are archived
Archived series currently cause an error when autolink is attempted. Add
a check to avoid this.

Series-to: u-boot
Signed-off-by: Simon Glass <sjg@chromium.org>
Series-links: 1:458284
2025-08-20 09:54:41 -06:00
Simon Glass
12a20d3122 patman: Correct parsing of branch names
The name 'x86a' must be parsed as a branch name, not as versio 86 of
branch 'x'. Correct the regex and add a test for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 09:54:41 -06:00
Simon Glass
a9ea16e399 patman: Allow using the first commit as series description
Sometimes series don't have a cover letter. Add a --use-commit option to
easily use the first commit's subject instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 09:54:41 -06:00
Simon Glass
e26ea124fb patman: Allow showing progress on archived series
Sometimes it is useful to include archived series in the progress report
so you can see all the work completed. Add a flag for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 09:54:41 -06:00
Simon Glass
16667556bd patman: Allow listing archived series
Sometimes it is useful to include archived series in the listing so you
can see which series could potentially be unarchived. Add a flag for
this.

Add a --include-archived option to the 'series ls' command for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 09:54:41 -06:00
Simon Glass
da1cdaf278 patman: Move split_name_version to patchstream
This function is needed by 'patman status', meaning that it must import
cser_helper which needs pygit2

Move it to patchstream so that pygit2 is not needed for the
'patman status' command.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 09:54:41 -06:00
Simon Glass
abb8470f86 patman: Avoid needing pygit2 for all subcommands
If pygit2 does not exist, patman refuses to work at all, but most
subcommands don't need it. Move the imports to resolve this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 09:54:41 -06:00
Simon Glass
85d560becc dtoc: Add a test for the fdt_util.EnsureCompiled with indir
Provide a test which covers this feature of the EnsureCompiled()
function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 07:41:19 -06:00
Simon Glass
da2183fd74 buildman: Handle CROSS_COMPILE being in the environment
If CROSS_COMPILE is set in the environment passed to buildman,
testMakeEnvironment() fails. Fix this by removing the variable before
starting the test.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 07:41:19 -06:00
Simon Glass
23be77e922 buildman: Handle CPP being in the environment
If CPP is set (e.g. to 'gcc -E') buildman currently gives an error. Add
a little more logic to handle this case.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 07:41:19 -06:00
Simon Glass
e5d9997361 buildman: Fix pylint warning in test_skip_dtc()
Use a different variable to avoid overriding the toolchain module in
this function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 07:41:19 -06:00
Simon Glass
70d8a8b985 buildman: Deal with DTC in environemnt in test_skip_dtc()
If DTC happens to be set in the environment provided to buildman itself,
this test currently fails. Fix it by removing any DTC variable before
starting the test.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 07:41:19 -06:00
Simon Glass
5e8b30cd4c patman: Handle invalid characters in patch files
In some cases latin1 encoding may be used in source files. If
'high-ascii' are used, patman may report an error:

   UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf3 in
      position 1051: invalid continuation byte

Fix this by replacing these characters. This may cause the patch to fail
to apply, but at least it can be checked.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 07:41:19 -06:00
Simon Glass
f387937b46 patman: Drop hard-coded patchwork server
Since there is now a new server at patchwork.u-boot.org allow using this
if selected in the ~/.patman file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 07:41:17 -06:00
Simon Glass
812c9f2a20 mkimage: Set the timestamp with -f auto
When creating a FIT, ensure that a timestamp is added, even if there is
no OS image present.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 14:39:59 -06:00
Simon Glass
037a9c0b7f mkimage: Support a load-only FIT
Support creation of a load-only FIT (where there is no OS), with a new
--load-only option. Allow FITs to be created without an OS image.

Update the auto-generated FIT description to make this clear.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 14:39:59 -06:00
Simon Glass
449c65e028 mkimage: Add compatible strings to configuration node
When using '-f auto', mkimage automatically creates a FIT given the
images. For devicetree files, FIT expects that the compatible string
from each is copied to its corresponding configuration node.

Implement this in mkimage, so far only for uncompressed devicetrees.

This requires a few more fields in struct content_info, so take this
opportunity to comment it properly.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 14:39:59 -06:00
Simon Glass
b600baba39 mkimage: Remove an unused argument from fdt_property_file()
This function does not actually use the 'name' argument. Drop it and use
FIT_DATA_PROP instead, to avoid confusion.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 14:39:59 -06:00
Simon Glass
d8faec6cbf buildman: Support building an extended board
Adjust the build logic to automatically deal with adding config
fragments to an existing board, to fully support the -X option.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 19:37:20 +00:00
Simon Glass
4f10b36306 buildman: Add a option to include extended boards
Provide a new -X option which uses any available .buildman files to
augment the list of boards supported by U-Boot with 'extended boards',
which consist of a base board with one or more config fragments.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 19:37:20 +00:00
Simon Glass
f1f83b0097 qconfig: Allow buildman to obtain the qconfig database
Provided a convenient function for buildman to use, which builds the
database if needed, then returns it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 19:37:20 +00:00
Simon Glass
b9c322c2d7 qconfig: Document cmdline args used by some functions
It might better to use separate arguments for each item, but for now,
document which args are used by Slot, Slots and move_config()

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 19:37:20 +00:00
Simon Glass
c3cab1a459 qconfig: Drop args from KconfigParser
This class does not actually use the program arguments, so don't pass
them in.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 19:37:20 +00:00
Simon Glass
4af4293392 qconfig: Rename do_build_db()
This function does not actually build the database; it just adds a board
to the datbase. Rename it to do_add_to_db() to reflect that.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 19:37:20 +00:00
Simon Glass
833474ba87 qconfig: Refactor to allow buildman to read the database
The qconfig tool has the ability to search for CONFIGs used by boards.
Refactor the code slightly so that buildman obtain the database.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 19:37:20 +00:00
Simon Glass
fa8c24964b buildman: Add a parser for the extended-board file
We wish to support .buildman files in the config/ directory which can
associate boards with config fragments. Add a parser for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 19:37:20 +00:00
Simon Glass
d97dc10ebf buildman: Document the format for extended boards
It has become more common to use config fragments to extend or adjust
the functionality of boards in U-Boot.

Add some documentation for how to use this with buildman.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 19:37:20 +00:00
Heinrich Schuchardt
dc239a4337 doc/buildman: describe using fragments
Describe the new --fragments parameter

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-08-04 19:37:20 +00:00
Heinrich Schuchardt
831836a2ab buildman: unit test for configuration fragments
Check that configuration fragments provided to buildman as comma-
separated list are passed on to the make command of the builder.

In the %_defconfig: target of scripts/kconfig/Makefile the defconfig
file and the fragments are combined via the gcc preprocessor.
Modeling this step in the buildman testbench without invoking the actual
Makefile would not provide better test coverage.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-08-04 19:37:20 +00:00
Heinrich Schuchardt
bac714eb96 buildman: allow specifying configuration fragments
Currently we are no able to build with configuration fragments in our CI.
With this patch buildman gets a new argument --fragments for passing a
comma-separated list of configuration fragments to add to the board
defconfigs, e.g.

    tools/buildman/buildman \
    -o build \
    -k qemu-riscv64_smode \
    --fragments acpi.config

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-08-04 19:37:20 +00:00
Simon Glass
684fc8c4d7 Revert "Merge branch 'loadg' into 'master'"
This reverts merge request !141
2025-08-02 19:50:30 +00:00
Simon Glass
73aeba7470 mkimage: Set the timestamp with -f auto
When creating a FIT, ensure that a timestamp is added, even if there is
no OS image present.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-02 12:29:34 -06:00
Simon Glass
12ad621926 mkimage: Support a load-only FIT
Support creation of a load-only FIT (where there is no OS), with a new
--load-only option. Allow FITs to be created without an OS image.

Update the auto-generated FIT description to make this clear.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-02 12:29:34 -06:00
Simon Glass
0c6a7180dd mkimage: Add compatible strings to configuration node
When using '-f auto', mkimage automatically creates a FIT given the
images. For devicetree files, FIT expects that the compatible string
from each is copied to its corresponding configuration node.

Implement this in mkimage, so far only for uncompressed devicetrees.

This requires a few more fields in struct content_info, so take this
opportunity to comment it properly.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-02 12:29:34 -06:00
Simon Glass
1049284b49 mkimage: Remove an unused argument from fdt_property_file()
This function does not actually use the 'name' argument. Drop it and use
FIT_DATA_PROP instead, to avoid confusion.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-02 12:29:34 -06:00
Simon Glass
25cf278d2c Revert "tools: fit_image: Add the loadable property to configs"
This is not correct when building a kernel FIT, since it adds a second
loadable in addition to the kernel.

There may in fact be a bug in SPL FIT, in which case that should be
fixed, rather than adding an invalid loadable to the FIT.

This reverts commit cabde449b9.

Series-to: concept
Series-cc: heinrich
Cover-letter:
mkimage: Start to tidy up mkimage and friends
The current mkimage code is a bit messy:

- the main() function is very long
- two similarly named structs are used throughout: the first
  (struct image_tool_params) is not actually just parameters, the second
  (struct image_type_params) is confusingly similar
- quite a bit of FIT processing happens right at the start of main(),
  which can be hard to follow
- the program calls exit() from many different places

This series renames the main structures, avoiding using the common
'params' word. It breaks up part of main() into separate functions and
starts the process of exiting in one place.

It also reverts a patch which causes an invalid 'loadables' property to
be added with '-f auto'.

More remains to be done, but this is a start.
END
2025-08-01 16:01:23 +12:00
Simon Glass
b7881d1cbf mkimage: Move the list-or-process code into a function
For listing an image, or processing an existing FIT, an initial code
path is used, then the program exits.

Move this into its own function so it is clear that this is an
early-return path.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-01 13:43:31 +12:00
Simon Glass
359baec777 mkimage: Split out file-opening into its own function
Add a new open_image() function to handle the initial opening of the
output file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-01 13:20:50 +12:00
Simon Glass
f684570439 mkimage: Split out initial checking and processing
The run_mkimage() function is long and complicated. Make a start by
moving some initial checks out into their own check_params() function.
Also move the FIT-processing into a new process_fit() function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-01 13:20:50 +12:00