aboutsummaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* Merge changes from topic "sb/dualroot" into integrationSandrine Bailleux2020-03-104-0/+535
|\ | | | | | | | | | | | | * changes: Build system: Changes to drive cert_create for dualroot CoT cert_create: Define the dualroot CoT Introduce a new "dualroot" chain of trust
| * cert_create: Define the dualroot CoTSandrine Bailleux2020-02-244-0/+535
| | | | | | | | | | | | | | | | | | Selection of the chain of trust is done through the COT build option: > make COT=dualroot Change-Id: Id87c7a5116bdd13bdb29645ecf31d111ad094c1e Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
* | tools: Add firmware authenticated encryption toolSumit Garg2020-03-067-0/+625
| | | | | | | | | | | | | | | | | | Add firmware authenticated encryption tool which utilizes OpenSSL library to encrypt firmwares using a key provided via cmdline. Currently this tool supports AES-GCM as an authenticated encryption algorithm. Signed-off-by: Sumit Garg <sumit.garg@linaro.org> Change-Id: I60e296af1b98f1912a19d5f91066be7ea85836e4
* | Merge "tools: Small improvement to print_memory_map script" into integrationSandrine Bailleux2020-02-261-10/+21
|\ \
| * | tools: Small improvement to print_memory_map scriptLouis Mayencourt2020-02-141-10/+21
| |/ | | | | | | | | | | | | | | | | | | This patch: - Add the __COHERENT_RAM_START__ and __COHERENT_RAM_END__ symbols. - Improve how the symbols are found with a regex. - Add a build option to revert the memory layout output. Change-Id: I54ec660261431bc98d78acb0f80e3d95bc5397ac Signed-off-by: Louis Mayencourt <louis.mayencourt@arm.com>
* / SPMD: generate and add Secure Partition blobs into FIPManish Pandey2020-02-201-0/+100
|/ | | | | | | | | | | | | | | | | | | | | | | | | | Till now TF-A allows limited number of external images to be made part of FIP. With SPM coming along, there may exist multiple SP packages which need to be inserted into FIP. To achieve this we need a more scalable approach to feed SP packages to FIP. This patch introduces changes in build system to generate and add SP packages into FIP based on information provided by platform. Platform provides information in form of JSON which contains layout description of available Secure Partitions. JSON parser script is invoked by build system early on and generates a makefile which updates FIP, SPTOOL and FDT arguments which will be used by build system later on for final packaging. "SP_LAYOUT_FILE" passed as a build argument and can be outside of TF-A tree. This option will be used only when SPD=spmd. For each SP, generated makefile will have following entries - FDT_SOURCES += sp1.dts - SPTOOL_ARGS += -i sp1.img:sp1.dtb -o sp1.pkg - FIP_ARGS += --blob uuid=XXXX-XXX...,file=SP1.pkg Signed-off-by: Manish Pandey <manish.pandey2@arm.com> Change-Id: Ib6a9c064400caa3cd825d9886008a3af67741af7
* SPM: modify sptool to generate individual SP blobsManish Pandey2020-02-101-133/+159
| | | | | | | | | | | | | | | | | | | | | Currently sptool generates a single blob containing all the Secure Partitions, with latest SPM implementation, it is desirable to have individual blobs for each Secure Partition. It allows to leverage packaging and parsing of SP on existing FIP framework. It also allows SP packages coming from different sources. This patch modifies sptool so that it takes number of SP payload pairs as input and generates number of SP blobs instead of a single blob. Each SP blob can optionally have its own header containing offsets and sizes of different payloads along with a SP magic number and version. It is also associated in FIP with a UUID, provided by SP owner. Usage example: sptool -i sp1.bin:sp1.dtb -o sp1.pkg -i sp2.bin:sp2.dtb -o sp2.pkg ... Signed-off-by: Manish Pandey <manish.pandey2@arm.com> Change-Id: Ie2db8e601fa1d4182d0a1d22e78e9533dce231bc
* cert_create: Remove references to TBBR in common codeSandrine Bailleux2020-01-292-5/+5
| | | | | | | | In preparation of supporting alternate chains of trust, reword comments and error messages that explicitly mentioned TBBR. Change-Id: I85a0b08e16d0cd82f3b767fcc092d1f20f45939f Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
* cert_create: Introduce COT build optionSandrine Bailleux2020-01-291-2/+7
| | | | | | | | | | | | | It allows to select the desired chain of trust. Right now, only the TBBR CoT is available. At this stage, this build option only affects the tool itself. It is not plugged into the rest of the build system yet. To use it: > make -C tools/cert_create COT=tbbr Change-Id: I4484418f76d3c7b330d8653c978499a181534dcd Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
* cert_create: Introduce TBBR CoT makefileSandrine Bailleux2020-01-292-28/+40
| | | | | | | | | Move all TBBR-specific stuff out of the tool's makefile into a sub-makefile. This will make it easier to define and select an alternate chain of trust in the future. Change-Id: I92e366a1999b74cf51127d1771b64b807cd94b29 Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
* cert_create: Remove some unused header files inclusionsSandrine Bailleux2020-01-143-24/+3
| | | | | | | | The chain of trust definitions are only needed in the part of the code dealing with the TBBR CoT (tbbr/* files). Change-Id: I6f9a86bba4a2d16313b6842a3ec85b7c951074bc Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
* tools: Add show_memory scriptLouis Mayencourt2019-11-251-0/+68
| | | | | | | | | | | show_memory is a simple tools that parse the blx.map files and print a representation of the memory layout for the latest build. This representation is based on standard symbols present on the map files as: __TEXT_START/END__, __RODATA_START/END__, __STACKS_START/END__ , etc.. Change-Id: Iba3e301a1a9fee9a35abf1afdb69093617d33929 Signed-off-by: Louis Mayencourt <louis.mayencourt@arm.com>
* Remove RSA PKCS#1 v1.5 support from cert_toolJustin Chadwell2019-09-125-14/+7
| | | | | | | | | | | | | | | | | Support for PKCS#1 v1.5 was deprecated in SHA 1001202 and fully removed in SHA fe199e3, however, cert_tool is still able to generate certificates in that form. This patch fully removes the ability for cert_tool to generate these certificates. Additionally, this patch also fixes a bug where the issuing certificate was a RSA and the issued certificate was EcDSA. In this case, the issued certificate would be signed using PKCS#1 v1.5 instead of RSAPSS per PKCS#1 v2.1, preventing TF-A from verifying the image signatures. Now that PKCS#1 v1.5 support is removed, all certificates that are signed with RSA now use the more modern padding scheme. Change-Id: Id87d7d915be594a1876a73080528d968e65c4e9a Signed-off-by: Justin Chadwell <justin.chadwell@arm.com>
* Add cert_create tool support for RSA key sizesJustin Chadwell2019-09-123-12/+75
| | | | | | | | | | cert_tool is now able to accept a command line option for specifying the key size. It now supports the following options: 1024, 2048 (default), 3072 and 4096. This is also modifiable by TFA using the build flag KEY_SIZE. Change-Id: Ifadecf84ade3763249ee8cc7123a8178f606f0e5 Signed-off-by: Justin Chadwell <justin.chadwell@arm.com>
* meson: Rename platform directory to amlogicCarlo Caione2019-09-052-0/+0
| | | | | | | | | Meson is the internal code name for the SoC family. The correct name for the platform should be Amlogic. Change the name of the platform directory. Signed-off-by: Carlo Caione <ccaione@baylibre.com> Change-Id: Icc140e1ea137f12117acbf64c7dcb1a8b66b345d
* Reduce the number of memory leaks in cert_createJustin Chadwell2019-08-163-3/+5
| | | | | | | | | The valgrind checks for cert_create have not been run in a long while - as such there are a few memory leaks present. This patch fixes a few of the major ones reported by valgrind. However, a few do remain. Change-Id: Iab002fb2b0090043287d43fb54a4d18928c2ed85 Signed-off-by: Justin Chadwell <justin.chadwell@arm.com>
* tools/fiptool: Add Makefile.msvc to build on Windows.Girish Pathak2019-07-021-0/+30
| | | | | | | | This change adds nmake compatible Makefile.msvc file for building (nmake /FMakefile.msvc) fiptool on the Windows. Change-Id: Iccd1fe8da072edd09eb04b8622f27b3c4693b281 Signed-off-by: Girish Pathak <girish.pathak@arm.com>
* meson/gxl: Add tool to create bl31 bootable imagesRemi Pommarel2019-04-022-0/+143
| | | | | | | | GXL platforms need to have a specific header at the beginning of bl31 image to be able to boot. This adds a tool to create that and calls it at build time. Signed-off-by: Remi Pommarel <repk@triplefau.lt>
* rcar_gen3: plat: Add initial D3 supportMarek Vasut2019-04-022-5/+14
| | | | | | | Add R-Car D3 SoC platform specifics. Driver, PFC, QoS, DDR init code will be added separately. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
* tools: Remove TODO from fiptoolPaul Beesley2019-03-121-1/+0
| | | | | | | | | It is quite unlikely that this number will ever change and, if it does need to change, we should have a good reason to do so. It seems that this comment is now redundant. Change-Id: I409c764080748e338e9bc5606bbdcc475213fb6e Signed-off-by: Paul Beesley <paul.beesley@arm.com>
* tools: Remove unused cert_create definesPaul Beesley2019-03-121-4/+0
| | | | | Change-Id: Iea72ef9ba16325cbce07eea1a975d2a96eede274 Signed-off-by: Paul Beesley <paul.beesley@arm.com>
* tools/fiptool: Fix UUID parsing in blob handlingAndre Przywara2019-01-291-2/+2
| | | | | | | | | | | | Commit 033648652f ("Make TF UUID RFC 4122 compliant") changed the scanf parsing string to handle endianness correctly. However that changed the number of items sscanf handles, without adjusting the sanity check just below. Increase the expected return value from 11 to 16 to let fiptool handle UUIDs given as blob parameters correctly again. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
* SPM: sptool: Introduce tool to package SP and RDAntonio Nino Diaz2018-12-112-0/+383
| | | | | | | | This tool packages Secure Partitions and Resource Descriptor blobs into a simple file that can be loaded by SPM. Change-Id: If3800064f30bdc3d7fc6a15ffbb3007ef632bcaa Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
* Standardise header guards across codebaseAntonio Nino Diaz2018-11-0813-80/+80
| | | | | | | | | | | | | | | | | | All identifiers, regardless of use, that start with two underscores are reserved. This means they can't be used in header guards. The style that this project is now to use the full name of the file in capital letters followed by 'H'. For example, for a file called "uart_example.h", the header guard is UART_EXAMPLE_H. The exceptions are files that are imported from other projects: - CryptoCell driver - dt-bindings folders - zlib headers Change-Id: I50561bf6c88b491ec440d0c8385c74650f3c106e Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
* Merge pull request #1623 from MISL-EBU-System-SW/a3700-supportAntonio Niño Díaz2018-11-0111-0/+0
|\ | | | | Add support for Armada 3700 and COMPHY porting layer
| * tools: Move doimage to marvell folder for future add-onsKonstantin Porotchkin2018-10-2211-0/+0
| | | | | | | | | | | | | | Move doimage utility from toos/doimage to tools/marvell/doimage. This is done for supporting mode Marvell tools in the future. Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
* | Merge pull request #1632 from Yann-lms/stm32mp1_mmcSoby Mathew2018-10-181-1/+1
|\ \ | |/ |/| Add MMC support for STM32MP1
| * stm32mp1: update platform files to use MMC devicesYann Gautier2018-10-151-1/+1
| | | | | | | | Signed-off-by: Yann Gautier <yann.gautier@st.com>
* | rcar-gen3: initial commit for the rcar-gen3 boardsJorge Ramirez-Ortiz2018-10-175-0/+469
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reference code: ============== rar_gen3: IPL and Secure Monitor Rev1.0.22 https://github.com/renesas-rcar/arm-trusted-firmware [rcar_gen3] Author: Takuya Sakata <takuya.sakata.wz@bp.renesas.com> Date: Thu Aug 30 21:26:41 2018 +0900 Update IPL and Secure Monitor Rev1.0.22 General Information: =================== This port has been tested on the Salvator-X Soc_id r8a7795 revision ES1.1 (uses an SPD). Build Tested: ------------- ATFW_OPT="LSI=H3 RCAR_DRAM_SPLIT=1 RCAR_LOSSY_ENABLE=1" MBEDTLS_DIR=$mbedtls $ make clean bl2 bl31 rcar PLAT=rcar ${ATFW_OPT} SPD=opteed Other dependencies: ------------------ * mbed_tls: git@github.com:ARMmbed/mbedtls.git [devel] Merge: 68dbc94 f34a4c1 Author: Simon Butcher <simon.butcher@arm.com> Date: Thu Aug 30 00:57:28 2018 +0100 * optee_os: https://github.com/BayLibre/optee_os Until it gets merged into OP-TEE, the port requires Renesas' Trusted Environment with a modification to support power management. Author: Jorge Ramirez-Ortiz <jramirez@baylibre.com> Date: Thu Aug 30 16:49:49 2018 +0200 plat-rcar: cpu-suspend: handle the power level Signed-off-by: Jorge Ramirez-Ortiz <jramirez@baylibre.com> * u-boot: The port has beent tested using mainline uboot. Author: Fabio Estevam <festevam@gmail.com> Date: Tue Sep 4 10:23:12 2018 -0300 *linux: The port has beent tested using mainline kernel. Author: Linus Torvalds <torvalds@linux-foundation.org> Date: Sun Sep 16 11:52:37 2018 -0700 Linux 4.19-rc4 Overview --------- BOOTROM starts the cpu at EL3; In this port BL2 will therefore be entered at this exception level (the Renesas' ATF reference tree [1] resets into EL1 before entering BL2 - see its bl2.ld.S) BL2 initializes DDR (and i2c to talk to the PMIC on some platforms) before determining the boot reason (cold or warm). During suspend all CPUs are switched off and the DDR is put in backup mode (some kind of self-refresh mode). This means that BL2 is always entered in a cold boot scenario. Once BL2 boots, it determines the boot reason, writes it to shared memory (BOOT_KIND_BASE) together with the BL31 parameters (PARAMS_BASE) and jumps to BL31. To all effects, BL31 is as if it is being entered in reset mode since it still needs to initialize the rest of the cores; this is the reason behind using direct shared memory access to BOOT_KIND_BASE and PARAMS_BASE instead of using registers to get to those locations (see el3_common_macros.S and bl31_entrypoint.S for the RESET_TO_BL31 use case). Depending on the boot reason BL31 initializes the rest of the cores: in case of suspend, it uses a MBOX memory region to recover the program counters. [1] https://github.com/renesas-rcar/arm-trusted-firmware Tests ----- * cpuidle ------- enable kernel's cpuidle arm_idle driver and boot * system suspend -------------- $ cat suspend.sh #!/bin/bash i2cset -f -y 7 0x30 0x20 0x0F read -p "Switch off SW23 and press return " foo echo mem > /sys/power/state * cpu hotplug: ------------ $ cat offline.sh #!/bin/bash nbr=$1 echo 0 > /sys/devices/system/cpu/cpu$nbr/online printf "ONLINE: " && cat /sys/devices/system/cpu/online printf "OFFLINE: " && cat /sys/devices/system/cpu/offline $ cat online.sh #!/bin/bash nbr=$1 echo 1 > /sys/devices/system/cpu/cpu$nbr/online printf "ONLINE: " && cat /sys/devices/system/cpu/online printf "OFFLINE: " && cat /sys/devices/system/cpu/offline Signed-off-by: ldts <jramirez@baylibre.com>
* Merge pull request #1612 from antonio-nino-diaz-arm/an/toolsSoby Mathew2018-10-104-33/+34
|\ | | | | tools: Make invocation of host compiler correct
| * tools: Make invocation of host compiler correctAntonio Nino Diaz2018-10-044-33/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | HOSTCC should be used in any of the tools inside the tools/ directory instead of CC. That way it is possible to override both values from the command line when building the Trusted Firmware and the tools at the same time. Also, use HOSTCCFLAGS instead of CFLAGS. Also, instead of printing the strings CC and LD in the console during the compilation of the tools, HOSTCC and HOSTLD have to be used for clarity. This is how it is done in other projects like U-Boot or Linux. Change-Id: Icd6f74c31eb74cdd1c353583399ab19e173e293e Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
* | Merge pull request #1489 from teknoraver/masterSoby Mathew2018-10-101-8/+15
|\ \ | |/ |/| doimage: get rid of non null terminated strings by strncpy
| * doimage: get rid of non null terminated strings by strncpyMatteo Croce2018-09-241-8/+15
| | | | | | | | Signed-off-by: Matteo Croce <mcroce@redhat.com>
* | tools: Fix broken object compilation rulesJan Kiszka2018-10-032-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | As these rules depend on non-existing headers as well (likely copy & pasted from fiptool), they never matched, and the built-in rules were used. That led to random breakages when e.g. CPPFLAGS was suddenly evaluated and contained invalid options. For the stm32image, this reveals that we were relying on the built-in rules by passing -D_GNU_SOURCE via CPPFLAGS, rather than using CFLAGS as used in the local rule. Fix that as well. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
* | fip_create: Remove fip_create compatibility scriptdp-arm2018-09-282-133/+2
|/ | | | | | | | A compatibility script has been provided for about 2 years. Users should have migrated to fiptool by now so remove the compat script. Change-Id: I643e0c40a9e3fb428bad3be04a82cb431aad74dc Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
* fix: tools: Fix doimage syntax breaking secure mode buildKonstantin Porotchkin2018-09-031-1/+1
| | | | | | | Missing ")" in fprintf causing build break in secure boot mode. Change-Id: Ice555571683b68bb0d81479e9fc8abc4296809ac Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
* tools: doimage: Add secure image key file examplesKonstantin Porotchkin2018-09-038-0/+194
| | | | | | | | | | | Add example keys for building trusted flash images using doimage tools. Similar files can be generated using openssl or mbedtls. Marvell platform make files are using trusted boot configurations from this example etst vector. Change-Id: I38a2e295171bee4c14005ce6f020b352c683496e Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
* tools: Add stm32image tool into TF-AYann Gautier2018-07-242-0/+296
| | | | | | | | This tools adds a specific header to ST TF-A binary. This header is used by STM32MP1 ROM code to check the bootloader. Signed-off-by: Yann Gautier <yann.gautier@st.com> Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
* Merge pull request #1450 from MISL-EBU-System-SW/marvell-support-v6danh-arm2018-07-193-0/+1818
|\ | | | | Marvell support for Armada 8K SoC family
| * tools: add support for Marvell doimageKonstantin Porotchkin2018-07-183-0/+1818
| | | | | | | | | | | | | | | | | | | | Add Marvell "doimage" utility support. The "doimage" utility allows to create flash images compatible with Marvell BootROM image format. Additionally this tool allows the flash image parsing and verification. Change-Id: Ie8d7ccd0cc2978684e7eecb695f375395fc749ee Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
* | tools/cert_create: fix makefile to build build_msg.o by HOSTCCYing-Chun Liu (PaulLiu)2018-07-061-1/+1
| | | | | | | | | | | | | | Previously build_msg.o is built by CC. It causes FTBFS when CC is not equal to HOSTCC. Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
* | make_cert: return error when invalid options are usedRoberto Vargas2018-06-271-3/+1
|/ | | | | | | | | Print_help was used in different contexts and returning no error in that function was hiding the error when incorrect options were used. Change-Id: Ic3f71748be7ff8440c9d54810b986e9f177f4439 Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
* Make TF UUID RFC 4122 compliantRoberto Vargas2018-06-142-18/+23
| | | | | | | | | | | RFC4122 defines that fields are stored in network order (big endian), but TF-A stores them in machine order (little endian by default in TF-A). We cannot change the future UUIDs that are already generated, but we can store all the bytes using arrays and modify fiptool to generate the UUIDs with the correct byte order. Change-Id: I97be2d3168d91f4dee7ccfafc533ea55ff33e46f Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
* Dynamic cfg: Enable support on CoT for other configsSoby Mathew2018-05-185-7/+58
| | | | | | | | | | This patch implements support for adding dynamic configurations for BL31 (soc_fw_config), BL32 (tos_fw_config) and BL33 (nt_fw_config). The necessary cert tool support and changes to default chain of trust are made for these configs. Change-Id: I25f266277b5b5501a196d2f2f79639d838794518 Signed-off-by: Soby Mathew <soby.mathew@arm.com>
* Merge pull request #1374 from jonathanwright-ARM/jw/fix-memory-leaks-in-fiptooldanh-arm2018-05-031-1/+4
|\ | | | | Fix memory leaks in fiptool
| * tools/fiptool: fix memory leaks in fiptoolJonathan Wright2018-05-031-1/+4
| | | | | | | | | | | | | | | | Free desc->image->buffer before freeing desc->image. We make sure that the desc->image is non-null before attempting this. Change-Id: I35c5674629a41d7cf1a78b7b41ca4b930d0fb688 Signed-off-by: Jonathan Wright <jonathan.wright@arm.com>
* | cert_create: fix makefile to remove executable on 'make realclean'Jonathan Wright2018-04-301-1/+1
|/ | | | | | | | Spurious whitespace existed in the BINARY shell variable which meant the cert_tool executable was not being removed on 'make realclean'. Change-Id: Ibfd2fd17889514f6613e33c6df58d53b9232ec14 Signed-off-by: Jonathan Wright <jonathan.wright@arm.com>
* Change PLATFORM_ROOT to TF_PLATFORM_ROOTHeyi Guo2018-03-051-1/+1
| | | | | | | | Since we use "?=" to set PLATFORM_ROOT, it is better to change the name to be more special, or else it may be overridden by some environment variables, such as in some CI build environments. Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
* Dynamic cfg: Update the toolsSoby Mathew2018-02-264-7/+41
| | | | | | | | | | | | | This patch updates the `fiptool` and `cert_create` for the `hw_config` and `tb_fw_config` dynamic configuration files. The necessary UUIDs and OIDs are assigned to these files and the `cert_create` is updated to generate appropriate hashes and include them in the "Trusted Boot FW Certificate". The `fiptool` is updated to allow the configs to be specified via cmdline and included in the generated FIP. Change-Id: I940e751a49621ae681d14e162aa1f5697eb0cb15 Signed-off-by: Soby Mathew <soby.mathew@arm.com>
* fiptool: Fix use after freeAndreas Färber2018-01-271-1/+1
| | | | | | | | | | Commit 880b9e8b4c99ad99eee14079d5a6162733ef4931 (Add padding at the end of the last entry) added code using toc_entry pointer, whose memory is already freed via variable buf. This causes enormous padding on openSUSE. Free the memory buffer only after padding is done. Signed-off-by: Andreas Färber <afaerber@suse.de>