aboutsummaryrefslogtreecommitdiff
path: root/tools/binman
AgeCommit message (Collapse)Author
2024-04-11tools: binman: ti_board_cfg: improve error messageMichael Walle
When there is a lint error the user gets the following cryptic message: binman: Node '/path/to/some/node': Yamllint error: 18: comments This isn't very helpful. Improve the message to tell the user that the number is actually a line number and also tell the user in which file they have to look. Signed-off-by: Michael Walle <mwalle@kernel.org> Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
2024-04-11binman: ti-secure: Enable debug extension for combined bootManorit Chawdhry
To debug using jtag, ROM needs to unlock jtag debugging on HS devices and it does that looking at this debug extension. Add the debug extension and enable it by default. Link: https://software-dl.ti.com/tisci/esd/latest/2_tisci_msgs/security/sec_cert_format.html?highlight=debug#sysfw-debug-ext Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com> Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
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 <n-francis@ti.com> Suggested-by: Nishanth Menon <nm@ti.com>
2024-01-04Merge patch series "ATF and OP-TEE Firewalling for K3 devices."Tom Rini
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 Chawdhry
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>
2024-01-04binman: ti-secure: Add support for firewalling entitiesManorit Chawdhry
We can now firewall entities while loading them through our secure entity TIFS, the required information should be present in the certificate that is being parsed by TIFS. The following commit adds the support to enable the certificates to be generated if the firewall configurations are present in the binman dtsi nodes. 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 Schuchardt
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: elf: Using variable 'old_val' before assignmentHeinrich Schuchardt
old_val can only be assumed initialized in the finally block if it is assigned a value before the try statement. 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 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 <n-francis@ti.com> Reviewed-by: Andrew Davis <afd@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-12-13binman: doc: fix typoDario Binacchi
s/use set/set/ Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> Reviewed-By: Michael Trimarchi <michael@amarulasolutions.com>
2023-12-13tools: Move python tools to version 0.0.6Simon Glass
A new release has been done with this version, so update it. Use the version numbers in dependencies also. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-12-13doc: Update documentation URLSimon Glass
Update to use the new docs.u-boot.org URL for documentation. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-11-11doc: shorten overlong title underlinesHeinrich Schuchardt
Title underlines should match the length of the title. Unfortunately docutils only catches underlines that are too short. Add some missing empty lines after titles. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
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 <n-francis@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-11-02binman: Move stage header into a CBFS attributeSimon Glass
cbfsutil completely changed the way that stages are formatted in CBFS. Adjust the binman implementation to do the same. This mirrors commit 81dc20e744 in coreboot. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-11-02binman: Rename TYPE_STAGE to TYPE_LEGACY_STAGESimon Glass
In preparation for changing how stages are stored, rename the existing stage tag. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-11-02binman: Replace FILENAME_ALIGN 16 with ATTRIBUTE_ALIGN 4Simon Glass
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: Ensure attributes always come last in the metadataSimon Glass
cbfsutil changed to write zero bytes instead of 0xff when a small padding must be added. Adjust the binman implementation to do the same. Drop the code which looks for an unused attribute tag, since it is not used. A future patch moves the attributes to the end of the header in any case, so no data will follow the attributes. This mirrors commit f0cc7adb2f in coreboot. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-11-02binman: Don't add compression attribute for uncompressed filesSimon Glass
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-11-02binman: Reset missing bintools after testingSimon Glass
For tests which fake bintools being missing, we need to reset the list afterwards, to ensure that future tests do not also see the bintools as missing. Reset the list when processing is complete. 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 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 <sughosh.ganu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-10-13btool: mkeficapsule: Add support for EFI empty capsule generationSughosh Ganu
Add a method to the mkeficapsule bintool to generate empty capsules. These are capsules needed for the FWU A/B update feature. 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 Ganu
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-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 <sughosh.ganu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-10-13binman: bintool: Change make target arg type from string to listLukas Funke
The argument type of `build_from_git` was changed from string to list in d71e7116997f14097735f04cc7847f0a68dbc485. This commit adapts the argument type of all bintools using this function. Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
2023-10-02Merge branch 'next'Tom Rini
Signed-off-by: Tom Rini <trini@konsulko.com>
2023-09-29binman: doc: Remove incomplete sentenceHeinrich Schuchardt
This is the difference between version 1 and 2 of Massimo's patch: binman: doc: fix reference tag placement for Logging section v2: https://lore.kernel.org/u-boot/20230913161633.999542-1-massimo.pegorer+oss@gmail.com/ v1: https://lore.kernel.org/u-boot/20230909135235.21242-1-massimo.pegorer+oss@gmail.com/ Fixes: 0f40e23fd22 ("binman: add documentation for binman sign option") Signed-off-by: Massimo Pegorer <massimo.pegorer+oss@gmail.com> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Massimo Pegorer <massimo.pegorer+oss@gmail.com>
2023-09-23binman: Fix SyntaxWarning: invalid escape sequence '\('Rong Tao
Reproduct warning: $ git clean -dfx $ make CROSS_COMPILE="" qemu-x86_64_defconfig $ make -j8 ... u-boot/tools/binman/etype/section.py:25: SyntaxWarning: invalid escape sequence '\(' """Entry that contains other entries Signed-off-by: Rong Tao <rongtao@cestc.cn>
2023-09-16binman: doc: fix reference tag placement for Logging sectionMassimo Pegorer
Move BinmanLogging reference tag after section "Signing FIT container with private key in an image" and just before section "Logging". Fixes: 0f40e23fd22 ("binman: add documentation for binman sign option") Signed-off-by: Massimo Pegorer <massimo.pegorer+oss@gmail.com> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-09-04Merge tag 'v2023.10-rc4' into nextTom Rini
Prepare v2023.10-rc4
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 <sughosh.ganu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-29btool: mkeficapsule: Add a bintool for EFI capsule generationSughosh Ganu
Add a bintool for generating EFI capsules. This calls the mkeficapsule tool which generates the capsules. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-29binman: bintool: Build a tool from a list of commandsSughosh Ganu
Add support to build a tool from source with a list of commands. This is useful when a tool can be built with multiple commands instead of a single command. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-28Revert "binman: Add a temporary hack for duplicate phandles"Simon Glass
The affected boards have been fixed, so drop this hack. This reverts commit 288ae53cb73605500b7fc01e5919753c878466be. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Tim Harvey <tharvey@gateworks.com>
2023-08-05binman: ftest: Add test for xilinx-bootgen etypeLukas Funke
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: etype: Add xilinx-bootgen etypeLukas Funke
This adds a new etype 'xilinx-bootgen'. By using this etype it is possible to created an signed SPL (FSBL in Xilinx terms) for ZynqMP boards. The etype uses Xilinx Bootgen tools in order to transform the SPL into a bootable image and sign the image with a given primary and secondary public key. For more information to signing the FSBL please refer to the Xilinx Bootgen documentation. Here is an example of the etype in use: spl { filename = "boot.signed.bin"; xilinx-bootgen { pmufw-filename = "pmu-firmware.elf"; psk-key-name-hint = "psk0"; ssk-key-name-hint = "ssk0"; auth-params = "ppk_select=0", "spk_id=0x00000000"; u-boot-spl-nodtb { }; u-boot-spl-dtb { }; }; }; For this to work the hash of the primary public key has to be fused into the ZynqMP device and authentication (RSA_EN) has to be set. For testing purposes: if ppk hash check should be skipped one can add the property 'fsbl_config = "bh_auth_enable";' to the etype. However, this should only be used for testing(!). Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-05binman: btool: Add Xilinx Bootgen btoolLukas Funke
Add the Xilinx Bootgen as bintool. Xilinx Bootgen is used to create bootable SPL (FSBL in Xilinx terms) images for Zynq/ZynqMP devices. The btool creates a signed version of the SPL. Additionally to signing the key source for the decryption engine can be passend to the boot image. Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com>
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 <sjg@chromium.org>
2023-08-02binman: Add a temporary hack for duplicate phandlesSimon Glass
Three boards use a phandle in a FIT generator and the maintainer is away. For now, add a hack to allow this. Signed-off-by: Simon Glass <sjg@chromium.org>
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 <sjg@chromium.org>
2023-08-02binman: Remove templates after useSimon Glass
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 Glass
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 Karlman
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: Fix blank line usage for invalid images warning textJonas Karlman
There is no blank line between last missing blob help message and the header line for optional blob help messages. Image 'simple-bin' is missing external blobs and is non-functional: atf-bl31 /binman/simple-bin/fit/images/@atf-SEQ/atf-bl31: See the documentation for your board. You may need to build ARM Trusted Firmware and build with BL31=/path/to/bl31.bin Image 'simple-bin' is missing external blobs but is still functional: tee-os /binman/simple-bin/fit/images/@tee-SEQ/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 Some images are invalid With this a blank line is inserted to make the text more readable. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Simon Glass <sjg@chromium.org>
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 <jonas@kwiboo.se> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-02binman: Report missing external blobs using error levelJonas Karlman
Print missing external blobs using error level and missing optional external blobs using warning level. Also change to only print the header line in color, red for missing and yellow for optional. 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 Karlman
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-08-02binman: Update tee-os missing blob help textJonas Karlman
Make it a little bit more clear that it is U-Boot that should be built with TEE=/path/to/tee.bin and not OP-TEE itself. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-02binman: elf: Check for ELF_TOOLS availability and remove extra semicolonLukas Funke
Check if elf tools are available when running DecodeElf(). Also remove superfuous semicolon at line ending. Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org> Revert part of patch to make binman test pass Signed-off-by: Simon Glass <sjg@chromium.org>
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 <lukas.funke@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>