summaryrefslogtreecommitdiff
path: root/tools/binman/test
AgeCommit message (Collapse)Author
2024-12-19tools: binman: etype: Allow to replace 'NAME' in node namesPaul HENRYS
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 <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2024-12-19tools: binman: Add tests for FIT with data encrypted by mkimagePaul HENRYS
Test the property 'fit,encrypt' to encrypt FIT data. Signed-off-by: Paul HENRYS <[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-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: 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-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-03binman: Support an assumed size for missing binariesSimon Glass
Binman has a the useful feature of handling missing external blobs gracefully, including allowing them to be missing, deciding whether the resulting image is functional or not and faking blobs when this is necessary for particular tools (e.g. mkimage). This feature is widely used in CI. One drawback is that if U-Boot grows too large to fit along with the required blobs, then this is not discovered until someone does a 'real' build which includes the blobs. Add a 'assume-size' property to entries to allow Binman to reserve a given size for missing external blobs. Signed-off-by: Simon Glass <[email protected]>
2024-01-18tools: binman: ti_board_cfg: Check for linting problemsNeha Malcom Francis
Use yamllint for checking whether YAML configuration files are adhering to default yamllint rules. Signed-off-by: Neha Malcom Francis <[email protected]> Suggested-by: Nishanth Menon <[email protected]>
2024-01-04binman: ftest: Add test for ti-secure firewall nodeManorit Chawdhry
Add test for TI firewalling node in ti-secure. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Manorit Chawdhry <[email protected]>
2023-12-13binman: etype: dm: Add entry type for TI DMNeha Malcom Francis
K3 devices introduces the concept of centralized power, resource and security management to System Firmware. This is to overcome challenges by the traditional approach that implements system control functions on each of the processing units. The software interface for System Firmware is split into TIFS and DM. DM (Device Manager) is responsible for resource and power management from secure and non-secure hosts. This additional binary is necessary for specific platforms' ROM boot images and is to be packaged into tispl.bin Add an entry for DM. The entry can be used for the packaging of tispl.bin by binman along with ATF and TEE. Signed-off-by: Neha Malcom Francis <[email protected]> Reviewed-by: Andrew Davis <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-11-02binman: openssl: x509: ti_secure_rom: Add support for bootcore_optsNeha Malcom Francis
According to the TRMs of K3 platform of devices, the ROM boot image format specifies a "Core Options Field" that provides the capability to set the boot core in lockstep when set to 0 or to split mode when set to 2. Add support for providing the same from the binman DTS. Also modify existing test case for ensuring future coverage. Signed-off-by: Neha Malcom Francis <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-10-13binman: capsule: Add support for generating EFI empty capsulesSughosh Ganu
Add support in binman for generating EFI empty capsules. These capsules are used in the FWU A/B update feature. Also add test cases in binman for the corresponding code coverage. Signed-off-by: Sughosh Ganu <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-10-13binman: capsule: Remove superfluous [address, size]-cells propertiesSughosh Ganu
The #address-cells and #size-cells are not needed for running the capsule generation binman tests. Remove the superfluous properties. Signed-off-by: Sughosh Ganu <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-08-29binman: capsule: Add support for generating EFI capsulesSughosh Ganu
Add support in binman for generating EFI capsules. The capsule parameters can be specified through the capsule binman entry. Also add test cases in binman for testing capsule generation. Signed-off-by: Sughosh Ganu <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-08-05binman: ftest: Add test for xilinx-bootgen etypeLukas Funke
Add test for the 'xilinx-bootgen' etype Signed-off-by: Lukas Funke <[email protected]> Reviewed-by: Simon Glass <[email protected]> Allow missing bootgen tool; comment testXilinxBootgenMissing() comment: Signed-off-by: Simon Glass <[email protected]>
2023-08-05binman: Renumber 291 and 292 test filesSimon Glass
These have ended up with the same numbers as earlier files. Fix them. Signed-off-by: Simon Glass <[email protected]>
2023-08-02binman: Support templates containing phandlesSimon Glass
This provides support for phandles to be copied over from templates. This is not quite safe, since if the template is instantiated twice (i.e. in two different nodes), then duplicate phandles will be found. This will result in an error. Signed-off-by: Simon Glass <[email protected]>
2023-08-02binman: Override CheckOptional in fit entryJonas Karlman
Missing optional blobs was not reported for generated entries, e.g. tee-os on rockchip targets. Implement a CheckOptional to fix this. After this the following can be shown: Image 'simple-bin' is missing optional external blobs but is still functional: tee-os /binman/simple-bin/fit/images/@tee-SEQ/tee-os (tee-os): See the documentation for your board. You may need to build Open Portable Trusted Execution Environment (OP-TEE) and build with TEE=/path/to/tee.bin Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-07-24binman: ftest: Add test for u_boot_spl_pubkey_dtbLukas Funke
Add test for u_boot_spl_pubkey_dtb. The test adds a public key to the dtb and checks if the required nodes will be added to the images dtb. Signed-off-by: Lukas Funke <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-07-24binman: Add tests for etype encryptedChristian Taedcke
Add tests to reach 100% code coverage for the added etype encrypted. Signed-off-by: Christian Taedcke <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-07-24binman: Renumber 277...289 TI test filesSimon Glass
These have ended up with the same numbers as earlier files. Fix them. Signed-off-by: Simon Glass <[email protected]>
2023-07-24binman: Renumber 277_rockchip and 278_mkimage test filesSimon Glass
These have ended up with the same numbers as earlier files. Fix them. Signed-off-by: Simon Glass <[email protected]>
2023-07-24binman: Tidy up tests for pre-load entry typeSimon Glass
Drop the use of a numbered key file since numbering is just for the test devicetree files. Also adjust the tests to avoid putting a hard-coded path to binman in the file, using the entry arg instead. Signed-off-by: Simon Glass <[email protected]>
2023-07-21binman: ti-secure: Add support for TI signingNeha Malcom Francis
The ti-secure entry contains certificate for binaries that will be loaded or booted by system firmware whereas the ti-secure-rom entry contains certificate for binaries that will be booted by ROM. Support for both these types of certificates is necessary for booting of K3 devices. Reviewed-by: Simon Glass <[email protected]> [[email protected]: fixed inconsist cert generation by multiple packing] Signed-off-by: Vignesh Raghavendra <[email protected]> Signed-off-by: Neha Malcom Francis <[email protected]>
2023-07-21binman: ti-board-config: Add support for TI board config binariesNeha Malcom Francis
The ti-board-config entry loads and validates a given YAML config file against a given schema, and generates the board config binary. K3 devices require these binaries to be packed into the final system firmware images. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Neha Malcom Francis <[email protected]>
2023-07-20binman: Support writing symbols inside a mkimage imageSimon Glass
Add support for writing symbols and determining the assumed position of binaries inside a mkimage image. This is useful as an example for other entry types which might want to do the same thing. Signed-off-by: Simon Glass <[email protected]>
2023-07-20binman: Support templates at any levelSimon Glass
Allow templates to be used inside a section, not just in the top-level /binman node. Signed-off-by: Simon Glass <[email protected]>
2023-07-20binman: Add a test for templating in a FITSimon Glass
Add this as a separate test case. Signed-off-by: Simon Glass <[email protected]>
2023-07-20binman: Support templating with multiple imagesSimon Glass
Allow a template to appear in the top level description when using multiple images. Signed-off-by: Simon Glass <[email protected]>
2023-07-20binman: Support simple templatesSimon Glass
Collections can used to collect the contents of other entries into a single entry, but they result in a single entry, with the original entries 'left behind' in their old place. It is useful to be able to specific a set of entries ones and have it used in multiple images, or parts of an image. Implement this mechanism. Signed-off-by: Simon Glass <[email protected]>
2023-07-20binman: Correct handling of zero bss sizeSimon Glass
Fix the check for the __bss_size symbol, since it may be 0. Unfortunately there was no test coverage for this. Signed-off-by: Simon Glass <[email protected]>
2023-07-20binman: Drop __bss_size variable in bss_data.cSimon Glass
This is not needed since the linker script sets it up. Drop the variable to avoid confusion. Fix the prototype for main() while we are here. Signed-off-by: Simon Glass <[email protected]>
2023-07-20binman: Provide a way to specify the fdt-list directlySimon Glass
Sometimes multiple boards are built with binman and it is useful to specify a different FDT list for each. At present this is not possible without providing multiple values of the of-list entryarg (which is not supported in the U-Boot build system). Allow a fit,fdt-list-val string-list property to be used instead. Signed-off-by: Simon Glass <[email protected]>
2023-07-20binman: Convert mkimage to Entry_sectionMarek Vasut
This is needed to handle mkimage with inner section located itself in a section. Signed-off-by: Marek Vasut <[email protected]> Use BuildSectionData() instead of ObtainContents(), add tests and a few other minor fixes: Signed-off-by: Simon Glass <[email protected]>
2023-07-20binman: Allow disabling symbol writingSimon Glass
Some boards don't use symbol writing but do access the symbols in SPL. Provide an option to work around this. Signed-off-by: Simon Glass <[email protected]>
2023-04-28binman: Use unsigned long over typedef ulongAndrew Davis
The header binman_sym.h depends on ulong typedef but does not include types.h. This means the header must be included after including types.h or a header that includes it. We could include types.h but instead let's just switch from ulong to directly using unsigned long. This removes the need for typedef'ing it in some of the tests, so also remove those. Signed-off-by: Andrew Davis <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-03-16Merge tag 'dm-next-12mar23a' of git://git.denx.de/u-boot-dm into nextTom Rini
More tests and fixes for fdt command binman signing feature fix buildman -A bug introduced recently Signed-off-by: Tom Rini <[email protected]>
2023-03-14binman: add tests for sign optionIvan Mikhaylov
Add the test which provides sequence of actions: 1. create the image from binman dts 2. create public and private keys 3. add public key into dtb with fdt_add_pubkey 4. 1. sign FIT container with new sign option with extracting from image 2. sign exact FIT container with replacing of it in image 5. check with fit_check_sign Signed-off-by: Ivan Mikhaylov <[email protected]> Renumber test file from 277 to 280; Move UpdateSignatures() to Entry base class; Don't allow missing mkimage as it doesn't make sense; Propagate --toolpath for CI; Call mark_build_done() to avoid regenerating FIT: Signed-off-by: Simon Glass <[email protected]>
2023-03-14Merge tag 'v2023.04-rc4' into nextTom Rini
Prepare v2023.04-rc4 Signed-off-by: Tom Rini <[email protected]>
2023-03-08binman: Support generation of x509 certificatesSimon Glass
And a new entry type which supports generation of x509 certificates. This uses a new 'openssl' btool with just one operation so far. Signed-off-by: Simon Glass <[email protected]>
2023-03-08binman: Support updating section contentsSimon Glass
Implement this feature since it is useful for updating FITs within an image. Signed-off-by: Simon Glass <[email protected]>
2023-03-08binman: Support marking FMAP areas as preservedSimon Glass
Add an entry flag called 'preserve' to indicate that an entry should be preserved by firmware updates. Propagate this to FMAP too. Signed-off-by: Simon Glass <[email protected]>
2023-02-28binman: Mark mkimage entry missing when its subnodes is missingJonas Karlman
Using the mkimage entry with the multiple-data-files prop and having a missing external blob result in an unexpected ValueError exception using the --allow-missing flag. ValueError: Filename 'missing.bin' not found in input path (...) Fix this by using _pathname that is resolved by ObtainContents for blob entries, ObtainContents also handles allow missing for external blobs. Mark mkimage entry as missing and return without running mkimage when missing entries is reported by CheckMissing. Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2023-02-28binman: Add support for a rockchip-tpl entryJonas Karlman
The rockchip-tpl entry can be used when an external TPL binary should be used instead of the normal U-Boot TPL. Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Kever Yang <[email protected]> Tested-by: Eugen Hristev <[email protected]>
2023-01-26binman: Fix a test-coverage regressionSimon Glass
Unfortunately a recent patch snuck through without the require test coverage. Fix it. Signed-off-by: Simon Glass <[email protected]> Fixes: 571bc4e67d3 ("binman: Support positioning an entry by and ELF symbol")
2023-01-26binman: Add 'min-size' entry propertySamuel Holland
This property sets the minimum size of an entry, including padding but not alignment. It can be used to reserve space for growth of an entry, or to enforce a minimum offset for later entries in the section. Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Simon Glass <[email protected]>