aboutsummaryrefslogtreecommitdiff
path: root/tools/binman/ftest.py
AgeCommit message (Collapse)AuthorFilesLines
2024-01-18tools: binman: ti_board_cfg: Check for linting problemsNeha Malcom Francis1-0/+6
Use yamllint for checking whether YAML configuration files are adhering to default yamllint rules. Signed-off-by: Neha Malcom Francis <n-francis@ti.com> Suggested-by: Nishanth Menon <nm@ti.com>
2024-01-04Merge patch series "ATF and OP-TEE Firewalling for K3 devices."WIP/04Jan2024-nextTom Rini1-0/+23
Manorit Chawdhry <m-chawdhry@ti.com> says: K3 devices have firewalls that are used to prevent illegal accesses to memory regions that are deemed secure. The series prevents the illegal accesses to ATF and OP-TEE regions that are present in different K3 devices. AM62X, AM62AX and AM64X are currently in hold due to some firewall configurations that our System Controller (TIFS) needs to handle. The devices that are not configured with the firewalling nodes will not be affected and can continue to work fine until the firewall nodes are added so will be a non-blocking merge. Test Logs: https://gist.github.com/manorit2001/4cead2fb3a19eb5d19005b3f54682627 CICD Run: https://github.com/u-boot/u-boot/pull/442
2024-01-04binman: ftest: Add test for ti-secure firewall nodeManorit Chawdhry1-0/+23
Add test for TI firewalling node in ti-secure. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
2023-12-31binman: used-before-assignment in ftest.pyHeinrich Schuchardt1-5/+15
Pytest 7.4.3 complains if a variable is used in a finally clause without having been initialized before the try clause. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-12-13binman: etype: dm: Add entry type for TI DMNeha Malcom Francis1-0/+7
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 <n-francis@ti.com> Reviewed-by: Andrew Davis <afd@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-11-02binman: Replace FILENAME_ALIGN 16 with ATTRIBUTE_ALIGN 4Simon Glass1-5/+5
cbfsutil changed to 4-byte alignment for filenames instead of 16. Adjust the binman implementation to do the same. This mirrors commit 5779ca718c in coreboot. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-11-02binman: Don't add compression attribute for uncompressed filesSimon Glass1-3/+3
cbfsutil changed to skip adding a compression attribute if there is no compression. Adjust the binman implementation to do the same. This mirrors commit 105cdf5625 in coreboot. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
2023-10-13binman: capsule: Add support for generating EFI empty capsulesSughosh Ganu1-0/+57
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 <sughosh.ganu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-10-13binman: capsule: Use dumped capsule header contents for verificationSughosh Ganu1-41/+64
The various fields of a generated capsule are currently verified through hard-coded offsets. Use the dump-capsule feature for dumping the capsule header contents and use those for capsule verification. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-29binman: capsule: Add support for generating EFI capsulesSughosh Ganu1-0/+118
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 <sughosh.ganu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-05binman: ftest: Add test for xilinx-bootgen etypeLukas Funke1-0/+77
Add test for the 'xilinx-bootgen' etype Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org> Allow missing bootgen tool; comment testXilinxBootgenMissing() comment: Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-05binman: Renumber 291 and 292 test filesSimon Glass1-2/+2
These have ended up with the same numbers as earlier files. Fix them. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-02binman: Support templates containing phandlesSimon Glass1-0/+27
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 <sjg@chromium.org>
2023-08-02binman: Remove templates after useSimon Glass1-0/+7
It is not necessary to keep templates around after they have been processed. They can cause confusion and potentially duplicate phandles. Remove them. Use the same means of detecting a template node in _ReadImageDesc so that the two places are consistent. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-02binman: Produce a template-file after processingSimon Glass1-0/+9
This file aids debugging when binman fails to get far enough to write out the final devicetree file. Write it immediate after template processing. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-02binman: Show filename in missing blob help messageJonas Karlman1-0/+2
Show the filename next to the node path in missing blob help messages, also show a generic missing blob message when there was no help message for the help tag. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-02binman: Override CheckOptional in fit entryJonas Karlman1-0/+7
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 <jonas@kwiboo.se> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-02binman: Update missing optional external blob warning textJonas Karlman1-1/+1
Make it more clear that the missing external blob is optional in the printed warning message. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-24binman: ftest: Add test for u_boot_spl_pubkey_dtbLukas Funke1-0/+33
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 <lukas.funke@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-24binman: Add tests for etype encryptedChristian Taedcke1-0/+59
Add tests to reach 100% code coverage for the added etype encrypted. Signed-off-by: Christian Taedcke <christian.taedcke@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-24binman: Renumber 277...289 TI test filesSimon Glass1-9/+9
These have ended up with the same numbers as earlier files. Fix them. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24binman: Renumber 277_rockchip and 278_mkimage test filesSimon Glass1-3/+3
These have ended up with the same numbers as earlier files. Fix them. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24binman: Tidy up tests for pre-load entry typeSimon Glass1-12/+36
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 <sjg@chromium.org>
2023-07-21binman: Overwrite symlink if it already existsAndrew Davis1-2/+16
Without this re-building will fail with an error when trying to create the symlink for the second time with an already exists error. Signed-off-by: Andrew Davis <afd@ti.com> [n-francis@ti.com: Added support for test output dir and testcase] Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
2023-07-21binman: ti-secure: Add support for TI signingNeha Malcom Francis1-0/+52
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 <sjg@chromium.org> [vigneshr@ti.com: fixed inconsist cert generation by multiple packing] Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com> Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
2023-07-21binman: ti-board-config: Add support for TI board config binariesNeha Malcom Francis1-0/+20
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 <sjg@chromium.org> Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
2023-07-20binman: Support writing symbols inside a mkimage imageSimon Glass1-0/+64
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 <sjg@chromium.org>
2023-07-20binman: Support templates at any levelSimon Glass1-0/+8
Allow templates to be used inside a section, not just in the top-level /binman node. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-20binman: Add a test for templating in a FITSimon Glass1-0/+7
Add this as a separate test case. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-20binman: Support templating with multiple imagesSimon Glass1-0/+12
Allow a template to appear in the top level description when using multiple images. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-20binman: Support simple templatesSimon Glass1-0/+8
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 <sjg@chromium.org>
2023-07-20binman: Correct handling of zero bss sizeSimon Glass1-0/+12
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 <sjg@chromium.org>
2023-07-20binman: Provide a way to specify the fdt-list directlySimon Glass1-0/+12
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 <sjg@chromium.org>
2023-07-20binman: Convert mkimage to Entry_sectionMarek Vasut1-1/+66
This is needed to handle mkimage with inner section located itself in a section. Signed-off-by: Marek Vasut <marex@denx.de> Use BuildSectionData() instead of ObtainContents(), add tests and a few other minor fixes: Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-20binman: Allow disabling symbol writingSimon Glass1-4/+24
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 <sjg@chromium.org>
2023-03-16Merge tag 'dm-next-12mar23a' of git://git.denx.de/u-boot-dm into nextTom Rini1-0/+93
More tests and fixes for fdt command binman signing feature fix buildman -A bug introduced recently Signed-off-by: Tom Rini <trini@konsulko.com>
2023-03-14binman: add tests for sign optionIvan Mikhaylov1-0/+93
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 <fr0st61te@gmail.com> 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 <sjg@chromium.org>
2023-03-14Merge tag 'v2023.04-rc4' into nextTom Rini1-0/+18
Prepare v2023.04-rc4 Signed-off-by: Tom Rini <trini@konsulko.com>
2023-03-08binman: Support generation of x509 certificatesSimon Glass1-0/+26
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 <sjg@chromium.org>
2023-03-08binman: Support updating section contentsSimon Glass1-5/+132
Implement this feature since it is useful for updating FITs within an image. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08binman: Handle missing bintools correctly in fitSimon Glass1-1/+9
At present these are handled as if they are allowed to be missing, but this is only true if the -M flag is provided. Fix this and add a test. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08patman: Move library functions into a library directorySimon Glass1-4/+4
The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08binman: Avoid unwanted output in testFitFirmwareLoadables()Simon Glass1-4/+5
This prints a message about the missing tee-os generated by the test. This is confusing, so suppress it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08binman: Make the tooldir configurableSimon Glass1-2/+19
Add a command-line argument for setting the tooldir, so that the default can be overridden. Add this directory to the toolpath automatically. Create the directory if it does not already exist. Put the default in the argument parser instead of the class, so that it is more obvious. Update a few tests that expect the utility name to be provided without any path (e.g. 'futility'), so they can accept a path, e.g. /path/to/futility Update the documentation and add a few tests. Improve the help for --toolpath while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08binman: Support marking FMAP areas as preservedSimon Glass1-1/+1
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 <sjg@chromium.org>
2023-02-28binman: Mark mkimage entry missing when its subnodes is missingJonas Karlman1-0/+11
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 <jonas@kwiboo.se> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-02-28binman: Add support for a rockchip-tpl entryJonas Karlman1-0/+7
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 <jonas@kwiboo.se> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Tested-by: Eugen Hristev <eugen.hristev@collabora.com>
2023-02-12binman: Show the image name for the top-level sectionSimon Glass1-38/+30
At present we show 'main section' as the top-level section name. It may be more helpful to show the actual image name. This is tricky because Image is a parent class of Entry_section, so there is no distinction between an image and a section. Update it to show the image name. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-26binman: Add 'min-size' entry propertySamuel Holland1-4/+17
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 <samuel@sholland.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-01-26binman: Add support for selecting firmware to use with split-elfJonas Karlman1-0/+44
In some cases it is desired for SPL to start TF-A instead of U-Boot proper. Add support for a new property fit,firmware that picks a valid entry and prepends the remaining valid entries to the loadables list generated by the split-elf generator. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>