- 27 Jan, 2017 1 commit
-
-
Masahiro Yamada authored
This line should check the existence of the input file, but it is actually checking the output file. When -o option is given to the "update" command, the outfile is unlikely to exist, then parse_fip() is skipped and an empty FIP file is output. This is wrong behavior. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-
- 14 Jan, 2017 2 commits
-
-
Masahiro Yamada authored
The "make fip" shows the content of the generated FIP at the end of the build. (This is shown by "fiptool info" command.) Prior to commit e0f083a0 ("fiptool: Prepare ground for expanding the set of images at runtime"), the last part of the build log of make CROSS_COMPILE=aarch64-linux-gnu- BL33=../u-boot/u-boot.bin fip was like follows: Trusted Boot Firmware BL2: offset=0xB0, size=0x4188, cmdline="--tb-fw" EL3 Runtime Firmware BL31: offset=0x4238, size=0x6090, cmdline="--soc-fw" Non-Trusted Firmware BL33: offset=0xA2C8, size=0x58B51, cmdline="--nt-fw" With that commit, now it is displayed like follows: Non-Trusted Firmware BL33: offset=0xB0, size=0x58B51, cmdline="--nt-fw" EL3 Runtime Firmware BL31: offset=0x58C01, size=0x6090, cmdline="--soc-fw" Trusted Boot Firmware BL2: offset=0x5EC91, size=0x4188, cmdline="--tb-fw" You will notice two differences: - the contents are displayed in BL33, BL31, BL2 order - the offset values are wrong The latter is more serious, and means "fiptool info" is broken. Another interesting change is "fiptool update" every time reverses the image order. For example, if you input FIP with BL2, BL31, BL33 in this order, the command will pack BL33, BL31, BL2 into FIP, in this order. Of course, the order of components is not a big deal except that users will have poor impression about this. The root cause is in the implementation of add_image(); the image_head points to the last added image. For example, if you call add_image() for BL2, BL31, BL33 in this order, the resulted image chain is: image_head -> BL33 -> BL31 -> BL2 Then, they are processed from the image_head in "for" loops: for (image = image_head; image != NULL; image = image->next) { This means images are handled in Last-In First-Out manner. Interestingly, "fiptool create" is still correct because add_image_desc() also reverses the descriptor order and the command works as before due to the double reverse. The implementation of add_image() is efficient, but it made the situation too complicated. Let's make image_head point to the first added image. This will add_image() inefficient because every call of add_image() follows the ->next chain to get the tail. We can solve it by adopting a nicer linked list structure, but I am not doing as far as that because we handle only limited number of images anyway. Do likewise for add_image_desc(). Fixes: e0f083a0 ("fiptool: Prepare ground for expanding the set of images at runtime") Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
We often want to zero out allocated memory. My main motivation for this commit is to set image::next and image_desc::next to NULL automatically in the next commit. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-
- 30 Dec, 2016 5 commits
-
-
dp-arm authored
An image descriptor contains an action and an argument. The action indicates the intended operation, as requested by the user. It can be pack, unpack or remove. Factor out setting those fields to a separate function to minimize code duplication across the various commands that modify these fields. Change-Id: I1682958e8e83c4884e435cff6d0833c67726461f Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
-
dp-arm authored
Change-Id: If279680a71e7fa1f801d79b8bc2cd47cd9905d33 Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
-
dp-arm authored
Change-Id: Ife8f198b4c45961e85ed6f4d463daa59009dab1c Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
-
dp-arm authored
Previously, fiptool only understood a fixed set of images as specified in tbbr_config.c. It preserved unknown images during the update, unpack and remove operations but it was not possible to explicitly refer to one of those unknown images. Add a new --blob option to create/update/unpack/remove images that are not known at compile time. This is accomplished by specifying the UUID and filename pair as shown below: $ ./fiptool create --blob uuid=01234567-89ab-cdef-0123-456789abcdef,file=foo.bin fip.bin $ ./fiptool info fip.bin 01234567-89ab-cdef-0123-456789abcdef: offset=0x60, size=0x1AA68 Fixes ARM-software/tf-issues#420 Change-Id: Iaac2504b9a4252289c09e73d29645cbe240f3a82 Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
-
dp-arm authored
To allow operating on images with unknown UUIDs, fiptool needs to be able to track an arbitrary amount of images and not be limited to the set of images described by the builtin table. Convert the table to a list to accommodate this scenario. Change-Id: I0e6d738eece7795d74fc72d165a3098f223d4414 Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
-
- 05 Dec, 2016 4 commits
-
-
dp-arm authored
Change-Id: Ie3e43e9f7d31df40a5997047b9bddec0a06fd47f Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
-
dp-arm authored
Change-Id: I18a4327e41fc090dcea9a647f7673182ca0ed1d9 Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
-
dp-arm authored
Change-Id: I62c1a636eb0d9f73fa3a6356e32b5a44f268d421 Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
-
dp-arm authored
Additionally, remove the -o option for the create command as it is not supported. Change-Id: I27993a6fc5e3b0b9710e2ec5322e4296bc87d0df Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
-
- 26 Oct, 2016 1 commit
-
-
Masahiro Yamada authored
Fix the following bug: $ tools/fiptool/fiptool -v Segmentation fault (core dumped) Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-
- 18 Oct, 2016 1 commit
-
-
dp-arm authored
The `toc_entry` and `image` data structures had a cyclic relationship. This patch removes the explicit dependencies and introduces functions to link them via the UUID. This change highlights the intent of the code better and makes it more flexible for future enhancements. Change-Id: I0c3dd7bfda2a631a3827c8ba4831849c500affe9 Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
-
- 15 Sep, 2016 1 commit
-
-
dp-arm authored
Instead of always calling the top level usage function when an error is detected, call the command-specific usage function. For example running `fiptool create` will produce the same output as `fiptool help create`. This is more convenient for the user when they make a mistake. Change-Id: I60178ab89d47adf93cdfe6d8b5d5f778a5ea3bca
-
- 12 Sep, 2016 1 commit
-
-
dp-arm authored
This feature allows one to quickly verify that the expected image is contained in the FIP without extracting the image and running sha256sum(1) on it. The sha256 digest is only shown when the verbose flag is used. This change requires libssl-dev to be installed in order to build Trusted Firmware. Previously, libssl-dev was optionally needed only to support Trusted Board Boot configurations. Fixes ARM-Software/tf-issues#124 Change-Id: Ifb1408d17f483d482bb270a589ee74add25ec5a6
-
- 25 Aug, 2016 1 commit
-
-
dp-arm authored
It should be 'fiptool' instead of 'fiptfool'. Change-Id: I84ce1b6aaae5b8b33e5781bfe4f9e9cf462edb03
-
- 15 Aug, 2016 1 commit
-
-
dp-arm authored
The output is shown only when built with V=1. Change-Id: I17fef10df6f127f07956a78b478ff3cadba4bd61
-
- 29 Jul, 2016 1 commit
-
-
dp-arm authored
fiptool provides a more consistent and intuitive interface compared to the fip_create program. It serves as a better base to build on more features in the future. fiptool supports various subcommands. Below are the currently supported subcommands: 1) info - List the images contained in a FIP file. 2) create - Create a new FIP file with the given images. 3) update - Update an existing FIP with the given images. 4) unpack - Extract a selected set or all the images from a FIP file. 5) remove - Remove images from a FIP file. This is a new command that was not present in fip_create. To create a new FIP file, replace "fip_create" with "fiptool create". To update a FIP file, replace "fip_create" with "fiptool update". To dump the contents of a FIP file, replace "fip_create --dump" with "fiptool info". A compatibility script that emulates the basic functionality of fip_create is provided. Existing scripts might or might not work with the compatibility script. Users are strongly encouraged to migrate to fiptool. Fixes ARM-Software/tf-issues#87 Fixes ARM-Software/tf-issues#108 Fixes ARM-Software/tf-issues#361 Change-Id: I7ee4da7ac60179cc83cf46af890fd8bc61a53330
-
- 05 Jul, 2016 1 commit
-
-
Yatharth Kochar authored
With the introduction of commit `96103d5a`, the Certificate Generation tool is not able to generate FWU certificate and while doing so it does segmentation fault. This happens because it is now required to pass non-volatile counter values to the `cert_create` tool from the command line for creating the trusted firmware certificates. But in case of creating FWU certificate these counter values are not being passed to the tool and as a consequence the `cert_create` tool try to use the NULL argument and errors out with Segmentation fault. This patch fixes this issue by providing a check before using the command line argument passed in the case of `EXT_TYPE_NVCOUNTER` certificate extension. Change-Id: Ie17d0c1502b52aaa8500f3659c2da2448ab0347a
-
- 03 Jun, 2016 1 commit
-
-
Dan Handley authored
* Move stdlib header files from include/stdlib to include/lib/stdlib for consistency with other library headers. * Fix checkpatch paths to continue excluding stdlib files. * Create stdlib.mk to define the stdlib source files and include directories. * Include stdlib.mk from the top level Makefile. * Update stdlib header path in the fip_create Makefile. * Update porting-guide.md with the new paths. Change-Id: Ia92c2dc572e9efb54a783e306b5ceb2ce24d27fa
-
- 27 Apr, 2016 1 commit
-
-
Brendan Jackman authored
Change-Id: I0d298eea9eaf47121c87637c7395e5d9868aa272
-
- 06 Apr, 2016 1 commit
-
-
Juan Castillo authored
This patch adds support for image unpacking to the FIP packaging tool. Command line option '-u,--unpack' may be used to unpack the contents of an existing FIP file into the working directory. The tool uses default hardcoded filenames for the unpacked images. If the files already exist, they can be overwritten by specifying the option '-f,--force'. Change-Id: I360b11d9c5403e8c0a7a9cac32c1d90ebb228063
-
- 01 Apr, 2016 7 commits
-
-
Evan Lloyd authored
In some build environments executable programs have a specific file extension. The value of BIN_EXT is appended to the relevant tool file names to allow for this. The value of BIN_EXT is set, where appropriate, by the build environment specific make helper (to .exe for Windows build environments). .gitignore is updated to hide the new (.exe) files. Change-Id: Icc32f64b750e425265075ad4e0dea18129640b86
-
Evan Lloyd authored
Replace some "recursively expanded" make variables with "simply expanded" variables (i.e. replace = with :=). This has no functional impact but is more consistent and theoretically more efficient. Change-Id: Iaf33d7c8ad48464ae0d39923515d1e7f230c95c1
-
Evan Lloyd authored
Some build environments do not support symbolic links. This patch removes the symlinks previously used to build fip_create and instead copies the relevant header files. The original motivation for using symlinks was to avoid Trusted Firmware library headers conflicting with headers in the compiler standard include path. Copying the header files instead has the same effect. Like other build artefacts, the copied files are listed in .gitignore. The distclean targets have also been updated to remove the copies. Change-Id: Ie8b67bcb133f7f1d660ae93b857950aa15e42b1e
-
Evan Lloyd authored
Add make helper files to select the appropriate settings for the build environment. Selection is made in make_helpers/build_env.mk, which selects other files to include using generic build environment settings. The Trusted Firmware Makefile and supporting tool Makefiles are updated to include build_env.mk instead of unix.mk. NOTE: This change does not fully enable builds in other build environments. It facilitates this without compromising the existing build environments. Change-Id: Ic4064ffe6ce158bbd16d7cc9f27dd4655a3580f6
-
Evan Lloyd authored
Macros are inserted to replace direct invocations of commands that are problematic on some build environments. (e.g. Some environments expect \ in paths instead of /.) The changes take into account mismatched command mappings across environments. The new helper file unix.mk retains existing makefile behaviour on unix like build environments by providing the following macro definitions: SHELL_COPY cp -f SHELL_COPY_TREE cp -rf SHELL_DELETE rm -f SHELL_DELETE_ALL rm -rf MAKE_PREREQ_DIR mkdir -p (As make target) SHELL_REMOVE_DIR rm -rf Change-Id: I1b5ca5e1208e78230b15284c4af00c1c006cffcb
-
Evan Lloyd authored
Update the cert_create Makefile to list realclean as .PHONY (like clean) Change-Id: I9dc8a61a11574a044372e0952b5b12b74e133747
-
Evan Lloyd authored
As an initial stage of making Trusted Firmware build environment more portable, we remove most uses of the $(shell ) function and replace them with more portable make function based solutions. Note that the setting of BUILD_STRING still uses $(shell ) since it's not possible to reimplement this as a make function. Avoiding invocation of this on incompatible host platforms will be implemented separately. Change-Id: I768e2f9a265c78814a4adf2edee4cc46cda0f5b8
-
- 30 Mar, 2016 1 commit
-
-
Juan Castillo authored
This patch adds non-volatile counter support to the Certificate Generation tool. The TBBR Chain of Trust definition in the tool has been extended to include the counters as certificate extensions. The counter values can be specified in the command line. The following default counter values are specified in the build system: * Trusted FW Non-Volatile counter = 0 * Non-Trusted FW Non-Volatile counter = 0 These values can be overridden by the platform at build time. Change-Id: I7ea10ee78d72748d181df4ee78a7169b3ef2720c
-
- 04 Mar, 2016 1 commit
-
-
Juan Castillo authored
This patch introduces the following improvements: * Global variables in fip_create.c declared static. * Flags to signal the requested actions (do_dump, do_pack) made global. * The ToC is printed at the end of the main funcion, after the FIP has been created/updated, not in the parse_cmdline() function. * Short format added to the command line options (-d,--dump; -h,--help). * Help message updated. Change-Id: I5f08273c76f1de45fe597e290bee4b60aa404df9
-
- 07 Jan, 2016 1 commit
-
-
Juan Castillo authored
The help message printed by the cert_create tool using the command line option -h (or --help) does not correctly list all the available command line options. This patch reworks the print_help() function to print the help messages in a data driven approach. For each command line option registered, an optional help message can be specified, which will be printed by print_help(). Help messages for the TBBR options (certificates, keys and images) are also provided. Fix a small bug in the short options string passed to getopt_long: the ':' was missing in the '-a' option (this option must take an argument). Fixes ARM-software/tf-issues#337 Change-Id: I9d08c2dfd349022808fcc884724f677eefdc1452
-
- 05 Jan, 2016 2 commits
-
-
Juan Castillo authored
The fip_create tool specifies images in the command line using the ARM TF naming convention (--bl2, --bl31, etc), while the cert_create tool uses the TBBR convention (--tb-fw, --soc-fw, etc). This double convention is confusing and should be aligned. This patch updates the fip_create command line options to follow the TBBR naming convention. Usage examples in the User Guide have been also updated. NOTE: users that build the FIP by calling the fip_create tool directly from the command line must update the command line options in their scripts. Users that build the FIP by invoking the main ARM TF Makefile should not notice any difference. Change-Id: I84d602630a2585e558d927b50dfde4dd2112496f
-
Sandrine Bailleux authored
By default ARM TF is built with the '-pedantic' compiler flag, which helps detecting violations of the C standard. However, the mbed TLS library and its associated authentication module in TF used to fail building with this compiler flag. As a workaround, the mbed TLS authentication module makefile used to set the 'DISABLE_PEDANTIC' TF build flag. The compiler errors flagged by '-pedantic' in the mbed TLS library have been fixed between versions 1.3.9 and 2.2.0 and the library now properly builds with this compiler flag. This patch fixes the remaining compiler errors in the mbed TLS authentication module in TF and unsets the 'DISABLE_PEDANTIC' TF build flag. This means that TF is now always built with '-pedantic'. In particular, this patch: * Removes the final semi-colon in REGISTER_COT() macro. This semi-colon was causing the following error message: drivers/auth/tbbr/tbbr_cot.c:544:23: error: ISO C does not allow extra ';' outside of a function [-Werror=pedantic] This has been fixed both in the mbed TLS authentication module as well as in the certificate generation tool. Note that the latter code didn't need fixing since it is not built with '-pedantic' but the change has been propagated for consistency. Also fixed the REGISTER_KEYS() and REGISTER_EXTENSIONS() macros, which were suffering from the same issue. * Fixes a pointer type. It was causing the following error message: drivers/auth/mbedtls/mbedtls_crypto.c: In function 'verify_hash': drivers/auth/mbedtls/mbedtls_crypto.c:177:42: error: pointer of type 'void *' used in arithmetic [-Werror=pointer-arith] Change-Id: I7b7a04ef711efd65e17b5be26990d1a0d940257d
-
- 14 Dec, 2015 3 commits
-
-
Juan Castillo authored
This patch removes the dash character from the image name, to follow the image terminology in the Trusted Firmware Wiki page: https://github.com/ARM-software/arm-trusted-firmware/wiki Changes apply to output messages, comments and documentation. non-ARM platform files have been left unmodified. Change-Id: Ic2a99be4ed929d52afbeb27ac765ceffce46ed76
-
Juan Castillo authored
This patch replaces all references to the SCP Firmware (BL0, BL30, BL3-0, bl30) with the image terminology detailed in the TF wiki (https://github.com/ARM-software/arm-trusted-firmware/wiki): BL0 --> SCP_BL1 BL30, BL3-0 --> SCP_BL2 bl30 --> scp_bl2 This change affects code, documentation, build system, tools and platform ports that load SCP firmware. ARM plaforms have been updated to the new porting API. IMPORTANT: build option to specify the SCP FW image has changed: BL30 --> SCP_BL2 IMPORTANT: This patch breaks compatibility for platforms that use BL2 to load SCP firmware. Affected platforms must be updated as follows: BL30_IMAGE_ID --> SCP_BL2_IMAGE_ID BL30_BASE --> SCP_BL2_BASE bl2_plat_get_bl30_meminfo() --> bl2_plat_get_scp_bl2_meminfo() bl2_plat_handle_bl30() --> bl2_plat_handle_scp_bl2() Change-Id: I24c4c1a4f0e4b9f17c9e4929da815c4069549e58
-
Juan Castillo authored
This patch applies the TBBR naming convention to the certificates and the corresponding extensions defined by the CoT: * Certificate UUID names * Certificate identifier names * OID names Changes apply to: * Generic code (variables and defines) * The default certificate identifiers provided in the generic code * Build system * ARM platforms port * cert_create tool internal definitions * fip_create and cert_create tools command line options * Documentation IMPORTANT: this change breaks the compatibility with platforms that use TBBR. The platform will need to adapt the identifiers and OIDs to the TBBR naming convention introduced by this patch: Certificate UUIDs: UUID_TRUSTED_BOOT_FIRMWARE_BL2_CERT --> UUID_TRUSTED_BOOT_FW_CERT UUID_SCP_FIRMWARE_BL30_KEY_CERT --> UUID_SCP_FW_KEY_CERT UUID_SCP_FIRMWARE_BL30_CERT --> UUID_SCP_FW_CONTENT_CERT UUID_EL3_RUNTIME_FIRMWARE_BL31_KEY_CERT --> UUID_SOC_FW_KEY_CERT UUID_EL3_RUNTIME_FIRMWARE_BL31_CERT --> UUID_SOC_FW_CONTENT_CERT UUID_SECURE_PAYLOAD_BL32_KEY_CERT --> UUID_TRUSTED_OS_FW_KEY_CERT UUID_SECURE_PAYLOAD_BL32_CERT --> UUID_TRUSTED_OS_FW_CONTENT_CERT UUID_NON_TRUSTED_FIRMWARE_BL33_KEY_CERT --> UUID_NON_TRUSTED_FW_KEY_CERT UUID_NON_TRUSTED_FIRMWARE_BL33_CERT --> UUID_NON_TRUSTED_FW_CONTENT_CERT Certificate identifiers: BL2_CERT_ID --> TRUSTED_BOOT_FW_CERT_ID BL30_KEY_CERT_ID --> SCP_FW_KEY_CERT_ID BL30_CERT_ID --> SCP_FW_CONTENT_CERT_ID BL31_KEY_CERT_ID --> SOC_FW_KEY_CERT_ID BL31_CERT_ID --> SOC_FW_CONTENT_CERT_ID BL32_KEY_CERT_ID --> TRUSTED_OS_FW_KEY_CERT_ID BL32_CERT_ID --> TRUSTED_OS_FW_CONTENT_CERT_ID BL33_KEY_CERT_ID --> NON_TRUSTED_FW_KEY_CERT_ID BL33_CERT_ID --> NON_TRUSTED_FW_CONTENT_CERT_ID OIDs: TZ_FW_NVCOUNTER_OID --> TRUSTED_FW_NVCOUNTER_OID NTZ_FW_NVCOUNTER_OID --> NON_TRUSTED_FW_NVCOUNTER_OID BL2_HASH_OID --> TRUSTED_BOOT_FW_HASH_OID TZ_WORLD_PK_OID --> TRUSTED_WORLD_PK_OID NTZ_WORLD_PK_OID --> NON_TRUSTED_WORLD_PK_OID BL30_CONTENT_CERT_PK_OID --> SCP_FW_CONTENT_CERT_PK_OID BL30_HASH_OID --> SCP_FW_HASH_OID BL31_CONTENT_CERT_PK_OID --> SOC_FW_CONTENT_CERT_PK_OID BL31_HASH_OID --> SOC_AP_FW_HASH_OID BL32_CONTENT_CERT_PK_OID --> TRUSTED_OS_FW_CONTENT_CERT_PK_OID BL32_HASH_OID --> TRUSTED_OS_FW_HASH_OID BL33_CONTENT_CERT_PK_OID --> NON_TRUSTED_FW_CONTENT_CERT_PK_OID BL33_HASH_OID --> NON_TRUSTED_WORLD_BOOTLOADER_HASH_OID BL2U_HASH_OID --> AP_FWU_CFG_HASH_OID SCP_BL2U_HASH_OID --> SCP_FWU_CFG_HASH_OID NS_BL2U_HASH_OID --> FWU_HASH_OID Change-Id: I1e047ae046299ca913911c39ac3a6e123bd41079
-
- 09 Dec, 2015 2 commits
-
-
Yatharth Kochar authored
Firmware Update (FWU) introduces a new set of images called SCP_BL2U, BL2U and NS_BL2U, which can be packed in a FWU FIP file. This patch introduces new UUIDs for the Firmware Update images and extends the 'fip'create' tool so that these new images can be packed in a FIP file. Change-Id: I7c60211b4f3cc265411efb131e6d3c624768f522
-
Yatharth Kochar authored
Firmware Update requires an X509v3 certificate which contains hashes for SCP_BL2U, BL2U and NS_BL2U images as extensions. This patch extends the Chain of Trust definition in the 'cert_create' tool to include the Firmware Update certificate and the required extensions (including command line options). A new field in the extension structure will be used to indicate that the extension is optional. In the case of an image hash extension, this field will tell the tool that the hash should be included in the certificate, but filled with zeros. Change-Id: I1f77a66b018826b71745910771f38d9cf6050388
-