blob: 5c0024b29e3d939b0620dac87dd101d55ddbb43d [file] [log] [blame]
Patrick Williams8e7b46e2023-05-01 14:19:06 -05001From 7914ec3f96dbb8228e791d9492cfc3651cf9deca Mon Sep 17 00:00:00 2001
2From: Emekcan Aras <emekcan.aras@arm.com>
3Date: Wed, 5 Apr 2023 10:28:57 +0100
4Subject: [PATCH] Platform: corstone1000: Fix Flash reading issue for FIP data
5
6Fixes the flash reading issue since bl2 needs to read the data from
7flash in XIP mode on FPGA (mps3).
8
9Upstream-Status: Submitted [https://review.trustedfirmware.org/c/TF-M/trusted-firmware-m/+/20558]
10Signed-off-by: Emekcan Aras <emekcan.aras@arm.com>
11---
12 platform/ext/target/arm/corstone1000/bl2/boot_hal_bl2.c | 3 ++-
13 1 file changed, 2 insertions(+), 1 deletion(-)
14
15diff --git a/platform/ext/target/arm/corstone1000/bl2/boot_hal_bl2.c b/platform/ext/target/arm/corstone1000/bl2/boot_hal_bl2.c
16index cf6340c5a9..e4183c7a57 100644
17--- a/platform/ext/target/arm/corstone1000/bl2/boot_hal_bl2.c
18+++ b/platform/ext/target/arm/corstone1000/bl2/boot_hal_bl2.c
19@@ -89,6 +89,7 @@ static bool fill_flash_map_with_fip_data(uint8_t boot_index) {
20
21 /* parse directly from flash using XIP mode */
22 /* FIP is large so its not a good idea to load it in memory */
23+ Select_XIP_Mode_For_Shared_Flash();
24 result = parse_fip_and_extract_tfa_info(
25 FLASH_BASE_ADDRESS + fip_offset + FIP_SIGNATURE_AREA_SIZE, fip_size,
26 &tfa_offset, &tfa_size);
27@@ -96,7 +97,7 @@ static bool fill_flash_map_with_fip_data(uint8_t boot_index) {
28 BOOT_LOG_ERR("parse_fip_and_extract_tfa_info failed");
29 return false;
30 }
31-
32+ Select_Write_Mode_For_Shared_Flash();
33 flash_map[2].fa_off = fip_offset + FIP_SIGNATURE_AREA_SIZE + tfa_offset;
34 flash_map[2].fa_size = tfa_size;
35 flash_map[3].fa_off = flash_map[2].fa_off + flash_map[2].fa_size;
36--
372.17.1
38