summaryrefslogtreecommitdiff
path: root/tools/binman
AgeCommit message (Collapse)Author
2024-10-29imx: hab: fix size of IVT+CSF blob tacked on to u-boot.itbRasmus Villemoes
Loading flash.bin using uuu fails when flash.bin does not have the right size. When flash.bin is loaded from some storage medium (sd card/emmc), SPL just loads some random garbage bytes from beyond what has been populated when flash.bin was written, but when loaded via uuu, SPL hangs waiting for the host to send the expected number of bytes. Which is (size of FIT image aligned to 0x1000)+CONFIG_CSF_SIZE. The alignment to 0x1000 is already done and is necessary in all cases because that's the exact expected location of the 32 byte IVT header. But the IVT+CSF blob tacked onto the end must be a total of CONFIG_CSF_SIZE. This is exactly the same fix as 89f19f45d650, except that this time around I don't know how to cleanly get CONFIG_CSF_SIZE. Fixes: bc6beae7c55f (binman: Add nxp_imx8mcst etype for i.MX8M flash.bin signing) Signed-off-by: Rasmus Villemoes <[email protected]> Tested-by: Heiko Schocher <[email protected]>
2024-10-18binman: Add a tutorial on resolving test-coverage bugsSimon Glass
Provide a short description of how tests work, why they are so critical and how to resolve gaps in Binman's test coverage. Signed-off-by: Simon Glass <[email protected]> Acked-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]>
2024-10-18binman: Support getting test-coverage on just one testSimon Glass
Pass the arguments through to test_util so that a single test can be used. Update the docs and add some missing backquotes in the same section. Signed-off-by: Simon Glass <[email protected]>
2024-10-18binman: implement signing FIT images during image buildAlexander Kochetkov
The patch implement new property 'fit,sign' that can be declared at the top-level 'fit' node. If that option is declared, fit tryies to detect private keys directory among binman include directories. That directory than passed to mkimage using '-k' flag and that enable signing of FIT. Signed-off-by: Alexander Kochetkov <[email protected]> Reviewed-by: Simon Glass <[email protected]> Renumbered files, moved new tests to end: Signed-off-by: Simon Glass <[email protected]>
2024-10-18binman: fix passing loadables to mkimage on first runAlexander Kochetkov
FIT use mkimage from BuildSectionData() to build FIT entry contents. BuildSectionData() get called several times during building FIT image. Currently when fit inserts loadables, it use self._loadables property that contain loadables computed during previuos BuildSectionData() invocation. So for the first run it use empty list and pass no loadables to mkimage. That makes problem for adding signature to FIT image because mkimage fails to add signature and aborts building FIT if no loadables provided. The patch fixes described behaviour in a way that BuildSectionData() uses recently calculated loadables value, not previosly calculated. Signed-off-by: Alexander Kochetkov <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2024-10-13binman: add fast authentication method for i.MX8M signingBrian Ruley
Using the PKI tree with SRKs as intermediate CA isn't necessary or even desirable in some situations (boot time, for example). Add the possibility to use the "fast authentication" method where the image and CSF are both signed using the SRK [1, p.63]. [1] https://community.nxp.com/pwmxy87654/attachments/pwmxy87654/imx-processors/202591/1/CST_UG.pdf Signed-off-by: Brian Ruley <[email protected]> Cc: Marek Vasut <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2024-10-13binman: cosmetic: refactor `nxp_imx8mcst' etype codeBrian Ruley
Simplify code and conform to the style guide used in the project by making the following changes: * Capitalize global constants * Use single quotes for multiline strings (except docstrings) * Fix line width to 79 cols * Use f-string instead of formatting a regular string or using a complicated concatenation * Move common suffix used in keys to a global variable "KEY_NAME" to reduce the likelihood of typos and making future changes easier Signed-off-by: Brian Ruley <[email protected]> Cc: Marek Vasut <[email protected]>
2024-10-07Merge branch 'next'Tom Rini
2024-10-04Update directories for new name of TF-A directoriesPeter Robinson
The TF-A URL was updated, as a result the name of the directory changed as part of the new git URL and not all the referenced directories were updated. Fixes: 0ec0207fe07 ("Update the ARM trusted firmware git URL") Signed-off-by: Peter Robinson <[email protected]>
2024-10-03Update the ARM trusted firmware git URLPeter Robinson
The primary upstream URL for tf-a has moved, in some cases things like tags are not always pushed to the old URL so update the URLs to the primary upstream project URL. Signed-off-by: Peter Robinson <[email protected]>
2024-09-26binman: Make a start on an iMX8 testSimon Glass
This patch is for Marek, to provide a starting point. To try it, use 'binman test -T' and see the missing coverage. Signed-off-by: Simon Glass <[email protected]>
2024-09-26binman: Allow image_pos to be None when writing symbolsSimon Glass
Some images do not have an image_pos value, for example an image which is part of a compressed section and therefore cannot be accessed directly. Handle this case, returning None as the value. Signed-off-by: Simon Glass <[email protected]>
2024-09-26binman: Unwind the end-at-4gb special-case a littleSimon Glass
Move the check for this further out, so that base_addr is computed in Entry.WriteSymbols() rather than at lower levels. Signed-off-by: Simon Glass <[email protected]>
2024-09-26binman: Provide a way to set the symbol base addressSimon Glass
The base address of the ELF containing symbols is normally added to any symbols written, so that the value points to the correct address in memory when everything is loaded. When the binary resides on disk, a different offset may be needed, typically 0. Provide a way to specify this. Signed-off-by: Simon Glass <[email protected]>
2024-09-26binman: Add minor improvements to symbol-writingSimon Glass
Add a clarification to the documentation and add a missing comment. Also update the test so that when it fails it is easier to see what is going on, rather than having to decode hex strings. Signed-off-by: Simon Glass <[email protected]>
2024-09-26binman: Adjust naming for reading symbolsSimon Glass
These functions get the value of a symbol. The reference to ELF files is confusing since they are reading the position/size of entries, not ELF symbols. Rename the functions and adjust the comments also. Signed-off-by: Simon Glass <[email protected]>
2024-09-26binman: fit: Refine handling of devicetrees for OF_UPSTREAMSimon Glass
With OF_UPSTREAM the dts files are in an SoC-specific subdirectory, meaning that the resulting dtb files all end up in a similar subdirectory. We don't want the subdirectory name to appear as a node name in the FIT, so handle this as a special case. Also the default devicetree may have a directory-name prefix, so handle that when searching through the available devicetree files. Signed-off-by: Simon Glass <[email protected]>
2024-09-26binman: fit: Set the image_pos attributes only onceSimon Glass
The section etype has its own implementation of SetImagePos(), most of which is not useful since the code is included here. So call Entry.SetImagePos() which has the only piece of this which we actually want. Signed-off-by: Simon Glass <[email protected]>
2024-09-26binman: fit: Avoid assuming that a FIT member is a sectionSimon Glass
Use the more generic variable name 'entry' to avoid confusion. Signed-off-by: Simon Glass <[email protected]>
2024-09-26binman: Update fdt-list-dir to use the provided directorySimon Glass
Since the files are known to be in the provided directory, use that instead of requiring it to be added to the list of input directories. Signed-off-by: Simon Glass <[email protected]>
2024-09-26binman: Avoid setting the image_pos attribute directlySimon Glass
Two places set this attribute directly. Update them to use the function provided. Signed-off-by: Simon Glass <[email protected]>
2024-09-26binman: Tidy up comments and pylint warnings in fitSimon Glass
Update this entry type to resolve some pylint warnings and make sure that functions and members are fully commented. Signed-off-by: Simon Glass <[email protected]>
2024-09-26binman: Tidy up comments for Entry.GetEntryArgsOrProps()Simon Glass
Improve the comments for this function. Signed-off-by: Simon Glass <[email protected]>
2024-09-26binman: Correct the comment for fdtgrepSimon Glass
This returns stdout, not a CommandResult so update the comment. Signed-off-by: Simon Glass <[email protected]>
2024-09-26binman: Fix up test coverage for mkeficapsuleSimon Glass
Add tests for missing tools to complete the test coverage for this etype. Signed-off-by: Simon Glass <[email protected]>
2024-09-16Merge tag 'v2024.10-rc5' into nextTom Rini
Prepare v2024.10-rc5
2024-09-12binman: Update links for sending patchesTom Rini
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 <[email protected]>
2024-09-12sandbox: switch to dynamic UUIDsCaleb Connolly
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 <[email protected]> Signed-off-by: Caleb Connolly <[email protected]>
2024-08-05binman: Keep the efi_capsule input fileSimon Glass
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 <[email protected]> Acked-by: Sughosh Ganu <[email protected]>
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 <[email protected]> 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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
2024-07-29binman: Fix a comment typo in _DoReadFileDtb()Simon Glass
Fix a minor typo in this function. Signed-off-by: Simon Glass <[email protected]>
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 <[email protected]>
2024-07-29binman: Correct comment in blob_dtb GetFdtEtype()Simon Glass
The filenames are a bit confused. Fix them. Signed-off-by: Simon Glass <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]> Reviewed-by: Tom Rini <[email protected]>