From 35795b4e878467300b3bdccc37d7486a9c8942c6 Mon Sep 17 00:00:00 2001 From: Antonio Nino Diaz Date: Mon, 24 Sep 2018 17:15:46 +0100 Subject: [PATCH] marvell: Migrate to new interfaces - Migrate to bl2_early_platform_setup2(). - Remove references to removed build options. - Use private definition of bl31_params_t. This is an incomplete migration, the platform doesn't currently compile. Change-Id: I1ae477b1f2489f49b651528050fdf06e4a55e425 Signed-off-by: Antonio Nino Diaz --- .../plat/marvell/a8k/common/board_marvell_def.h | 4 +--- include/plat/marvell/a8k/common/plat_marvell.h | 11 ++++++++++- plat/marvell/a8k/common/a8k_common.mk | 5 ----- plat/marvell/common/marvell_bl2_setup.c | 14 +++++++++----- plat/marvell/common/marvell_bl31_setup.c | 11 +++++++---- plat/marvell/common/mrvl_sip_svc.c | 2 +- 6 files changed, 28 insertions(+), 19 deletions(-) diff --git a/include/plat/marvell/a8k/common/board_marvell_def.h b/include/plat/marvell/a8k/common/board_marvell_def.h index b1054db22..e67543ed5 100644 --- a/include/plat/marvell/a8k/common/board_marvell_def.h +++ b/include/plat/marvell/a8k/common/board_marvell_def.h @@ -14,9 +14,7 @@ */ /* Size of cacheable stacks */ -#if DEBUG_XLAT_TABLE -# define PLATFORM_STACK_SIZE 0x800 -#elif IMAGE_BL1 +#if IMAGE_BL1 #if TRUSTED_BOARD_BOOT # define PLATFORM_STACK_SIZE 0x1000 #else diff --git a/include/plat/marvell/a8k/common/plat_marvell.h b/include/plat/marvell/a8k/common/plat_marvell.h index 9ca68d3bc..a62a7cb08 100644 --- a/include/plat/marvell/a8k/common/plat_marvell.h +++ b/include/plat/marvell/a8k/common/plat_marvell.h @@ -24,6 +24,15 @@ extern const mmap_region_t plat_marvell_mmap[]; <= MAX_MMAP_REGIONS, \ assert_max_mmap_regions) +struct marvell_bl31_params { + param_header_t h; + image_info_t *bl31_image_info; + entry_point_info_t *bl32_ep_info; + image_info_t *bl32_image_info; + entry_point_info_t *bl33_ep_info; + image_info_t *bl33_image_info; +}; + /* * Utility functions common to Marvell standard platforms */ @@ -67,7 +76,7 @@ uint32_t marvell_get_spsr_for_bl32_entry(void); uint32_t marvell_get_spsr_for_bl33_entry(void); /* BL31 utility functions */ -void marvell_bl31_early_platform_setup(struct bl31_params *from_bl2, +void marvell_bl31_early_platform_setup(void *from_bl2, uintptr_t soc_fw_config, uintptr_t hw_config, void *plat_params_from_bl2); diff --git a/plat/marvell/a8k/common/a8k_common.mk b/plat/marvell/a8k/common/a8k_common.mk index be2ff1e3a..364935cad 100644 --- a/plat/marvell/a8k/common/a8k_common.mk +++ b/plat/marvell/a8k/common/a8k_common.mk @@ -97,11 +97,6 @@ BL31_SOURCES += lib/cpus/aarch64/cortex_a72.S \ # Add trace functionality for PM BL31_SOURCES += $(PLAT_COMMON_BASE)/plat_pm_trace.c -# Disable the PSCI platform compatibility layer (allows porting -# from Old Platform APIs to the new APIs). -# It is not needed since Marvell platform already used the new platform APIs. -ENABLE_PLAT_COMPAT := 0 - # Force builds with BL2 image on a80x0 platforms ifndef SCP_BL2 $(error "Error: SCP_BL2 image is mandatory for a8k family") diff --git a/plat/marvell/common/marvell_bl2_setup.c b/plat/marvell/common/marvell_bl2_setup.c index 7c87ce338..e8f60fd84 100644 --- a/plat/marvell/common/marvell_bl2_setup.c +++ b/plat/marvell/common/marvell_bl2_setup.c @@ -24,7 +24,7 @@ static meminfo_t bl2_tzram_layout __aligned(CACHE_WRITEBACK_GRANULE); ***************************************************************************** */ typedef struct bl2_to_bl31_params_mem { - bl31_params_t bl31_params; + struct marvell_bl31_params bl31_params; image_info_t bl31_image_info; image_info_t bl32_image_info; image_info_t bl33_image_info; @@ -68,9 +68,9 @@ meminfo_t *bl2_plat_sec_mem_layout(void) * before generating params to BL31 ***************************************************************************** */ -bl31_params_t *bl2_plat_get_bl31_params(void) +void *bl2_plat_get_bl31_params(void) { - bl31_params_t *bl2_to_bl31_params; + struct marvell_bl31_params *bl2_to_bl31_params; /* * Initialise the memory for all the arguments that needs to @@ -109,7 +109,7 @@ bl31_params_t *bl2_plat_get_bl31_params(void) SET_PARAM_HEAD(bl2_to_bl31_params->bl33_image_info, PARAM_IMAGE_BINARY, VERSION_1, 0); - return bl2_to_bl31_params; + return (void *)bl2_to_bl31_params; } /* Flush the TF params and the TF plat params */ @@ -153,8 +153,12 @@ void marvell_bl2_early_platform_setup(meminfo_t *mem_layout) plat_marvell_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) { + struct meminfo *mem_layout = (struct meminfo *)arg1; + marvell_bl2_early_platform_setup(mem_layout); } diff --git a/plat/marvell/common/marvell_bl31_setup.c b/plat/marvell/common/marvell_bl31_setup.c index f3818767d..20c8a7609 100644 --- a/plat/marvell/common/marvell_bl31_setup.c +++ b/plat/marvell/common/marvell_bl31_setup.c @@ -68,11 +68,14 @@ entry_point_info_t *bl31_plat_get_next_image_ep_info(uint32_t type) * we are guaranteed to pick up good data. ***************************************************************************** */ -void marvell_bl31_early_platform_setup(bl31_params_t *from_bl2, +void marvell_bl31_early_platform_setup(void *from_bl2, uintptr_t soc_fw_config, uintptr_t hw_config, void *plat_params_from_bl2) { + struct marvell_bl31_params *params_from_bl2 = + (struct marvell_bl31_params *)from_bl2; + /* Initialize the console to provide early debug support */ console_init(PLAT_MARVELL_BOOT_UART_BASE, PLAT_MARVELL_BOOT_UART_CLK_IN_HZ, @@ -126,9 +129,9 @@ void marvell_bl31_early_platform_setup(bl31_params_t *from_bl2, * Copy BL32 (if populated by BL2) and BL33 entry point information. * They are stored in Secure RAM, in BL2's address space. */ - if (from_bl2->bl32_ep_info) - bl32_image_ep_info = *from_bl2->bl32_ep_info; - bl33_image_ep_info = *from_bl2->bl33_ep_info; + if (params_from_bl2->bl32_ep_info) + bl32_image_ep_info = *params_from_bl2->bl32_ep_info; + bl33_image_ep_info = *params_from_bl2->bl33_ep_info; #endif } diff --git a/plat/marvell/common/mrvl_sip_svc.c b/plat/marvell/common/mrvl_sip_svc.c index a0ca50d0a..8bc633b14 100644 --- a/plat/marvell/common/mrvl_sip_svc.c +++ b/plat/marvell/common/mrvl_sip_svc.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include "comphy/phy-comphy-cp110.h" /* #define DEBUG_COMPHY */