1b4315306SDan Handley /* 28187b95eSJayanth Dodderi Chidanand * Copyright (c) 2015-2025, Arm Limited and Contributors. All rights reserved. 3b4315306SDan Handley * 482cb2c1aSdp-arm * SPDX-License-Identifier: BSD-3-Clause 5b4315306SDan Handley */ 6b4315306SDan Handley 7a8aa7fecSYatharth Kochar #include <assert.h> 8b4315306SDan Handley #include <string.h> 909d40e0eSAntonio Nino Diaz 1009d40e0eSAntonio Nino Diaz #include <platform_def.h> 1109d40e0eSAntonio Nino Diaz 12deb4b3a6SZelalem Aweke #include <arch_features.h> 1309d40e0eSAntonio Nino Diaz #include <arch_helpers.h> 1409d40e0eSAntonio Nino Diaz #include <common/bl_common.h> 1509d40e0eSAntonio Nino Diaz #include <common/debug.h> 1609d40e0eSAntonio Nino Diaz #include <common/desc_image_load.h> 1709d40e0eSAntonio Nino Diaz #include <drivers/generic_delay_timer.h> 18ef1daa42SManish V Badarkhe #include <drivers/partition/partition.h> 199814bfc1SLouis Mayencourt #include <lib/fconf/fconf.h> 2082869675SManish V Badarkhe #include <lib/fconf/fconf_dyn_cfg_getter.h> 21f19dc624Sjohpow01 #include <lib/gpt_rme/gpt_rme.h> 22a5566f65SHarrison Mutai #if TRANSFER_LIST 23b5d0740eSHarrison Mutai #include <transfer_list.h> 24a5566f65SHarrison Mutai #endif 2509d40e0eSAntonio Nino Diaz #ifdef SPD_opteed 2609d40e0eSAntonio Nino Diaz #include <lib/optee_utils.h> 2709d40e0eSAntonio Nino Diaz #endif 2809d40e0eSAntonio Nino Diaz #include <lib/utils.h> 29bd9344f6SAntonio Nino Diaz #include <plat/arm/common/plat_arm.h> 3009d40e0eSAntonio Nino Diaz #include <plat/common/platform.h> 3109d40e0eSAntonio Nino Diaz 32b4315306SDan Handley /* Data structure which holds the extents of the trusted SRAM for BL2 */ 33b4315306SDan Handley static meminfo_t bl2_tzram_layout __aligned(CACHE_WRITEBACK_GRANULE); 34b4315306SDan Handley 35a07c101aSManish V Badarkhe /* Base address of fw_config received from BL1 */ 369c11ed7eSHarrison Mutai static uintptr_t config_base __unused; 37a07c101aSManish V Badarkhe 38*fe3299d1SXialin Liu #if ARM_GPT_SUPPORT 39*fe3299d1SXialin Liu // FIXME: should be removed once the transfer list version is updated 40*fe3299d1SXialin Liu #define TL_TAG_GPT_ERROR_INFO 0x109 41*fe3299d1SXialin Liu 42*fe3299d1SXialin Liu /* 43*fe3299d1SXialin Liu * Inform the GPT corruption to BL32. 44*fe3299d1SXialin Liu */ 45*fe3299d1SXialin Liu static void arm_set_gpt_corruption(uintptr_t gpt_corrupted_info_ptr, uint8_t flags) 46*fe3299d1SXialin Liu { 47*fe3299d1SXialin Liu *(uint8_t *)gpt_corrupted_info_ptr |= flags; 48*fe3299d1SXialin Liu } 49*fe3299d1SXialin Liu 50*fe3299d1SXialin Liu static void arm_get_gpt_corruption(uintptr_t log_address, uint8_t gpt_corrupted_info) 51*fe3299d1SXialin Liu { 52*fe3299d1SXialin Liu #if TRANSFER_LIST 53*fe3299d1SXialin Liu /* Convey this information to BL2 via its TL. */ 54*fe3299d1SXialin Liu struct transfer_list_entry *te = transfer_list_add( 55*fe3299d1SXialin Liu (struct transfer_list_header *)log_address, 56*fe3299d1SXialin Liu TL_TAG_GPT_ERROR_INFO, 57*fe3299d1SXialin Liu sizeof(gpt_corrupted_info), 58*fe3299d1SXialin Liu (void *)&gpt_corrupted_info); 59*fe3299d1SXialin Liu if (te == NULL) { 60*fe3299d1SXialin Liu ERROR("Failed to log GPT corruption info in transfer list\n"); 61*fe3299d1SXialin Liu } 62*fe3299d1SXialin Liu #endif /* TRANSFER_LIST */ 63*fe3299d1SXialin Liu } 64*fe3299d1SXialin Liu 65*fe3299d1SXialin Liu static struct plat_log_gpt_corrupted arm_log_gpt_corruption = { 66*fe3299d1SXialin Liu .gpt_corrupted_info = 0U, 67*fe3299d1SXialin Liu .plat_set_gpt_corruption = arm_set_gpt_corruption, 68*fe3299d1SXialin Liu .plat_log_gpt_corruption = arm_get_gpt_corruption, 69*fe3299d1SXialin Liu }; 70*fe3299d1SXialin Liu #endif /* ARM_GPT_SUPPORT */ 71*fe3299d1SXialin Liu 72caf4eca1SSoby Mathew /* 7304e06973SManish V Badarkhe * Check that BL2_BASE is above ARM_FW_CONFIG_LIMIT. This reserved page is 74c099cd39SSoby Mathew * for `meminfo_t` data structure and fw_configs passed from BL1. 75caf4eca1SSoby Mathew */ 769c11ed7eSHarrison Mutai #if TRANSFER_LIST 779c11ed7eSHarrison Mutai CASSERT(BL2_BASE >= PLAT_ARM_EL3_FW_HANDOFF_BASE + PLAT_ARM_FW_HANDOFF_SIZE, 789c11ed7eSHarrison Mutai assert_bl2_base_overflows); 798d5c7627SDivin Raj #elif !RESET_TO_BL2 8004e06973SManish V Badarkhe CASSERT(BL2_BASE >= ARM_FW_CONFIG_LIMIT, assert_bl2_base_overflows); 819c11ed7eSHarrison Mutai #endif /* TRANSFER_LIST */ 82caf4eca1SSoby Mathew 83a8aa7fecSYatharth Kochar /* Weak definitions may be overridden in specific ARM standard platform */ 840c306cc0SSoby Mathew #pragma weak bl2_early_platform_setup2 85a8aa7fecSYatharth Kochar #pragma weak bl2_platform_setup 86a8aa7fecSYatharth Kochar #pragma weak bl2_plat_arch_setup 87a8aa7fecSYatharth Kochar #pragma weak bl2_plat_sec_mem_layout 88a8aa7fecSYatharth Kochar 894bb72c47SZelalem Aweke #define MAP_BL2_TOTAL MAP_REGION_FLAT( \ 904bb72c47SZelalem Aweke bl2_tzram_layout.total_base, \ 914bb72c47SZelalem Aweke bl2_tzram_layout.total_size, \ 92875423deSOlivier Deprez MT_MEMORY | MT_RW | EL3_PAS) 934a581b06SDimitris Papastamos 94490eeb04SDaniel Boulby #pragma weak arm_bl2_plat_handle_post_image_load 954a581b06SDimitris Papastamos 96d5705719SHarrison Mutai struct transfer_list_header *secure_tl __unused; 97a5566f65SHarrison Mutai 98b4315306SDan Handley /******************************************************************************* 99b4315306SDan Handley * BL1 has passed the extents of the trusted SRAM that should be visible to BL2 100b4315306SDan Handley * in x0. This memory layout is sitting at the base of the free trusted SRAM. 101b4315306SDan Handley * Copy it to a safe location before its reclaimed by later BL2 functionality. 102b4315306SDan Handley ******************************************************************************/ 1038187b95eSJayanth Dodderi Chidanand void arm_bl2_early_platform_setup(u_register_t arg0, u_register_t arg1, 1048187b95eSJayanth Dodderi Chidanand u_register_t arg2, u_register_t arg3) 105b4315306SDan Handley { 1069c11ed7eSHarrison Mutai struct transfer_list_entry *te __unused; 10708ec77c7SGovindraj Raja int __maybe_unused ret; 10808ec77c7SGovindraj Raja 109b4315306SDan Handley /* Initialize the console to provide early debug support */ 11088a0523eSAntonio Nino Diaz arm_console_boot_init(); 111b4315306SDan Handley 1129c11ed7eSHarrison Mutai #if TRANSFER_LIST 1138187b95eSJayanth Dodderi Chidanand secure_tl = (struct transfer_list_header *)arg3; 1149c11ed7eSHarrison Mutai 115abdb953bSHarrison Mutai te = transfer_list_find(secure_tl, TL_TAG_SRAM_LAYOUT); 1169c11ed7eSHarrison Mutai assert(te != NULL); 1179c11ed7eSHarrison Mutai 1189c11ed7eSHarrison Mutai bl2_tzram_layout = *(meminfo_t *)transfer_list_entry_data(te); 1199c11ed7eSHarrison Mutai transfer_list_rem(secure_tl, te); 1209c11ed7eSHarrison Mutai #else 1218187b95eSJayanth Dodderi Chidanand config_base = (uintptr_t)arg0; 1229c11ed7eSHarrison Mutai 123b4315306SDan Handley /* Setup the BL2 memory layout */ 1248187b95eSJayanth Dodderi Chidanand bl2_tzram_layout = *(meminfo_t *)arg1; 1258187b95eSJayanth Dodderi Chidanand #endif /* TRANSFER_LIST */ 1269814bfc1SLouis Mayencourt 127b4315306SDan Handley /* Initialise the IO layer and register platform IO devices */ 128b4315306SDan Handley plat_arm_io_setup(); 129ef1daa42SManish V Badarkhe 130ef1daa42SManish V Badarkhe /* Load partition table */ 131ef1daa42SManish V Badarkhe #if ARM_GPT_SUPPORT 132*fe3299d1SXialin Liu plat_setup_log_gpt_corrupted(&arm_log_gpt_corruption); 133*fe3299d1SXialin Liu 13408ec77c7SGovindraj Raja ret = gpt_partition_init(); 13508ec77c7SGovindraj Raja if (ret != 0) { 13608ec77c7SGovindraj Raja ERROR("GPT partition initialisation failed!\n"); 13708ec77c7SGovindraj Raja panic(); 13808ec77c7SGovindraj Raja } 139ef1daa42SManish V Badarkhe 140*fe3299d1SXialin Liu #if TRANSFER_LIST 141*fe3299d1SXialin Liu plat_log_gpt_ptr->plat_log_gpt_corruption((uintptr_t)secure_tl, 142*fe3299d1SXialin Liu plat_log_gpt_ptr->gpt_corrupted_info); 143*fe3299d1SXialin Liu #endif /* TRANSFER_LIST */ 144*fe3299d1SXialin Liu 14508ec77c7SGovindraj Raja #endif /* ARM_GPT_SUPPORT */ 146b4315306SDan Handley } 147b4315306SDan Handley 1488187b95eSJayanth Dodderi Chidanand void bl2_early_platform_setup2(u_register_t arg0, u_register_t arg1, 1498187b95eSJayanth Dodderi Chidanand u_register_t arg2, u_register_t arg3) 150b4315306SDan Handley { 1518187b95eSJayanth Dodderi Chidanand arm_bl2_early_platform_setup(arg0, arg1, arg2, arg3); 152cab0b5b0SSoby Mathew 15318e279ebSSoby Mathew generic_delay_timer_init(); 154b4315306SDan Handley } 155b4315306SDan Handley 156b4315306SDan Handley /* 1576e79f9fdSSoby Mathew * Perform BL2 preload setup. Currently we initialise the dynamic 1586e79f9fdSSoby Mathew * configuration here. 159b4315306SDan Handley */ 1606e79f9fdSSoby Mathew void bl2_plat_preload_setup(void) 161b4315306SDan Handley { 162a5566f65SHarrison Mutai #if TRANSFER_LIST 163f019c801SHarrison Mutai /* Assume the secure TL hasn't been initialised if BL2 is running at EL3. */ 164f019c801SHarrison Mutai #if RESET_TO_BL2 165d5705719SHarrison Mutai secure_tl = transfer_list_ensure((void *)PLAT_ARM_EL3_FW_HANDOFF_BASE, 166f019c801SHarrison Mutai PLAT_ARM_FW_HANDOFF_SIZE); 167f019c801SHarrison Mutai 168f019c801SHarrison Mutai if (secure_tl == NULL) { 169f019c801SHarrison Mutai ERROR("Secure transfer list initialisation failed!\n"); 170f019c801SHarrison Mutai panic(); 171f019c801SHarrison Mutai } 172f019c801SHarrison Mutai #endif 173a5566f65SHarrison Mutai arm_transfer_list_dyn_cfg_init(secure_tl); 174a5566f65SHarrison Mutai #else 175973e0b7fSDivin Raj #if ARM_FW_CONFIG_LOAD_ENABLE 176973e0b7fSDivin Raj arm_bl2_el3_plat_config_load(); 177973e0b7fSDivin Raj #endif /* ARM_FW_CONFIG_LOAD_ENABLE */ 178cab0b5b0SSoby Mathew arm_bl2_dyn_cfg_init(); 179a5566f65SHarrison Mutai #endif 180ef1daa42SManish V Badarkhe 1812f1177b2SManish V Badarkhe #if ARM_GPT_SUPPORT && !PSA_FWU_SUPPORT 1822f1177b2SManish V Badarkhe /* Always use the FIP from bank 0 */ 1832f1177b2SManish V Badarkhe arm_set_fip_addr(0U); 1842f1177b2SManish V Badarkhe #endif /* ARM_GPT_SUPPORT && !PSA_FWU_SUPPORT */ 1856e79f9fdSSoby Mathew } 186cab0b5b0SSoby Mathew 1876e79f9fdSSoby Mathew /* 1886e79f9fdSSoby Mathew * Perform ARM standard platform setup. 1896e79f9fdSSoby Mathew */ 1906e79f9fdSSoby Mathew void arm_bl2_platform_setup(void) 1916e79f9fdSSoby Mathew { 192deb4b3a6SZelalem Aweke #if !ENABLE_RME 193b4315306SDan Handley /* Initialize the secure environment */ 194b4315306SDan Handley plat_arm_security_setup(); 195deb4b3a6SZelalem Aweke #endif 196f145403cSRoberto Vargas 197f145403cSRoberto Vargas #if defined(PLAT_ARM_MEM_PROT_ADDR) 198638b034cSRoberto Vargas arm_nor_psci_do_static_mem_protect(); 199f145403cSRoberto Vargas #endif 200b4315306SDan Handley } 201b4315306SDan Handley 202b4315306SDan Handley void bl2_platform_setup(void) 203b4315306SDan Handley { 204b4315306SDan Handley arm_bl2_platform_setup(); 205b4315306SDan Handley } 206b4315306SDan Handley 207b4315306SDan Handley /******************************************************************************* 208deb4b3a6SZelalem Aweke * Perform the very early platform specific architectural setup here. 209deb4b3a6SZelalem Aweke * When RME is enabled the secure environment is initialised before 210deb4b3a6SZelalem Aweke * initialising and enabling Granule Protection. 211deb4b3a6SZelalem Aweke * This function initialises the MMU in a quick and dirty way. 212b4315306SDan Handley ******************************************************************************/ 213b4315306SDan Handley void arm_bl2_plat_arch_setup(void) 214b4315306SDan Handley { 215b65dfe40SSandrine Bailleux #if USE_COHERENT_MEM 216b65dfe40SSandrine Bailleux /* Ensure ARM platforms don't use coherent memory in BL2. */ 217d323af9eSDaniel Boulby assert((BL_COHERENT_RAM_END - BL_COHERENT_RAM_BASE) == 0U); 218b4315306SDan Handley #endif 219d323af9eSDaniel Boulby 220d323af9eSDaniel Boulby const mmap_region_t bl_regions[] = { 221d323af9eSDaniel Boulby MAP_BL2_TOTAL, 2222ecaafd2SDaniel Boulby ARM_MAP_BL_RO, 2231eb735d7SRoberto Vargas #if USE_ROMLIB 2241eb735d7SRoberto Vargas ARM_MAP_ROMLIB_CODE, 2251eb735d7SRoberto Vargas ARM_MAP_ROMLIB_DATA, 2261eb735d7SRoberto Vargas #endif 2279c11ed7eSHarrison Mutai #if !TRANSFER_LIST 228a07c101aSManish V Badarkhe ARM_MAP_BL_CONFIG_REGION, 2299c11ed7eSHarrison Mutai #endif /* TRANSFER_LIST */ 230c8720729SZelalem Aweke #if ENABLE_RME 231c8720729SZelalem Aweke ARM_MAP_L0_GPT_REGION, 232c8720729SZelalem Aweke #endif 233d323af9eSDaniel Boulby { 0 } 234d323af9eSDaniel Boulby }; 235d323af9eSDaniel Boulby 236deb4b3a6SZelalem Aweke #if ENABLE_RME 237deb4b3a6SZelalem Aweke /* Initialise the secure environment */ 238deb4b3a6SZelalem Aweke plat_arm_security_setup(); 239deb4b3a6SZelalem Aweke #endif 2400916c38dSRoberto Vargas setup_page_tables(bl_regions, plat_arm_get_mmap()); 2416fe8aa2fSYatharth Kochar 242402b3cf8SJulius Werner #ifdef __aarch64__ 243deb4b3a6SZelalem Aweke #if ENABLE_RME 244deb4b3a6SZelalem Aweke /* BL2 runs in EL3 when RME enabled. */ 245aaaf2cc3SSona Mathew assert(is_feat_rme_present()); 246deb4b3a6SZelalem Aweke enable_mmu_el3(0); 247f19dc624Sjohpow01 248f19dc624Sjohpow01 /* Initialise and enable granule protection after MMU. */ 249341df6afSRohit Mathew arm_gpt_setup(); 250deb4b3a6SZelalem Aweke #else 251b5fa6563SSandrine Bailleux enable_mmu_el1(0); 252deb4b3a6SZelalem Aweke #endif 253402b3cf8SJulius Werner #else 254402b3cf8SJulius Werner enable_mmu_svc_mon(0); 2556fe8aa2fSYatharth Kochar #endif 2561eb735d7SRoberto Vargas 2571eb735d7SRoberto Vargas arm_setup_romlib(); 258b4315306SDan Handley } 259b4315306SDan Handley 260b4315306SDan Handley void bl2_plat_arch_setup(void) 261b4315306SDan Handley { 2629c11ed7eSHarrison Mutai const struct dyn_cfg_dtb_info_t *tb_fw_config_info __unused; 2639c11ed7eSHarrison Mutai struct transfer_list_entry *te __unused; 264b4315306SDan Handley arm_bl2_plat_arch_setup(); 265a07c101aSManish V Badarkhe 2669c11ed7eSHarrison Mutai #if TRANSFER_LIST 267ada4e59dSHarrison Mutai #if CRYPTO_SUPPORT 268ada4e59dSHarrison Mutai te = arm_transfer_list_set_heap_info(secure_tl); 2699c11ed7eSHarrison Mutai transfer_list_rem(secure_tl, te); 270ada4e59dSHarrison Mutai #endif /* CRYPTO_SUPPORT */ 2719c11ed7eSHarrison Mutai #else 272a07c101aSManish V Badarkhe /* Fill the properties struct with the info from the config dtb */ 273d74c6b83SJimmy Brisson fconf_populate("FW_CONFIG", config_base); 274a07c101aSManish V Badarkhe 275a07c101aSManish V Badarkhe /* TB_FW_CONFIG was also loaded by BL1 */ 276a07c101aSManish V Badarkhe tb_fw_config_info = FCONF_GET_PROPERTY(dyn_cfg, dtb, TB_FW_CONFIG_ID); 277a07c101aSManish V Badarkhe assert(tb_fw_config_info != NULL); 278a07c101aSManish V Badarkhe 279a07c101aSManish V Badarkhe fconf_populate("TB_FW", tb_fw_config_info->config_addr); 280ada4e59dSHarrison Mutai #endif /* TRANSFER_LIST */ 281b4315306SDan Handley } 282b4315306SDan Handley 28307570d59SYatharth Kochar int arm_bl2_handle_post_image_load(unsigned int image_id) 284a8aa7fecSYatharth Kochar { 285a8aa7fecSYatharth Kochar int err = 0; 286a8aa7fecSYatharth Kochar bl_mem_params_node_t *bl_mem_params = get_bl_mem_params_node(image_id); 28754661cd2SSummer Qin #ifdef SPD_opteed 28854661cd2SSummer Qin bl_mem_params_node_t *pager_mem_params = NULL; 28954661cd2SSummer Qin bl_mem_params_node_t *paged_mem_params = NULL; 29054661cd2SSummer Qin #endif 291466bb285SZelalem assert(bl_mem_params != NULL); 292a8aa7fecSYatharth Kochar 293a8aa7fecSYatharth Kochar switch (image_id) { 294402b3cf8SJulius Werner #ifdef __aarch64__ 295a8aa7fecSYatharth Kochar case BL32_IMAGE_ID: 29654661cd2SSummer Qin #ifdef SPD_opteed 29754661cd2SSummer Qin pager_mem_params = get_bl_mem_params_node(BL32_EXTRA1_IMAGE_ID); 29854661cd2SSummer Qin assert(pager_mem_params); 29954661cd2SSummer Qin 30054661cd2SSummer Qin paged_mem_params = get_bl_mem_params_node(BL32_EXTRA2_IMAGE_ID); 30154661cd2SSummer Qin assert(paged_mem_params); 30254661cd2SSummer Qin 30354661cd2SSummer Qin err = parse_optee_header(&bl_mem_params->ep_info, 30454661cd2SSummer Qin &pager_mem_params->image_info, 30554661cd2SSummer Qin &paged_mem_params->image_info); 30654661cd2SSummer Qin if (err != 0) { 30754661cd2SSummer Qin WARN("OPTEE header parse error.\n"); 30854661cd2SSummer Qin } 30954661cd2SSummer Qin #endif 31001907f3fSHarrison Mutai bl_mem_params->ep_info.spsr = arm_get_spsr(BL32_IMAGE_ID); 311a8aa7fecSYatharth Kochar break; 3126fe8aa2fSYatharth Kochar #endif 313a8aa7fecSYatharth Kochar 314a8aa7fecSYatharth Kochar case BL33_IMAGE_ID: 3158946bb03SHarrison Mutai #if !USE_KERNEL_DT_CONVENTION 316a8aa7fecSYatharth Kochar /* BL33 expects to receive the primary CPU MPID (through r0) */ 317a8aa7fecSYatharth Kochar bl_mem_params->ep_info.args.arg0 = 0xffff & read_mpidr(); 3188946bb03SHarrison Mutai #endif /* !USE_KERNEL_DT_CONVENTION */ 31901907f3fSHarrison Mutai bl_mem_params->ep_info.spsr = arm_get_spsr(BL33_IMAGE_ID); 320a8aa7fecSYatharth Kochar break; 321a8aa7fecSYatharth Kochar 322a8aa7fecSYatharth Kochar #ifdef SCP_BL2_BASE 323a8aa7fecSYatharth Kochar case SCP_BL2_IMAGE_ID: 324a8aa7fecSYatharth Kochar /* The subsequent handling of SCP_BL2 is platform specific */ 325a8aa7fecSYatharth Kochar err = plat_arm_bl2_handle_scp_bl2(&bl_mem_params->image_info); 326a8aa7fecSYatharth Kochar if (err) { 327a8aa7fecSYatharth Kochar WARN("Failure in platform-specific handling of SCP_BL2 image.\n"); 328a8aa7fecSYatharth Kochar } 329a8aa7fecSYatharth Kochar break; 330a8aa7fecSYatharth Kochar #endif 331649c48f5SJonathan Wright default: 332649c48f5SJonathan Wright /* Do nothing in default case */ 333649c48f5SJonathan Wright break; 334a8aa7fecSYatharth Kochar } 335a8aa7fecSYatharth Kochar 336a8aa7fecSYatharth Kochar return err; 337a8aa7fecSYatharth Kochar } 338a8aa7fecSYatharth Kochar 33907570d59SYatharth Kochar /******************************************************************************* 34007570d59SYatharth Kochar * This function can be used by the platforms to update/use image 34107570d59SYatharth Kochar * information for given `image_id`. 34207570d59SYatharth Kochar ******************************************************************************/ 343490eeb04SDaniel Boulby int arm_bl2_plat_handle_post_image_load(unsigned int image_id) 34407570d59SYatharth Kochar { 34546789a7cSBalint Dobszay #if defined(SPD_spmd) && BL2_ENABLE_SP_LOAD 346cb3b5344SManish Pandey /* For Secure Partitions we don't need post processing */ 347cb3b5344SManish Pandey if ((image_id >= (MAX_NUMBER_IDS - MAX_SP_IDS)) && 348cb3b5344SManish Pandey (image_id < MAX_NUMBER_IDS)) { 349cb3b5344SManish Pandey return 0; 350cb3b5344SManish Pandey } 351cb3b5344SManish Pandey #endif 352a5566f65SHarrison Mutai 353a5566f65SHarrison Mutai #if TRANSFER_LIST 35400c353c4SYeoreum Yun if (image_id == HW_CONFIG_ID || image_id == TOS_FW_CONFIG_ID) { 35500c353c4SYeoreum Yun /* 35600c353c4SYeoreum Yun * Refresh the now stale checksum following loading of 35700c353c4SYeoreum Yun * HW_CONFIG or TOS_FW_CONFIG into the TL. 35800c353c4SYeoreum Yun */ 359fe94a21aSHarrison Mutai transfer_list_update_checksum(secure_tl); 360a5566f65SHarrison Mutai } 361a5566f65SHarrison Mutai #endif /* TRANSFER_LIST */ 362a5566f65SHarrison Mutai 36307570d59SYatharth Kochar return arm_bl2_handle_post_image_load(image_id); 36407570d59SYatharth Kochar } 365a5566f65SHarrison Mutai 366a5566f65SHarrison Mutai void arm_bl2_setup_next_ep_info(bl_mem_params_node_t *next_param_node) 367a5566f65SHarrison Mutai { 368cca1b72bSHarrison Mutai entry_point_info_t *ep __unused; 369b30d9043SHarrison Mutai 370b5d0740eSHarrison Mutai #if TRANSFER_LIST 371b30d9043SHarrison Mutai /* 372b30d9043SHarrison Mutai * Information might have been added to the TL before this (i.e. event log) 373b30d9043SHarrison Mutai * make sure the checksum is up to date. 374b30d9043SHarrison Mutai */ 375b30d9043SHarrison Mutai transfer_list_update_checksum(secure_tl); 376b30d9043SHarrison Mutai 377cca1b72bSHarrison Mutai ep = transfer_list_set_handoff_args(secure_tl, 378cca1b72bSHarrison Mutai &next_param_node->ep_info); 379cca1b72bSHarrison Mutai assert(ep != NULL); 380a5566f65SHarrison Mutai 381fe94a21aSHarrison Mutai arm_transfer_list_populate_ep_info(next_param_node, secure_tl); 382b5d0740eSHarrison Mutai #endif 383a5566f65SHarrison Mutai } 384