aboutsummaryrefslogtreecommitdiff
path: root/bl2
AgeCommit message (Collapse)Author
7 daysBoot: Integrate MCUboot based on mbedtls-3.0.0Sherry Zhang
Change-Id: Ia4150d99c8a4c0f73e94030864bb6baf7e75ef49 Signed-off-by: Sherry Zhang <sherry.zhang2@arm.com>
7 daysBoot: Update MCUboot to version 4f80913Sherry Zhang
Change-Id: If9e5749694300c22b4c8857c9c06f355bc4d0a46 Signed-off-by: Sherry Zhang <sherry.zhang2@arm.com>
2021-06-09FWU: Remove obsolete comment.Sherry Zhang
Change-Id: Ifa732eceb06a2248d562f4c68e84b0488e8089db Signed-off-by: Sherry Zhang <sherry.zhang2@arm.com>
2021-06-04Boot: Add checking build address in DIRECT_XIP strategySherry Zhang
In DIRECT_XIP MCUboot upgrade strategy, MCUboot checks the image running address if the IMAGE_F_ROM_FIXED flag is set in image header. This commit sets this flag and the target running address in the image header in DIRECT_XIP strategy. Change-Id: I8168e176e8fe47847abca1278bf05de1c1ff6d64 Signed-off-by: Sherry Zhang <sherry.zhang2@arm.com>
2021-05-17mcuboot: make mbedcrypto config file configurableIoannis Glaropoulos
Change the mbedtls config file path for mcuboot to being configurable by the user. For that we introduce a new CMake variable, called MCUBOOT_MBEDCRYPTO_CONFIG_PATH. Change-Id: I14701b8301f039f0eb081919a2589bcca7936e8f Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-05-06BOOT: Fix include path for MCUBOOT_FIH_PROFILE HIGNMichel Jaouen
conf dir path is needed to compile mcuboot-src file bootutil/src/fault_injection_hardening_delay_rng_mbedtls.c Change-Id: I547b37f067bed14e2acdd936402b95349b3790f1 Signed-off-by: Michel Jaouen <michel.jaouen@st.com>
2021-04-22Build: Fix imgtool package path setSherry Zhang
The imgtool from upstream MCUBoot repo is perferred. Change-Id: I6681431447f9e0fc7830c71b1a7c888ea46d989b Signed-off-by: Sherry Zhang <sherry.zhang2@arm.com>
2021-03-19Boot: Move Mbed TLS configuration file for MCUbootRobert Rostohar
Move the configuration template to a standalone 'config' directory. Enables support for CMSIS-Packs. Avoids that the configuration template from the pack is in the include search path together with other include files from the same 'include' directory. Configuration file is copied to the project and its directory is added to the include search path. Signed-off-by: Robert Rostohar <Robert.Rostohar@arm.com> Change-Id: I39afeafdcbf26e83a73c711cf1ae86e5e2667b1d
2021-03-19Build: Fix MCUboot image dependency checkingRaef Coles
Previously the secure image was depeding on the version of the secure image, and the NS on the NS. Now the NS correctly depends on S and S depends on NS. Update the documentation strings of the image dependency cmake options to be more clear. Remove dependency in image when MCUBOOT_IMAGE_NUMBER == 1 as it isn't checked in that case. Change-Id: I32557678cc9cdc8485fb812b2b08e5667b2fd9c0 Signed-off-by: Raef Coles <raef.coles@arm.com>
2021-03-19FWU: Add Firmware Update partitionSherry Zhang
Firmware Update(FWU) partition provides the functionality of updating firmware images. This patch implemented the partition in Library mode. Change-Id: I736477549b055c64cd8106ad57c3ad7b1b2007ee Signed-off-by: Sherry Zhang <sherry.zhang2@arm.com>
2021-03-12BL2: Validate target access address in flash_map.cSherry Zhang
Before accessing the target access address in flash_area_xxx operation in flash_map.c, check whether the address is within the size of the area. Change-Id: I8a9a5f72b6a0a54b8f100d342c6868d7a8817733 Signed-off-by: Sherry Zhang <sherry.zhang2@arm.com>
2021-02-23Introduce end-of-line normalizationKevin Peng
Change-Id: Ia78df87957163ad6dd65b9b72cf539a96e57ddf4 Signed-off-by: Kevin Peng <kevin.peng@arm.com>
2021-01-22Build: Create NS signing layout even if NS build is disabledMark Horvath
The NS signing layout is a build output even if NS side was not built, so it is neecessary to create it always. Change-Id: Ifa30d7988b6a34cf95dde322952ed097c2ece686 Signed-off-by: Mark Horvath <mark.horvath@arm.com>
2020-12-18Boot: Add multiple flash driver supportMichel Jaouen
(T862) External flash support on stm uses 2 drivers : - internal flash slot 0/1, scratch : driver internal flash - external flash slot 2/3 : octospi driver external flash Change-Id: I58d86a48081ad0bca3dda961318a15fe17248a93 Signed-off-by: Michel Jaouen <michel.jaouen@st.com>
2020-12-17Build: Use upstream bootutil cmakeRaef Coles
To allow easier integration of changes to bootutil structure. Also, bump MCUboot version to one where the bootutil cmake is present. Change-Id: I97547480267f69711494b53aee500a4925eb43b7 Signed-off-by: Raef Coles <raef.coles@arm.com>
2020-12-17Build: Extend code sharingBalint Matyi
Utilize the additional opportunities for code sharing that are made possible by applying the patch in the previous commit. Allow data ('D') symbols to be shared. Also allow for empty lines in the symbol template file. Signed-off-by: Balint Matyi <Balint.Matyi@arm.com> Change-Id: Ife5fc6011c678c8f43e53d8cc087f40e32871301
2020-12-17Build: Add mbedtls patch to help code sharingTamas Ban
Adds a patch file that, when applied to mbedtls, will remove the 'static' keyword from some function pointers related to memory allocation. This allows more functions to be shared between MCUboot and the secure firmware. Signed-off-by: Balint Matyi <Balint.Matyi@arm.com> Change-Id: Ibc6cbb3ab18fccc92a5b8608b9f1ef54c1136d2f
2020-12-17Build: Enable code sharing between bootloader and SPETamas Ban
Add CMake functions to allow sharing regions of code between independently linked binaries. Signed-off-by: Tamas Ban <tamas.ban@arm.com> Change-Id: I6a6132d6c1558b242d8da1dedab14f93a852f81a
2020-12-10Platform: Add support to forward PSA msg in Musca-B1Mark Horvath
PSA RoT messages can be forwarded from the SSE-200 subsystem to the Secure Enclave in Musca-B1. Change-Id: Iab2c525cf41eae34585fb16a4b9bab941e6c7587 Signed-off-by: Gabor Abonyi <gabor.abonyi@arm.com> Signed-off-by: Mark Horvath <mark.horvath@arm.com>
2020-12-10Build: Fix image signing if only S side is builtMark Horvath
If there is no NS side to be built the S side signed binary added to the make targets. In addition in case of NS build if MCUBOOT_IMAGE_NUMBER is equal to 1 NS signed binary is not created, as it is not needed in such a situation. Change-Id: I1125402aaad273946f353ed71558aafa84a9a820 Signed-off-by: Mark Horvath <mark.horvath@arm.com>
2020-11-17Boot: Update MCUboot urlTamas Ban
MCUboot URL was changed from https://github.com/JuulLabs-OSS/mcuboot to https://github.com/mcu-tools/mcuboot Signed-off-by: Tamas Ban <tamas.ban@arm.com> Change-Id: If5e3d103ed420258046b7cf1071d36bf5e883476
2020-11-03Build: Refactor toolchain filesRaef Coles
Change from a CMAKE toolchain file to a TFM toolchain file, avoiding some abuses of the CMAKE_TOOLCHAIN_FILE that were used as a workaround for compiler setup. Also add the CROSS_COMPILE variable. Bump cmake required version to 3.15. Change-Id: I0948033045e2d2f34beffa807925fc7375098335 Signed-off-by: Raef Coles <raef.coles@arm.com>
2020-10-30Build: add compat for mbedtls patch upstreamingRaef Coles
Add build options for compatibility with patches being upstreamed to mbedtls. Update header paths in CC312 lib. This keeps compatibility with current patches. Change-Id: I09791019ff6825ec74af95e84a2b27e42dfd20f8 Signed-off-by: Raef Coles <raef.coles@arm.com>
2020-10-29Build: Update IAR cmake files, fix Windows build errorsTTornblom
Fixed regex issue in toolchain_IARARM.cmake, causing Windows build errors Moved --map option from toolchain file to CMakeLists.txt files, like for ARMClang and GNUARM Removed dead code from toolchain_IARARM.cmake Renamed IAR RTX libraries in CMakeLists.txt Signed-off-by: TTornblom <thomas.tornblom@iar.com> Change-Id: I01805f59a5be0ca4cd2bf47f20dd4a8852c1ea54
2020-10-28Boot: Add CTR mode support to mbedcrypto configRaef Coles
Used by the encrypted image support in MCUboot. Change-Id: Icc77eb18d81e418c0f02e8824a640498f699d692 Signed-off-by: Raef Coles <raef.coles@arm.com>
2020-10-05Boot: Harden critical path against fault attacksTamas Ban
Add fault attack mitigation measures to code which is vital for the correct validation of images. Change-Id: Iea12a6eac9c3f516ed8c96a6df44b7a4086dd7f5 Signed-off-by: Raef Coles <raef.coles@arm.com> Signed-off-by: Tamas Ban <tamas.ban@arm.com>
2020-10-02Build: Fix CC312 init skip issue on Musca-B1/S1Tamas Ban
Accidentally the initialization of CC312 crypto accelerator was skipped on Musca boards. Therefore at execution the CPU stuck in an infinite loop. Signed-off-by: Tamas Ban <tamas.ban@arm.com> Change-Id: I29e8c8b1ace300a7d44efb1dcd1ffe86e1becb21
2020-09-30Boot: Rename RAM_LOADING to RAM_LOADTamas Ban
To be aligned with the original MCUboot repo. Change-Id: Icbd3c80a016584741fca056305f5bf5b0436182c Signed-off-by: Tamas Ban <tamas.ban@arm.com>
2020-09-30Boot: Remove platform specific code from bl2_main.cDavid Vincze
Clean-up bl2_main.c and move all platform dependent code to appropriate boot_hal.c Signed-off-by: Balint Matyi <Balint.Matyi@arm.com> Change-Id: Ieef1896ca6a0afc15c513bc4aa0acf3fa1a06c7a
2020-09-30Boot: Remove forked MCUboot from TF-MBalint Matyi
Remove the generic MCUboot source files from TF-M in order to rely only on upstream MCUboot project as a secure second stage bootloader. At this point all the features from the internal fork are already upstreamed to the original project so from feature point of view the switch is seamless. From now on any new development is going to be directly upstreamed to the original project. Some platform and project specific files and scripts are still kept in the bl2/ext/mcuboot folder to make possible the integration with TF-M project. Signed-off-by: Balint Matyi <Balint.Matyi@arm.com> Signed-off-by: Tamas Ban <Tamas.Ban@arm.com> Change-Id: I261c11383202d02eecff06c21d5c51d6ec8f27ea
2020-09-30Boot: Rename NO_SWAP upgrade strategy to DIRECT_XIPTamas Ban
The NO_SWAP upgrade strategy was upstreamed to the mainline MCUboot repo, but the feature was renamed to DIRECT_XIP. This change do the same renaming in TF-M to be aligned with the mainline repo, because the MCUboot fork is going to be removed from the TF-M repository. Change-Id: I63201a5319a68394d45d753a700444cdc848b5dc Signed-off-by: Tamas Ban <tamas.ban@arm.com>
2020-09-25Build: Fix minor issues with new buildsystemRaef Coles
Several minor bugfixes: * Add error messages for unsupported generators / compilers * Remove unsupported warning disablement option on IAR * Fix typo in error message Change-Id: I492872d5af5e507d52e2f9f1fbb28f39359349ee Signed-off-by: Raef Coles <raef.coles@arm.com>
2020-09-24Build: Convert bl2 dir to modern cmakeRaef Coles
Alters cmake files inside the bl2 directory. Moves some bl2 files to mirror the directory structure of upstream MCUboot. Renames some of the key files to allow easier programmatic selection. Alters some headers where the include paths have changed. WARNING: This change will not build in isolation, it requires _all_ other cmake changes to successfully build. It is split out only for clarity of changes. Change-Id: I8fe822d982d5e1635fb3176135e33bc3acf9163a Signed-off-by: Raef Coles <raef.coles@arm.com>
2020-08-21Crypto: migrate support to MbedTLS v2.23.0Soby Mathew
This patch migrates the mbedcrypto dependancy for TF-M to mbedTLS repo v2.23.0 which is the latest release tag. The PSA crypto headers and the crypto service implementation in TF-M is updated for additional functionality in this version. The userguide and other relevant documentation are updated to reflect the changes to location of repo. Signed-off-by: Soby Mathew <soby.mathew@arm.com> Change-Id: Ia7d3f95dc961c5815eb4416d2afbd90ec5c0c19e
2020-08-13Boot : Fix boot_platform_quitMichel Jaouen
According to compiler and optimization: - registers used to retrieve vt_cpy are pushed in sp, - sp is modified before calling boot_jump_to_next_image(i.e if some non scratch registers have been used),this creates an incorrect sp. Change-Id: I866ac756d3611f67636b99b10d340c77dd12b148 Signed-off-by: Michel Jaouen <michel.jaouen@st.com>
2020-07-30Build: Single quotes to double quotes for paramsKen Liu
Found python under windows would include single quotes into the final combined command line and cause 'wrapper.py' failed to parse the parameters. Change it into double-quotes since they won't cause this problem. Signed-off-by: Ken Liu <ken.liu@arm.com> Change-Id: Icc8df2b753a50583bd2be5a1db50f4abdf03a235
2020-07-22Boot: Add encrypted image supportBalint Matyi
Introduces the 'MCUBOOT_ENCRYPT_RSA' compile time switch. When set to 'ON', adds encrypted image support in the BL2 source and encrypts the signed images. As a result, BL2 can now accept an encrypted image for upgrade and decrypt it when applying. It can also re-encrypt the original image if it is kept and moved back to the secondary slot. Change-Id: I998861c7175c136eed60ac13c802134705b5c3f3 Signed-off-by: Balint Matyi <Balint.Matyi@arm.com>
2020-07-22Boot: Use the PyPI version of imgtoolBalint Matyi
Modifies the Python wrapper for imgtool in TF-M to use the PyPI version instead of the one in the MCUBoot repository. Signed-off-by: Balint Matyi <Balint.Matyi@arm.com> Change-Id: I0b3fb9c802c59628cced0962241a1b4573a00cfc
2020-07-22Boot: Use the MCUBoot version of the imgtool.Balint Matyi
Uses the MCUBoot version of the imgtool. Adds a Python wrapper script to work around its altered interface. Change-Id: I9dc98f254f26de8d379e544a2c59fa6f08d42341 Signed-off-by: Balint Matyi <Balint.Matyi@arm.com>
2020-06-30Build: Find MCUBOOT_REPO only if BL2 is enabledRaymond Ngun
If BL2 is disabled, there is no purpose in checking MCUBoot path. Change-Id: I62536c84b7744e933584f071aa30a6e6d59e9ca2 Signed-off-by: Raymond Ngun <raymond.ngun@cypress.com>
2020-06-24Build: Enable using HW keys with upstream MCUbootDavid Vincze
Modify the build system (by removing restrictions) to allow HW key usage for image authentication when the 'UPSTREAM' MCUboot repository is selected as MCUboot v1.6.0 (current default bootloader) already includes this feature. Change-Id: Ifa7de6a26febb8b140b409f63fc8c059ed2c3278 Signed-off-by: David Vincze <david.vincze@linaro.org>
2020-06-24Build: Enable boot data sharing with UPSTREAMDavid Vincze
Modify the build system (by removing restrictions) to allow boot data sharing (measured boot) when the 'UPSTREAM' MCUboot repository is selected as MCUboot v1.6.0 (current default bootloader) already includes this feature. Move target specific macros definitions to target specific header files so that they are not only available in TF-M's MCUboot fork. Change-Id: Ib30976419d9d668e588c2e4fdb9f42d90d57a7e2 Signed-off-by: David Vincze <david.vincze@linaro.org>
2020-06-24Build: Enable HW rollback protection with UPSTREAMDavid Vincze
Modify the build system (by removing restrictions) to allow HW rollback protection when the 'UPSTREAM' MCUboot repository is selected as MCUboot v1.6.0 (current default bootloader) already includes this feature. Change-Id: I5ee1c347986275e3da18960801b7503e8f3b4768 Signed-off-by: David Vincze <david.vincze@linaro.org>
2020-06-24Boot: Set the default MCUBoot repo to 'UPSTREAM'Balint Matyi
Replace the TF-M default bootloader from the TF-M's version of MCUBoot to the original MCUboot project. The fork is intended to be removed in the future. Signed-off-by: Balint Matyi <Balint.Matyi@arm.com> Change-Id: I9c7c55ed6490712f1b24d4f4eb79db4bdbb23b83
2020-06-22Boot: Add boot_plaftorm_quit to boot_hal templateMichel Jaouen
This enables specific platform operations before launching the secure application. Change-Id: I6c87662aefadac6552e0b65f35000cfc73735fd2 Signed-off-by: Michel Jaouen <michel.jaouen@st.com>
2020-06-19Build: Create hex and elf files of executablesØyvind Rønningstad
Install hex and elf files to the same location as the axf and bin files Change-Id: I20a54560e733df875705f98b0ec3c3a1f5a01657 Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2020-06-15Config: Add stm targets in single entry pointLudovic Barre
This patch allows to group all stm targets in single cmake entry point. The stm TARGET_PLATFORM should prefix by "STM". stm platforms supports CoreIPC, CoreIPCTfmLevel2 and RegressionIPCTfmLevel2 Build with GNUARM toolchain. Change-Id: I6535420b2304c18f2ab260620c38fef632eb7488 Signed-off-by: Ludovic Barre <ludovic.barre@st.com> Signed-off-by: Michel Jaouen <michel.jaouen@st.com>
2020-06-08Boot: Replace hard-coded image indexDavid Vincze
Fix1: replace hard-coded value with the image index variable. It remained from when only 1 image was supported by the rollback protection mechanism. Fix2: typo in NV counter identifier. Change-Id: Iaa275d02ad34ca6e95a01a0d3f85fd190d44bc3d Signed-off-by: David Vincze <david.vincze@linaro.org>
2020-06-08Boot: Fix misplaced preprocessor directiveDavid Vincze
Fix misplaced preprocessor directive which caused the bootloader to use the NO_SWAP strategy as default instead of overwrite-only. Fix "maximum line length" coding rule violations. Change-Id: Ib82fb567912873add2c5b4407c59deb92791dbaa Signed-off-by: David Vincze <david.vincze@linaro.org>
2020-06-04Boot: Add requirements.txt fileKevin Townsend
This commit adds a requirements.txt file listing the requirements for the image signing script, etc. Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org> Change-Id: I3c19c06046cc051113ea80ad370e56c56c45a999