Commit Graph

97152 Commits

Author SHA1 Message Date
Simon Glass
e6b8a50af2 membuff: Rename the files to membuf
Rename the C and header files to use the membuf basename, to match the
functions.

Add a MAINTAINERS entry while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-25 16:39:30 -07:00
Simon Glass
dcddf6aa83 membuff: Rename functions to have membuf_ prefix
The double 'f' is not necessary and is a bit annoying as elsewhere in
U-Boot we use 'buf'. Rename all the functions before it is used more
widely.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-25 16:39:19 -07:00
Simon Glass
813a785b1e Merge branch 'ci' into 'master'
Recent tools changes

See merge request u-boot/u-boot!49
2025-02-25 22:42:15 +00:00
Simon Glass
b06efead7f buildman: Update tests for newer filelock module
Recent versions of this module call time.perf_counter() so add a patch
for this also.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Tom Rini <trini@konsulko.com>
2025-02-25 14:21:52 -07:00
Simon Glass
257ba68762 u_boot_pylib: Move gitutil into the library
Move this file into U-Boot's Python library, so that it is no-longer
part of patman.

This makes a start on:

https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/35

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-25 14:21:52 -07:00
Paul HENRYS
09684f0fb8 tools: binman: etype: fit: Append DTB directory to the list of input directories
When specifying a directory containing DTBs with 'fit,fdt-list-dir', it can be
handy not to have to also specify this directory to the input directories of
binman with '-I' option and use the method tools.append_input_dirs() append it.
This avoids to have to specify the DTB directory in both the device tree
provided to binman and through '-I' option to binman.

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2025-02-25 14:21:52 -07:00
Paul HENRYS
3cadb7c73f tools: u_boot_pylib: Allow to append input directories to indir
append_input_dirs() can be used to append a list of input directories to indir
global list.

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2025-02-25 14:21:52 -07:00
Paul HENRYS
e21cf7db4a tools: binman: etype: Allow to replace 'NAME' in node names
This change allows to replace both 'SEQ' and 'NAME' keywords by respectively a
sequence number and the name of the FDT to provide more flexibility in the node
name for the device trees included in the FIT.

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2025-02-25 14:21:52 -07:00
Paul HENRYS
2e4bdac96c tools: binman: Pass a list of input directory to EnsureCompiled()
Input directories can be passed to binman using the '-I' option and those
input directories are now also passed to 'dtc' when run by binman.

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2025-02-25 14:21:52 -07:00
Paul HENRYS
12b34e8809 tools: dtoc: Allow passing optional input directories
An optional list of input directories can be passed to EnsureCompiled() which
allows to pass a list of directories where input files can be searched.

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2025-02-25 14:21:52 -07:00
Paul HENRYS
c1443cf90d tools: binman: Add tests for FIT with data encrypted by mkimage
Test the property 'fit,encrypt' to encrypt FIT data.

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
2025-02-25 14:21:52 -07:00
Paul HENRYS
76ff86f98d tools: binman: add 'fit, encrypt' property to pass keys directory to mkimage
mkimage can be used for both signing the FIT or encrypt its content and the
option '-k' can be used to pass a directory where both signing and encryption
keys can be retrieved. Adding 'fit,encrypt' property to the 'fit' node, leads to
try to find keys directory among binman include directories.
_get_priv_keys_dir() is renamed as _get_keys_dir() and adapted to support both
signing and encryption nodes in the FIT.

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2025-02-25 14:21:52 -07:00
Paul HENRYS
3c70ace95c aes: Allow to store randomly generated IV in the FIT
When the initialisation vector is randomly generated, its value shall be
stored in the FIT together with the encrypted data. The changes allow to
store the IV in the FIT also in the case where the key is not stored in
the DTB but retrieved somewhere else at runtime.

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2025-02-25 14:21:52 -07:00
Simon Glass
558aa24b46 Merge branch 'ci' into 'master'
tools: Update tools for 24.04

See merge request u-boot/u-boot!48
2025-02-25 19:45:33 +00:00
Tom Rini
915972962f Merge patch series "Add preload_check_sign tool"
Paul HENRYS <paul.henrys_ext@softathome.com> says:

This serie of patches adds a new tool to authenticate files signed
with a preload header.
This tool is also used in the tests to actually verify the
authenticity of the file signed with such a preload header.

