summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2024-08-05binman: Return failure when a usage() message is generatedSimon Glass
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...")
2024-08-05binman: Deal with mkeficapsule being missingSimon Glass
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...")
2024-08-05binman: Collect the version number for mkeficapsuleSimon Glass
Now that this tool has a version number, collect it. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-05mkeficapsule: Add a --version argumentSimon Glass
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>
2024-07-31tools: Add script to update git subtree projectsRaymond Mao
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>
2024-07-29Makefile: Pass OF_SPL_REMOVE_PROPS to binmanSimon Glass
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>
2024-07-29binman: fit: Allow running fdtgrep on devicetree blobsSimon Glass
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>
2024-07-29binman: fit: Write the compatible string to configurationSimon Glass
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>
2024-07-29binman: fit: Allow providing FDT filenames in a directorySimon Glass
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>
2024-07-29binman: Add support for alternative FDTsSimon Glass
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>
2024-07-29binman: Allow entry types to override FDT contentsSimon Glass
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>
2024-07-29binman: Remove dependency on pylibfdt for entry-docsSimon Glass
Allow the entry-docs command to operate even if pylibfdt is not present in the systemn. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-29binman: Add a bintool for fdtgrepSimon Glass
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>
2024-07-29binman: Correct indentation in testSplPubkeyDtbSimon Glass
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>
2024-07-29binman: Fix a comment typo in _DoReadFileDtb()Simon Glass
Fix a minor typo in this function. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-29binman: Mention expanded entries in u-boot-vplSimon Glass
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>
2024-07-29binman: Correct comment in blob_dtb GetFdtEtype()Simon Glass
The filenames are a bit confused. Fix them. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-29binman: Write the compressed output to a fileSimon Glass
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>
2024-07-29binman: elf: Add more debugging to LookupAndWriteSymbols()Simon Glass
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>
2024-07-29binman: Move problem-checking code into a functionSimon Glass
This has become quite long, so move it into a separate function. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-29binman: Tidy up comment for Bintoolfdt_add_pubkey.run()Simon Glass
This function returns a value, so add documentation for it. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-29binman: Tidy up bintool docsSimon Glass
The docs have somehow got out of sync. Regenerate the file to fix the problem. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-29binman: Correct an error in the FIT-template exampleSimon Glass
The example contains references to an non-existent node. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-29qconfig: Support a 'list' formatSimon Glass
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>
2024-07-29qconfig: Sort the boards by name when findingSimon Glass
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>
2024-07-29qconfig: Allow searching for CONFIG valuesSimon Glass
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
2024-07-26buildman: Show board list with -xSimon Glass
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>
2024-07-26binman: Update cbfstoolSimon Glass
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>
2024-07-26tools: patman: fix `pip install` with Python 3.12Brandon Maier
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>
2024-07-26qconfig: Move operation check into parse_args()Simon Glass
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>
2024-07-26qconfig: Drop col argument from Slots()Simon Glass
This is not needed since the progress indicator has the object. Use that instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26qconfig: Use the Color object in ProgressSimon Glass
Since the Progress class has the required object, use it from there instead of passing it around. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26qconfig: Move the last two operations into their own functionsSimon Glass
Put the summary and database-writing code into separate functions to reduce the size of main(). Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26qconfig: Move progress output into the classSimon Glass
Rather than create these outputs separately, put them in the class so that the main program doesn't need to deal with them. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26qconfig: Move commit code into a separate functionSimon Glass
Reduce the size of main() by putting this code into its own function. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26qconfig: Move all move_config code into move_config()Simon Glass
Move the setup and completion code into the move_config() function so it is all in one place. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26qconfig: Add a return value to do_find_config()Simon Glass
Return an exit code so we can use this function like do_tests(). Refactor the caller to handle this. Reduce the size of main() by putting this code into its own function. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26qconfig: Move imply into a separate functionSimon Glass
Reduce the size of main() by putting this code into its own function, with the usage message staying in main(). Tidy up the comments for do_imply_config() while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26qconfig: Add a return value to do_scan_source()Simon Glass
Return an exit code so we can use this function like do_tests(). Refactor the caller to handle this. Reduce the size of main() by putting this code into its own function. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26qconfig: Move testing into a separate functionSimon Glass
Reduce the size of main() by putting this code into its own function. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26qconfig: Move converting config args to the topSimon Glass
Move this check to the top, so it happens always. There is no harm to doing this earlier and it separates the setup from actual program logic. Update the arg rather than adding a new variable, with the new variable only created when moving or building, since it is used more heavily. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26qconfig: Move checking directory to the topSimon Glass
Move this check to the top, so it happens always. The tool should be run from the U-Boot source directory. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26qconfig: Move getting the colour to where it is neededSimon Glass
Move this assignment down to just above where it is needed. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26qconfig: Move arg checking to the top of main()Simon Glass
Check for 'test' as one of the possible operations for this tool, moving the check above the implementation. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26qconfig: Move arg checking a little higherSimon Glass
Check for scan_source as one of the possible operations for this tool, moving the check above the scan_source implementation. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26qconfig: Move arg parsing into a separate functionSimon Glass
Reduce the size of main() by putting this code into its own function. For now the parser object needs to be returned too. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26qconfig: Rename the doc linkSimon Glass
This was missed during the renaming of the tool. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: ea4d6dead37 ("moveconfig: Rename the tool to qconfig")
2024-07-26qconfig: Correct format string in do_imply_config()Simon Glass
One of the strings was converted incorrectly. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: 1bd43060b3e ("moveconfig: Use f strings where possible")
2024-07-26qconfig: Tidy up some pylint warningsSimon Glass
Reduce the number of warnings in this file a little bit. Add my own name to the copyright message. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26qconfig: Make KconfigScanner a functionSimon Glass
This doesn't have any methods so is not good as a class. Make it a function instead, to keep pylint happy. Signed-off-by: Simon Glass <sjg@chromium.org>