mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-17 10:04:26 +00:00
ARM Platforms: Migrate to new BL handover interface
This patch migrates the ARM Standard platforms to the new BL handover interface. The arm_blx_early_platform_setup() functions are also modified to take in 4 arguments. The `ARM_BL31_PLAT_PARAM_VAL` value passed to BL31 from BL2 is now in arg3 in preparation of dynamic configuration arguments. Change-Id: I33e8e61325a19e7a7127b1ff203c3b86921bf153 Signed-off-by: Soby Mathew <soby.mathew@arm.com>
This commit is contained in:
parent
a6f340fe58
commit
0c306cc062
9 changed files with 48 additions and 54 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved.
|
||||
* Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -157,11 +157,11 @@ void arm_bl2u_plat_arch_setup(void);
|
|||
|
||||
/* BL31 utility functions */
|
||||
#if LOAD_IMAGE_V2
|
||||
void arm_bl31_early_platform_setup(void *from_bl2,
|
||||
void *plat_params_from_bl2);
|
||||
void arm_bl31_early_platform_setup(void *from_bl2, uintptr_t soc_fw_config,
|
||||
uintptr_t hw_config, void *plat_params_from_bl2);
|
||||
#else
|
||||
void arm_bl31_early_platform_setup(struct bl31_params *from_bl2,
|
||||
void *plat_params_from_bl2);
|
||||
void arm_bl31_early_platform_setup(struct bl31_params *from_bl2, uintptr_t soc_fw_config,
|
||||
uintptr_t hw_config, void *plat_params_from_bl2);
|
||||
#endif /* LOAD_IMAGE_V2 */
|
||||
void arm_bl31_platform_setup(void);
|
||||
void arm_bl31_plat_runtime_setup(void);
|
||||
|
@ -171,8 +171,8 @@ void arm_bl31_plat_arch_setup(void);
|
|||
void arm_tsp_early_platform_setup(void);
|
||||
|
||||
/* SP_MIN utility functions */
|
||||
void arm_sp_min_early_platform_setup(void *from_bl2,
|
||||
void *plat_params_from_bl2);
|
||||
void arm_sp_min_early_platform_setup(void *from_bl2, uintptr_t tos_fw_config,
|
||||
uintptr_t hw_config, void *plat_params_from_bl2);
|
||||
void arm_sp_min_plat_runtime_setup(void);
|
||||
|
||||
/* FIP TOC validity check */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2013-2015, ARM Limited and Contributors. All rights reserved.
|
||||
* Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -12,10 +12,9 @@
|
|||
#include "fvp_def.h"
|
||||
#include "fvp_private.h"
|
||||
|
||||
|
||||
void bl2_early_platform_setup(meminfo_t *mem_layout)
|
||||
void bl2_early_platform_setup2(u_register_t arg0, u_register_t arg1, u_register_t arg2, u_register_t arg3)
|
||||
{
|
||||
arm_bl2_early_platform_setup(mem_layout);
|
||||
arm_bl2_early_platform_setup((meminfo_t *)arg1);
|
||||
|
||||
/* Initialize the platform config for future decision making */
|
||||
fvp_config_setup();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2013-2017, ARM Limited and Contributors. All rights reserved.
|
||||
* Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -9,15 +9,10 @@
|
|||
#include <smmu_v3.h>
|
||||
#include "fvp_private.h"
|
||||
|
||||
#if LOAD_IMAGE_V2
|
||||
void bl31_early_platform_setup(void *from_bl2,
|
||||
void *plat_params_from_bl2)
|
||||
#else
|
||||
void bl31_early_platform_setup(bl31_params_t *from_bl2,
|
||||
void *plat_params_from_bl2)
|
||||
#endif
|
||||
void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
|
||||
u_register_t arg2, u_register_t arg3)
|
||||
{
|
||||
arm_bl31_early_platform_setup(from_bl2, plat_params_from_bl2);
|
||||
arm_bl31_early_platform_setup((void *)arg0, arg1, arg2, (void *)arg3);
|
||||
|
||||
/* Initialize the platform config for future decision making */
|
||||
fvp_config_setup();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
|
||||
* Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -7,10 +7,10 @@
|
|||
#include <plat_arm.h>
|
||||
#include "../fvp_private.h"
|
||||
|
||||
void sp_min_early_platform_setup(void *from_bl2,
|
||||
void *plat_params_from_bl2)
|
||||
void sp_min_early_platform_setup2(u_register_t arg0, u_register_t arg1,
|
||||
u_register_t arg2, u_register_t arg3)
|
||||
{
|
||||
arm_sp_min_early_platform_setup(from_bl2, plat_params_from_bl2);
|
||||
arm_sp_min_early_platform_setup((void *)arg0, arg1, arg2, (void *)arg3);
|
||||
|
||||
/* Initialize the platform config for future decision making */
|
||||
fvp_config_setup();
|
||||
|
|
|
@ -68,7 +68,7 @@ static bl_mem_params_node_t bl2_mem_params_descs[] = {
|
|||
.ep_info.spsr = SPSR_64(MODE_EL3, MODE_SP_ELX,
|
||||
DISABLE_ALL_EXCEPTIONS),
|
||||
#if DEBUG
|
||||
.ep_info.args.arg1 = ARM_BL31_PLAT_PARAM_VAL,
|
||||
.ep_info.args.arg3 = ARM_BL31_PLAT_PARAM_VAL,
|
||||
#endif
|
||||
|
||||
SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved.
|
||||
* Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -39,7 +39,7 @@ static meminfo_t bl2_tzram_layout __aligned(CACHE_WRITEBACK_GRANULE);
|
|||
CASSERT(BL2_BASE >= (ARM_BL_RAM_BASE + BL1_MEMINFO_OFFSET), assert_bl2_base_overflows);
|
||||
|
||||
/* Weak definitions may be overridden in specific ARM standard platform */
|
||||
#pragma weak bl2_early_platform_setup
|
||||
#pragma weak bl2_early_platform_setup2
|
||||
#pragma weak bl2_platform_setup
|
||||
#pragma weak bl2_plat_arch_setup
|
||||
#pragma weak bl2_plat_sec_mem_layout
|
||||
|
@ -169,7 +169,7 @@ void bl2_plat_flush_bl31_params(void)
|
|||
struct entry_point_info *bl2_plat_get_bl31_ep_info(void)
|
||||
{
|
||||
#if DEBUG
|
||||
bl31_params_mem.bl31_ep_info.args.arg1 = ARM_BL31_PLAT_PARAM_VAL;
|
||||
bl31_params_mem.bl31_ep_info.args.arg3 = ARM_BL31_PLAT_PARAM_VAL;
|
||||
#endif
|
||||
|
||||
return &bl31_params_mem.bl31_ep_info;
|
||||
|
@ -194,9 +194,9 @@ void arm_bl2_early_platform_setup(meminfo_t *mem_layout)
|
|||
plat_arm_io_setup();
|
||||
}
|
||||
|
||||
void bl2_early_platform_setup(meminfo_t *mem_layout)
|
||||
void bl2_early_platform_setup2(u_register_t arg0, u_register_t arg1, u_register_t arg2, u_register_t arg3)
|
||||
{
|
||||
arm_bl2_early_platform_setup(mem_layout);
|
||||
arm_bl2_early_platform_setup((meminfo_t *)arg1);
|
||||
generic_delay_timer_init();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2015-2016, ARM Limited and Contributors. All rights reserved.
|
||||
* Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -26,7 +26,7 @@ static entry_point_info_t bl33_image_ep_info;
|
|||
|
||||
|
||||
/* Weak definitions may be overridden in specific ARM standard platform */
|
||||
#pragma weak bl31_early_platform_setup
|
||||
#pragma weak bl31_early_platform_setup2
|
||||
#pragma weak bl31_platform_setup
|
||||
#pragma weak bl31_plat_arch_setup
|
||||
#pragma weak bl31_plat_get_next_image_ep_info
|
||||
|
@ -64,11 +64,11 @@ entry_point_info_t *bl31_plat_get_next_image_ep_info(uint32_t type)
|
|||
* we are guaranteed to pick up good data.
|
||||
******************************************************************************/
|
||||
#if LOAD_IMAGE_V2
|
||||
void arm_bl31_early_platform_setup(void *from_bl2,
|
||||
void *plat_params_from_bl2)
|
||||
void arm_bl31_early_platform_setup(void *from_bl2, uintptr_t soc_fw_config,
|
||||
uintptr_t hw_config, void *plat_params_from_bl2)
|
||||
#else
|
||||
void arm_bl31_early_platform_setup(bl31_params_t *from_bl2,
|
||||
void *plat_params_from_bl2)
|
||||
void arm_bl31_early_platform_setup(bl31_params_t *from_bl2, uintptr_t soc_fw_config,
|
||||
uintptr_t hw_config, void *plat_params_from_bl2)
|
||||
#endif
|
||||
{
|
||||
/* Initialize the console to provide early debug support */
|
||||
|
@ -152,6 +152,10 @@ void arm_bl31_early_platform_setup(bl31_params_t *from_bl2,
|
|||
assert(from_bl2->h.type == PARAM_BL31);
|
||||
assert(from_bl2->h.version >= VERSION_1);
|
||||
|
||||
/* Dynamic Config is not supported for LOAD_IMAGE_V1 */
|
||||
assert(soc_fw_config == 0);
|
||||
assert(hw_config == 0);
|
||||
|
||||
/*
|
||||
* Copy BL32 (if populated by BL2) and BL33 entry point information.
|
||||
* They are stored in Secure RAM, in BL2's address space.
|
||||
|
@ -164,15 +168,10 @@ void arm_bl31_early_platform_setup(bl31_params_t *from_bl2,
|
|||
#endif /* RESET_TO_BL31 */
|
||||
}
|
||||
|
||||
#if LOAD_IMAGE_V2
|
||||
void bl31_early_platform_setup(void *from_bl2,
|
||||
void *plat_params_from_bl2)
|
||||
#else
|
||||
void bl31_early_platform_setup(bl31_params_t *from_bl2,
|
||||
void *plat_params_from_bl2)
|
||||
#endif
|
||||
void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
|
||||
u_register_t arg2, u_register_t arg3)
|
||||
{
|
||||
arm_bl31_early_platform_setup(from_bl2, plat_params_from_bl2);
|
||||
arm_bl31_early_platform_setup((void *)arg0, arg1, arg2, (void *)arg3);
|
||||
|
||||
/*
|
||||
* Initialize Interconnect for this cluster during cold boot.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved.
|
||||
* Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -18,7 +18,7 @@
|
|||
static entry_point_info_t bl33_image_ep_info;
|
||||
|
||||
/* Weak definitions may be overridden in specific ARM standard platform */
|
||||
#pragma weak sp_min_early_platform_setup
|
||||
#pragma weak sp_min_early_platform_setup2
|
||||
#pragma weak sp_min_platform_setup
|
||||
#pragma weak sp_min_plat_arch_setup
|
||||
|
||||
|
@ -48,8 +48,8 @@ entry_point_info_t *sp_min_plat_get_bl33_ep_info(void)
|
|||
/*******************************************************************************
|
||||
* Perform early platform setup.
|
||||
******************************************************************************/
|
||||
void arm_sp_min_early_platform_setup(void *from_bl2,
|
||||
void *plat_params_from_bl2)
|
||||
void arm_sp_min_early_platform_setup(void *from_bl2, uintptr_t tos_fw_config,
|
||||
uintptr_t hw_config, void *plat_params_from_bl2)
|
||||
{
|
||||
/* Initialize the console to provide early debug support */
|
||||
console_init(PLAT_ARM_BOOT_UART_BASE, PLAT_ARM_BOOT_UART_CLK_IN_HZ,
|
||||
|
@ -105,10 +105,10 @@ void arm_sp_min_early_platform_setup(void *from_bl2,
|
|||
|
||||
}
|
||||
|
||||
void sp_min_early_platform_setup(void *from_bl2,
|
||||
void *plat_params_from_bl2)
|
||||
void sp_min_early_platform_setup2(u_register_t arg0, u_register_t arg1,
|
||||
u_register_t arg2, u_register_t arg3)
|
||||
{
|
||||
arm_sp_min_early_platform_setup(from_bl2, plat_params_from_bl2);
|
||||
arm_sp_min_early_platform_setup((void *)arg0, arg1, arg2, (void *)arg3);
|
||||
|
||||
/*
|
||||
* Initialize Interconnect for this cluster during cold boot.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved.
|
||||
* Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -60,9 +60,10 @@ int bl2_plat_handle_scp_bl2(image_info_t *scp_bl2_image_info)
|
|||
|
||||
static unsigned int scp_boot_config;
|
||||
|
||||
void bl2_early_platform_setup(meminfo_t *mem_layout)
|
||||
void bl2_early_platform_setup2(u_register_t arg0, u_register_t arg1,
|
||||
u_register_t arg2, u_register_t arg3)
|
||||
{
|
||||
arm_bl2_early_platform_setup(mem_layout);
|
||||
arm_bl2_early_platform_setup((uintptr_t)arg0, (meminfo_t *)arg1);
|
||||
|
||||
/* Save SCP Boot config before it gets overwritten by SCP_BL2 loading */
|
||||
scp_boot_config = mmio_read_32(SCP_BOOT_CFG_ADDR);
|
||||
|
|
Loading…
Add table
Reference in a new issue