Link: https://lore.kernel.org/r/20250212093126.3722186-1-paul.henrys_ext@softathome.com
2025-02-25 06:35:32 -07:00
Paul HENRYS
e79b61ff1a binman: Authenticate the image when testing the preload signature
Use preload_check_sign to authenticate the generated image when testing the
preload signature in testPreLoad().

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
2025-02-25 06:35:02 -07:00
Paul HENRYS
da2a53dffa configs: Enable the pre-load signature in tools-only_defconfig
pre-load related config options are enabled to have support of it in host
tools.

'CONFIG_FIT_SIGNATURE=y' is being automatically removed since it is
selected by CONFIG_IMAGE_PRE_LOAD_SIG.

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
2025-02-25 06:34:45 -07:00
Paul HENRYS
57beac9f8a tools: Add preload_check_sign to authenticate images with a pre-load
preload_check_sign is added so that it can be used to authenticate images
signed with the pre-load signature supported by binman and U-Boot.
It could also be used to test the signature in binman tests signing
images with the pre-load.

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
2025-02-25 06:34:22 -07:00
Paul HENRYS
22f76b1c17 boot: Add support of the pre-load signature for host tools
Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
2025-02-25 06:34:20 -07:00
Paul HENRYS
e32bb99667 image: Add an inline declaration of unmap_sysmem()
Add an empty inline declaration when compiling tools for a host where
unmap_sysmem() is not defined.

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
2025-02-25 06:34:17 -07:00
Paul HENRYS
42e0a88173 rsa: Add rsa_verify_openssl() to use openssl for host builds
rsa_verify_openssl() is used in lib/rsa/rsa-verify.c to authenticate data
when building host tools.

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
2025-02-25 06:34:16 -07:00
Tom Rini
d4492cca1f binman: Regenerate tools/binman/entries.rst
There have been a few changes to the areas that this file documents
without having regenerated the file. Do so now.

Signed-off-by: Tom Rini <trini@konsulko.com>
2025-02-25 06:33:57 -07:00
Lothar Rubusch
b749c5f674 doc: develop: Fix typos and wording in binman/binman.rst
Fix some typos and duplicate words in binman.rst.

Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2025-02-25 06:33:57 -07:00
Simon Glass
1b9bc2b2da tools: Fix pylint 3.3.4 errors
This newer pylint produces errors about variables possibly being used
before being set. Adjust the code to pass these checks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Tom Rini <trini@konsulko.com>
2025-02-25 06:33:57 -07:00
Tom Rini
54e20a5949 tools/patman: Don't call a non-existent suite
With a newer pylint we get a warning that gitutil.RunTests does not
exist, so remove the line.

Signed-off-by: Tom Rini <trini@konsulko.com>
2025-02-25 06:33:57 -07:00
Tom Rini
d69cb66ab3 tools: binman: ti_board_cfg: Fix pylint error over 'br'
With a newer pylint, we get a warning that 'br' could be used before
assignment. Fix this by declaring br first as an empty bytearray.

Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2025-02-25 06:33:57 -07:00
Tom Rini
736276478b binman: Switch to setuptools
With the distutils module having been removed with Python 3.12, switch
to using setuptools instead.

Signed-off-by: Tom Rini <trini@konsulko.com>
2025-02-25 06:33:57 -07:00
Tom Rini
2cc7b4e17b dtoc: Switch to setuptools
With the distutils module having been removed with Python 3.12, switch
to using setuptools instead.

Signed-off-by: Tom Rini <trini@konsulko.com>
2025-02-25 06:33:57 -07:00
Simon Glass
6625953401 Merge branch 'ci' into 'master'
test/py: Shorten u_boot_console

See merge request u-boot/u-boot!47
2025-02-17 12:52:58 +00:00
Simon Glass
63baa55106 test: Make net tests depend on CONFIG_CMD_NET
This fails on samus_tpl as there is no 'net' command.

   => net list
   Unknown command 'net' - try 'help' !

Fix it by adding a condition for the test.

Add a blank line to keep pylint happy.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-16 17:30:53 -07:00
Simon Glass
1be4babf14 test/py: Show info about module-loading
It is sometimes tricky to figure out what modules test.py is loading
when it starts up. The result can be a silent failure with no clue as to
what when wrong.

