aboutsummaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'v2024.10-rc5' into nextTom Rini2024-09-162-2/+2
|\ | | | | | | Prepare v2024.10-rc5
| * binman: Update links for sending patchesTom Rini2024-09-122-2/+2
| | | | | | | | | | | | | | When linking to our documentation for submitting patches, we shouldn't point at the old wiki but instead our current documentation. Signed-off-by: Tom Rini <trini@konsulko.com>
* | tools: mkeficapsule: support generating dynamic GUIDsCaleb Connolly2024-09-121-5/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | Add support for generating GUIDs that match those generated internally by U-Boot for capsule update fw_images when using dynamic UUIDs. Dynamic UUIDs in U-Boot work by taking a namespace UUID and hashing it with the board compatible and fw_image name. This feature just provides a way to determine the UUIDs for a particular board without having to actually boot U-Boot on it. Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
* | tools: mkeficapsule: use u-boot UUID libraryCaleb Connolly2024-09-122-51/+9
| | | | | | | | | | | | | | Replace the use of libuuid with U-Boot's own UUID library. This prepares us to add support for generating v5 GUIDs. Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
* | sandbox: switch to dynamic UUIDsCaleb Connolly2024-09-122-2/+2
| | | | | | | | | | | | | | | | | | Migrate sandbox over to generating it's capsule update image GUIDs dynamically from the namespace and board/image info. Update the reference and tests to use the new GUIDs. Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
* | efi: define struct efi_guidCaleb Connolly2024-09-121-1/+1
| | | | | | | | | | | | | | | | This let's us forward declare efi_guid_t in the UUID code without pulling in efi.h Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
* | buildman: Support building within a Python venvWIP/06Sep2024-nextSimon Glass2024-09-063-4/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Python virtualenv tool sets up a few things in the environment, putting its path first in the PATH environment variable and setting up a sys.prefix different from the sys.base_prefix value. At present buildman puts the toolchain path first in PATH so that it can be found easily during the build. For sandbox this causes problems since /usr/bin/gcc (for example) results in '/usr/bin' being prepended to the PATH variable. As a result, the venv is partially disabled. The result is that sandbox builds within a venv ignore the venv, e.g. when looking for packages. Correct this by detecting the venv and adding the toolchain path after the venv path. Signed-off-by: Simon Glass <sjg@chromium.org>
* | Merge tag 'v2024.10-rc4' into nextTom Rini2024-09-025-9/+10
|\| | | | | | | Prepare v2024.10-rc4
| * qconfig: Fix an incorrect format-string with negative valueSimon Glass2024-09-011-1/+1
| | | | | | | | | | | | | | | | This is not allowed, so use ljust() instead. This fixes the 'qconfig -i -I help' command. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: 1bd43060b3e ("moveconfig: Use f strings where possible")
| * patman: Resolve python string vs. regex escaping syntaxBrian Norris2024-09-012-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Python strings have their own notion of backslash-escaping, and that can conflict with the intentions for strings passed to the 're' module. In particular, I get warnings like this: tools/patman/../patman/commit.py:9: SyntaxWarning: invalid escape sequence '\s' re_subject_tag = re.compile('([^:\s]*):\s*(.*)') We should use a raw string (r'...') so that all escaping is passed into the regex module, not interpreted within the string itself. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * tools/mkeficapsule: correct printf codesHeinrich Schuchardt2024-08-241-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | uint64_t is defined as unsigned long long on 32-bit ARM. Use PRIX64 for printing uint64_t. This avoid a build failure on 32-bit systems: tools/mkeficapsule.c: In function 'dump_capsule_auth_header': tools/mkeficapsule.c:694:66: warning: format '%lX' expects argument of type 'long unsigned int', but argument 2 has type 'uint64_t' {aka 'long long unsigned int'} [-Wformat=] 694 | printf("EFI_FIRMWARE_IMAGE_AUTH.MONOTONIC_COUNT\t\t: %08lX\n", | ~~~~^ | | | long unsigned int | %08llX Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
| * CI: Update to latest DockerfileWIP/21Aug2024Tom Rini2024-08-211-1/+1
| | | | | | | | | | | | This primarily updates our python cache. Signed-off-by: Tom Rini <trini@konsulko.com>
| * Dockerfile: Update to namespace for some labelsTom Rini2024-08-211-2/+2
| | | | | | | | | | | | | | | | Using "MAINTAINER" and "Description" have been replaced with org.opencontainers.image namespace variables. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
* | tools/scripts/Kconfig: Update references from kconfig-language.txt to rstHiago De Franco2024-08-271-5/+5
| | | | | | | | | | | | | | | | The Linux kernel documentation has transitioned from using kconfig-language.txt to kconfig-language.rst. Therefore update all occurrences of kconfig-language.txt. Signed-off-by: Hiago De Franco <hiago.franco@toradex.com>
* | buildman: Make test_process_limit handle time.monotonic()Simon Glass2024-08-261-0/+1
|/ | | | | | | | | | Newer versions of filelock use time.monotonic() instead of time.time(). Update the test the handle this. It would be better if filelock had support for writing unit tests which use locking. Signed-off-by: Simon Glass <sjg@chromium.org>
* tools: imx8image: add upower image supportGary Bisson2024-08-131-0/+5
| | | | | | | | | | | | Part of the upower management was included in a previous commit [1]. This patch only adds the bits required to properly parse a config file that would include the binary as follows: IMAGE PWR upower.bin [1] 6ec65c8558f (tools: image: support i.MX93) Signed-off-by: Gary Bisson <bisson.gary@gmail.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
* tools: imx8image: fix soc variable for ULPGary Bisson2024-08-131-1/+1
| | | | | | | | | | | | Currently the ULP token sets the soc as IMX9, making it impossible to differentiate the two families of processors. However, since the 8ULP requires specific binaries like upower which do not exist in 93, they need to be separated. Fixes: 6ec65c8558f (tools: image: support i.MX93) Signed-off-by: Gary Bisson <bisson.gary@gmail.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
* Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxiWIP/06Aug2024Tom Rini2024-08-061-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | This updates the "old style" DTs to that of Linux v6.10, matching what OF_UPSTREAM is at now. Hopefully we won't need to do this (manually) anymore. Since this brings in the DT for a new board (Tanix TX1), also add the defconfig for that, which has just been waiting for that sync. There are three more fixes: two for the SPI clock setup, which avoids too high frequencies in some cases, and one fix to avoid a build warning with GCC 14 for the sunxi TOC0 part of the mkimage tool. The gitlab CI passed, and I tested the SPI flash on the OrangePi Zero 3 and also booted that into Linux.
| * tools: imagetool: Remove unnecessary check from toc0_verify_cert_item()Seung-Woo Kim2024-08-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C99 introduced the possibility to mark function parameters declared as arrays with an extra keyword "static": void foo(uint8_t digest[static SHA256_DIGEST_LENGTH]); This requires the respective function argument to be at least as large as specified. Passing in random pointers (like NULL) then becomes undefined behaviour, and compilers warn about this. Newer GCC compilers (starting with GCC 14) will also automatically mark those parameters as "nonnull", and thus warn if a (redundant) NULL check is done inside the function: tools/sunxi_toc0.o tools/sunxi_toc0.c tools/sunxi_toc0.c: In function 'toc0_verify_cert_item': tools/sunxi_toc0.c:447:12: warning: 'nonnull' argument 'digest' compared to NULL [-Wnonnull-compare] 447 | if (digest && memcmp(&extension->digest, digest, SHA256_DIGEST_LENGTH)) { | ^ Remove the unnecessary NULL check from toc0_verify_cert_item(), to avoid the warning. Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Reviewed-by: Andre Przywara <andre.przywara@arm.com> [Andre: extend commit message] Signed-off-by: Andre Przywara <andre.przywara@arm.com>
* | binman: Keep the efi_capsule input fileSimon Glass2024-08-051-1/+0
| | | | | | | | | | | | | | | | | | | | There is no need to remove input files. It makes it harder to diagnose failures. Keep the payload file. There is no test for this condition, but one could be added. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Sughosh Ganu <sughosh.ganu@linaro.org>
* | binman: Return failure when a usage() message is generatedSimon Glass2024-08-051-1/+1
| | | | | | | | | | | | | | | | | | | | The tool must return an error code when invalid arguments are provided, otherwise binman has no way of knowing that anything went wrong. Correct this. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: fab430be2f4 ("tools: add mkeficapsule command for UEFI...")
* | binman: Deal with mkeficapsule being missingSimon Glass2024-08-051-0/+4
| | | | | | | | | | | | | | | | Tools cannot be assumed to be present. Add a check for this with the mkeficpasule tool. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: b617611b27a ("binman: capsule: Add support for generating...")
* | binman: Collect the version number for mkeficapsuleSimon Glass2024-08-051-1/+2
| | | | | | | | | | | | Now that this tool has a version number, collect it. Signed-off-by: Simon Glass <sjg@chromium.org>
* | mkeficapsule: Add a --version argumentSimon Glass2024-08-051-1/+7
|/ | | | | | | | Tools should have an option to obtain the version, so add this to the mkeficapsule tool. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
* tools: Add script to update git subtree projectsRaymond Mao2024-07-311-0/+85
| | | | | | | | | | | | | | | | | | | | Recently we are introducing multiple git subtree projects and it is the right time to have a universal script to update various subtrees and replace the dts/update-dts-subtree.sh. update-subtree.sh is a wrapper of git subtree commands. Usage: From U-Boot top directory, run $ ./tools/update-subtree.sh pull <subtree-name> <release-tag> for pulling a tag from the upstream. Or run $ ./tools/update-subtree.sh pick <subtree-name> <commit-id> for cherry-pick a commit from the upstream. Currently <subtree-name> supports dts, mbedtls and lwip. Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
* Makefile: Pass OF_SPL_REMOVE_PROPS to binmanSimon Glass2024-07-291-1/+2
| | | | | | | Pass CONFIG_OF_SPL_REMOVE_PROPS to binman so that it can remove properties correctly when producing FITs for SPL phases. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: fit: Allow running fdtgrep on devicetree blobsSimon Glass2024-07-295-5/+191
| | | | | | | | | | | | | | When using FIT to load firmware builds for multiple models, the FIT must include a common binary along with a number of devicetree blobs, one for each model. This is the same mechanism as is used for loading an OS. However, SPL builds do not normally use the full devicetree, but instead a cut-down version which various nodes and properties removed. Add a new fit,fdt-phase property to allow binman to produce these devicetree blobs. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: fit: Write the compatible string to configurationSimon Glass2024-07-294-7/+125
| | | | | | | | | | FIT allows the FDT's root-node compatible string to be placed in a configuration node to simplify and speed up finding the best match for booting. Add a new property to support this. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: fit: Allow providing FDT filenames in a directorySimon Glass2024-07-294-5/+96
| | | | | | | | In some cases the list of available FDT files is not available in an entryarg. Provide an option to point to a directory containing them instead. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Add support for alternative FDTsSimon Glass2024-07-2914-2/+507
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FIT provides a way to select between different devicetree blobs depending on the model. This works fine for U-Boot proper and allows SPL to select the correct blob for the current board at runtime. The boot sequence (SPL->U-Boot proper) is therefore covered by the existing feature set. The first boot phase (typically TPL) cannot use FIT since SoC boot ROMs don't currently support it. Therefore the TPL image must be specific to each model it boots on. To support booting on mulitple models, binman must therefore produce a separate TPL image for each model, even if the images for the rest of the phases are identical. TPL needs to be packaged as an executable binary along with a reduced devicetree. When multiple models are supported, a reduced devicetree must be provided for each model. U-Boot's build system is designed to build a single devicetree for SPL builds, so does not support this requirement. Add a new 'alternatives' feature to Binman, allowing it to automatically subset a devicetree to produce the reduced devicetree for a particular phase for each supported model. With this it is possible to produce a separate TPL image for each of the models. The correct one can then be loaded onto a board, along with the common FIT image(s). Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Allow entry types to override FDT contentsSimon Glass2024-07-293-2/+18
| | | | | | | | | | At present the contents of an FDT (for each phase) are fixed, determined by the build and provided to Binman as input files. Provide a means for entry types to provide their own FDT, so that it can be processed, if needed. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Remove dependency on pylibfdt for entry-docsSimon Glass2024-07-291-0/+7
| | | | | | | Allow the entry-docs command to operate even if pylibfdt is not present in the systemn. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Add a bintool for fdtgrepSimon Glass2024-07-292-0/+145
| | | | | | | Binman needs the ability to run fdtgrep to prepare devicetree subsets for use by SPL and TPL. Add a new bintool in preparation for this. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Correct indentation in testSplPubkeyDtbSimon Glass2024-07-291-21/+18
| | | | | | | | This function has strange indentation. Fix it. Fixes: 8c1fbd1f607 ("binman: ftest: Add test for u_boot_spl_pubkey_dtb") Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Fix a comment typo in _DoReadFileDtb()Simon Glass2024-07-291-1/+1
| | | | | | Fix a minor typo in this function. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Mention expanded entries in u-boot-vplSimon Glass2024-07-295-12/+10
| | | | | | | | Add a comment about this entry type being expanded, to match the comment for SPL and TPL. Drop an unwanted line in the SPL and TPL docs while here. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Correct comment in blob_dtb GetFdtEtype()Simon Glass2024-07-291-1/+3
| | | | | | The filenames are a bit confused. Fix them. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Write the compressed output to a fileSimon Glass2024-07-291-0/+3
| | | | | | | | When an entry is compressed, write the compressed contents to a file so that it is possible to see what was produced. This aids debugging with new images. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: elf: Add more debugging to LookupAndWriteSymbols()Simon Glass2024-07-291-1/+1
| | | | | | | When symbol-writing does not appear to work, it can sometimes be hard to figure out what is going on. Add some more debugging to help. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Move problem-checking code into a functionSimon Glass2024-07-291-32/+46
| | | | | | This has become quite long, so move it into a separate function. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Tidy up comment for Bintoolfdt_add_pubkey.run()Simon Glass2024-07-291-0/+4
| | | | | | This function returns a value, so add documentation for it. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Tidy up bintool docsSimon Glass2024-07-291-23/+38
| | | | | | | The docs have somehow got out of sync. Regenerate the file to fix the problem. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Correct an error in the FIT-template exampleSimon Glass2024-07-291-2/+2
| | | | | | The example contains references to an non-existent node. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
* qconfig: Support a 'list' formatSimon Glass2024-07-291-4/+10
| | | | | | | | | Add a flag to output the found list in a more user-friendly format, with one board per line. Omit the board count. This can be useful with grep, for example. Signed-off-by: Simon Glass <sjg@chromium.org>
* qconfig: Sort the boards by name when findingSimon Glass2024-07-291-1/+1
| | | | | | | | There is no particular ordering of the board list at present, since it is generated by a multi-threaded process. Sort them by name to make it easier to see if a particular board is present. Signed-off-by: Simon Glass <sjg@chromium.org>
* qconfig: Allow searching for CONFIG valuesSimon Glass2024-07-291-4/+11
| | | | | | | Add basic support for searching for matching of non-matching values. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/20
* buildman: Show board list with -xSimon Glass2024-07-261-1/+2
| | | | | | | | | | | When -x is used, buildman does not show the list of boards that will be built, since there are no terms which cause boards to be added, only terms which cause them to be removed. Add a special case to fix this. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Tom Rini <trini@konsulko.com>
* binman: Update cbfstoolSimon Glass2024-07-261-1/+2
| | | | | | | | Update to a newer version of this tool, 4.22.01. This runs OK with the current binman tests and matches the one in CI. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* tools: patman: fix `pip install` with Python 3.12Brandon Maier2024-07-261-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Installing patman with `cd ./tools/patman && pip install -e .` fails with the error below. As described in the error output below, the license line is not allowed to be only defined in the setup.py. We remove the 'license' field entirely, as the Python Packaging User Guide recommends using projects classifiers instead[1] and we already set the GPL-2.0+ classifier. > $ cd ./tools/patman && pip install -e . > Obtaining file:///.../u-boot/tools/patman > Installing build dependencies ... done > Checking if build backend supports build_editable ... done > Getting requirements to build editable ... error > error: subprocess-exited-with-error > > × Getting requirements to build editable did not run successfully. > │ exit code: 1 > ╰─> [61 lines of output] > /tmp/pip-build-env-mqjvnmz8/overlay/lib/python3.12/site-packages/setuptools/config/_apply_pyprojecttoml.py:76: > _MissingDynamic: `license` defined outside of `pyproject.toml` is ignored. > !! > > ******************************************************************************** > The following seems to be defined outside of `pyproject.toml`: > > `license = 'GPL-2.0+'` > > According to the spec (see the link below), however, setuptools CANNOT > consider this value unless `license` is listed as `dynamic`. > > https://packaging.python.org/en/latest/specifications/pyproject-toml/#declaring-project-metadata-the-project-table > > To prevent this problem, you can list `license` under `dynamic` or alternatively > remove the `[project]` table from your file and rely entirely on other means of > configuration. > ******************************************************************************** > > !! [1] https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license Signed-off-by: Brandon Maier <brandon.maier@collins.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* qconfig: Move operation check into parse_args()Simon Glass2024-07-261-6/+7
| | | | | | | Put the check for an operation being provided into the parse_args() function, to reduce the size of main(). Signed-off-by: Simon Glass <sjg@chromium.org>