aboutsummaryrefslogtreecommitdiff
path: root/bl2/src/flash_map.c
AgeCommit message (Collapse)Author
2022-11-29RSS: Add dma driver and library to boot platformMaulik Patel
* Initializes dma during boot platform init. * Adds service function for blocking mode to be used by the bootloader. Signed-off-by: Maulik Patel <maulik.patel@arm.com> Change-Id: Ic5a4f9845a7246ff5ee072fd024d1930519750ac
2022-11-02BL2: Fix indentationMichel Jaouen
Change-Id: Ib9d46cd0de58942a91b786eb4ba9b99b04354f26 Signed-off-by: Michel Jaouen <michel.jaouen@st.com>
2022-05-16FWU: Add a platform specific flash_driver initMichel Jaouen
For flash driver used only for FWU (i.e only secondary slot on external flash), no driver init is done. Change-Id: I4ad4b6f6075bd0d3ee5049237be54d873c915a70 Signed-off-by: Michel Jaouen <michel.jaouen@st.com>
2022-03-10Platform: Move data_width_byte variable from RAM to FlashSherry Zhang
If the const variable is defined as local variable, then it is stored in Flash and loaded to RAM(stack) when it runs. If it is defined as file static, its runtime address will be allocated in Flash. So copy to RAM is avoided and Flash cost remains the same. Signed-off-by: Sherry Zhang <sherry.zhang2@arm.com> Change-Id: I701a6cf01abc5a6d587aa7c263dec0a221487e5c
2022-01-20Fix CppCheck ErrorsXinyu Zhang
The variable 'data_width_byte' declared for flash driver is recommended to be a const variable by CppCheck. Signed-off-by: Xinyu Zhang <xinyu.zhang@arm.com> Change-Id: Ie8f84c425c8def046bc50dfde82137e1d95c8296
2022-01-20Platform: Align flash driver to CMSIS Flash APIsSherry Zhang
There is a known misalignment with the current CMSIS Flash interface in TF-M: currently TF-M expects and returns the size whereas CMSIS Flash specifies the number of elements. This patch is to eliminate this misalignment. Signed-off-by: Sherry Zhang <sherry.zhang2@arm.com> Change-Id: I63ffda1ca4bc2e9c99b208df4a2a985f5581ee24
2021-12-22Cppcheck: Fix warnings with updated tf-m-ci-scriptsAntonio de Angelis
Several cppcheck warnings are fixed in the following modules: - Interface - Partitions: Crypto/ITS/PS/Platform - SPRTL headers - Various headers Signed-off-by: Antonio de Angelis <antonio.deangelis@arm.com> Change-Id: I08c9fa10895c0b723a2d8b3cdcd386b1752facaa
2021-10-05Platform: Add IAR support for Musca S1TTornblom
Signed-off-by: TTornblom <thomas.tornblom@iar.com> Change-Id: I6c64d842d92d023c36d64ab1406f9f9544cb7d4e
2021-09-09FWU: Fix the bug in flash_area_read in flash_map.cSherry Zhnag
Signed-off-by: Sherry Zhang <sherry.zhang2@arm.com> Change-Id: If61ca93cb441cf0b0d2963c45f53ddf42a9728c6
2021-09-08Boot & FWU: Support flash write with unaligned address/sizeSherry Zhnag
MCUboot and FWU can call the flash_area_write to write the flash with. Failure happens in the flash driver if the target address or the write size is not program unit aligned. Signed-off-by: Sherry Zhnag <sherry.zhang2@arm.com> Change-Id: I8b4eeae7348903805a9ffc12cac5b9106d09c1a6
2021-08-04Build: Make possible to overwrite BL2 sourcesMark Horvath
This commit introduces two cmake flags to let a platform overwrite BL2 related implementations created by the TF-M project. - Setting DEFAULT_MCUBOOT_FLASH_MAP to OFF makes possible for a platform to create custom flash map. - Setting DEFAULT_MCUBOOT_SECURITY_COUNTER to OFF makes possible for a platform to use custom security counter mapping. Change-Id: Ib1955e63e78dd5a5a7dff67a49dab1d5d1a06fc1 Signed-off-by: Mark Horvath <mark.horvath@arm.com> Signed-off-by: Satish Kumar <satish.kumar01@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>
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-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-01-27Boot: Use the same flash_map module as upstream MCUBootDavid Vincze
Add new sysflash.h and flash_map_extended.h files as they are needed to build TF-M with the original MCUBoot. Some of the macro definitions and function declarations from flash_map.h were moved into these new headers. Change-Id: I9b5ddeba9528c82c7ccfc59fbba5c661f0ad1084 Signed-off-by: David Vincze <david.vincze@arm.com>
2019-12-16Boot: Synchronize MCUBoot code baseDavid Vincze
Perform a partial synchronization between the MCUBoot files in TF-M and in the original repository. The hash of the source commit in the original repository: 4f0ea747c314547daa6b6299ccbd77ae4dee6758. Main changes: - Remove current_image global variable and make it part of the boot state struct - Update routines to receive the boot state by parameter - Refactor dependency check functions - Reorganize the flash map and related files - Fix swap status control Change-Id: Ibe948792b306e96282fb82447bb3f05a0c6389ef Signed-off-by: David Vincze <david.vincze@arm.com>