Add a section which lists the modules loaded as well as those not
found.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-16 17:30:53 -07:00
Simon Glass
8cb42bb814 test/py: Drop assigning ubman to cons
Now that we have a shorter name, we don't need this sort of thing. Just
use ubman instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-16 17:30:53 -07:00
Simon Glass
2ddab2962a test/py: Drop importing utils as util
Now that we have a shorter name, we don't need this sort of thing.
Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # test_android
2025-02-16 17:30:53 -07:00
Simon Glass
d428226459 test/py: Drop u_boot_ prefix on test files
We know this is U-Boot so the prefix serves no purpose other than to
make things longer and harder to read. Drop it and rename the files.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # test_android / test_dfu
2025-02-16 17:30:53 -07:00
Simon Glass
aa677583d3 test/py: Shorten u_boot_console
This fixture name is quite long and results in lots of verbose code.
We know this is U-Boot so the 'u_boot_' part is not necessary.

But it is also a bit of a misnomer, since it provides access to all the
information available to tests. It is not just the console.

It would be too confusing to use con as it would be confused with
config and it is probably too short.

So shorten it to 'ubman'.

Signed-off-by: Simon Glass <sjg@chromium.org>
Link: https://lore.kernel.org/u-boot/CAFLszTgPa4aT_J9h9pqeTtLCVn4x2JvLWRcWRD8NaN3uoSAtyA@mail.gmail.com/
2025-02-16 17:30:53 -07:00
Simon Glass
465f87f930 Merge branch 'ci' into 'master'
test: Complete the suite migration

See merge request u-boot/u-boot!45
2025-02-16 16:21:46 +00:00
Simon Glass
777c7a0c20 test: Update documentation
Update documentation for how to write tests and the 'ut' command.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-16 14:11:28 +00:00
Simon Glass
9fbcd63202 test: Do flag-processing in the correct place
At present the 'ut' command handles its flags in a strange way, in that
they must come after the subcommand.

So, we must use 'ut bloblist -r2' to run the bloblist tests twice. This
is an artefact of the way tests were run, through subcommands.

It is now possible to correct this, by doing flag-processing before
running the suite.

Update the code to handle this, so that 'ut -r2 bloblist' works. Update
the 'test_suite' test to check the new arguments.

Add a sanity-check for -I while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-16 14:11:28 +00:00
Simon Glass
cd9f15f9e9 test: Move code out of cmd_ut_category()
Move the logic from this function into run_suite(), on the way to having
flag parsing in the top-level 'ut' command instead of its children.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-16 14:11:28 +00:00
Simon Glass
816dce0f74 test: Allow running a selection of suites
Enhance the ut command to accept a comma-separated list of test suites
to run. Report the summary information for these at the end.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-16 14:11:28 +00:00
Simon Glass
9c7ef6c877 test: Drop suites.h
This file is empty now. Remove it and its uses.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-16 14:11:28 +00:00
Simon Glass
a0b8142de2 test: Make cmd_ut_category() static
This function is not used outside the cmd_ut file anymore, so make it
static.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-16 14:11:28 +00:00
Simon Glass
d4d0e85771 test: Drop support for test commands
Now that everything is using the new test-suite features, drop support
for running commands.

Fix a missing closing-bracket while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-16 14:11:28 +00:00
Simon Glass
9a1a4e58be test: Rename optee test-file
This has nothing to do with commands anymore, so rename the file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-16 14:11:28 +00:00
Simon Glass
6b352a1309 test: Drop the function for running optee tests
Use the new suite-runner to run these tests instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-16 14:11:28 +00:00
Simon Glass
0d22173a1c test: Split optee tests into three functions
These tests run three different checks on the nodes, but the logic is
currently all in one tests.

Split the code out into three different tests, which do different setup
and then run the same checks.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-16 14:11:28 +00:00
Simon Glass
b478e74732 test: Update optee to do init and uninit from tests
Rather than having an init function and then running the tests, create a
test-init function to do it. This will allow us to get rid of the
command function.

Fix the comment abotu 'environment' while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-16 14:11:28 +00:00
Simon Glass
c52b23fbda test: Drop the function for running bootstd tests
Use the new suite-runner to run these tests instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-16 14:11:28 +00:00
Simon Glass
54f97340e5 test: Update bootstd to do init from tests
Rather than having an init function and then running the tests, create a
test-init function to do it. This will allow us to get rid of the
command function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-16 14:11:28 +00:00
Simon Glass
b014146ee2 test: Drop the function for running fdt_overlay tests
Use the new suite-runner to run these tests instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-16 14:11:28 +00:00