From a1255c758593f9f6fb85b70165fad21de7491e1e Mon Sep 17 00:00:00 2001 From: Yann Gautier Date: Thu, 18 Jan 2024 18:20:43 +0100 Subject: [PATCH] feat(bl32): create an sp_min_setup function This new C function will call sp_min_early_platform_setup2() and sp_min_plat_arch_setup(). At this step the C environment is already enabled, and it allows adding function like the one for early console for which r9-r12 registers could be clobbered. Signed-off-by: Yann Gautier Change-Id: I4cbf2f6acea769d595ff40b2e2b4ca5d29672878 --- bl32/sp_min/aarch32/entrypoint.S | 5 ++--- bl32/sp_min/sp_min_main.c | 13 ++++++++++++- bl32/sp_min/sp_min_private.h | 6 +++++- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/bl32/sp_min/aarch32/entrypoint.S b/bl32/sp_min/aarch32/entrypoint.S index 693dd4b82..ba9d90d42 100644 --- a/bl32/sp_min/aarch32/entrypoint.S +++ b/bl32/sp_min/aarch32/entrypoint.S @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2023, Arm Limited and Contributors. All rights reserved. + * Copyright (c) 2016-2024, Arm Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -118,8 +118,7 @@ func sp_min_entrypoint mov r1, r10 mov r2, r11 mov r3, r12 - bl sp_min_early_platform_setup2 - bl sp_min_plat_arch_setup + bl sp_min_setup /* Jump to the main function */ bl sp_min_main diff --git a/bl32/sp_min/sp_min_main.c b/bl32/sp_min/sp_min_main.c index 26cf2079d..1c7e9600a 100644 --- a/bl32/sp_min/sp_min_main.c +++ b/bl32/sp_min/sp_min_main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2023, Arm Limited and Contributors. All rights reserved. + * Copyright (c) 2016-2024, Arm Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -169,6 +169,17 @@ uintptr_t get_arm_std_svc_args(unsigned int svc_mask) return (uintptr_t)&psci_args; } +/****************************************************************************** + * The SP_MIN setup function. Calls platforms init functions + *****************************************************************************/ +void sp_min_setup(u_register_t arg0, u_register_t arg1, u_register_t arg2, + u_register_t arg3) +{ + /* Perform early platform-specific setup */ + sp_min_early_platform_setup2(arg0, arg1, arg2, arg3); + sp_min_plat_arch_setup(); +} + /****************************************************************************** * The SP_MIN main function. Do the platform and PSCI Library setup. Also * initialize the runtime service framework. diff --git a/bl32/sp_min/sp_min_private.h b/bl32/sp_min/sp_min_private.h index 628581a4c..9c6b5fb29 100644 --- a/bl32/sp_min/sp_min_private.h +++ b/bl32/sp_min/sp_min_private.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2016-2024, Arm Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -7,6 +7,10 @@ #ifndef SP_MIN_PRIVATE_H #define SP_MIN_PRIVATE_H +#include + +void sp_min_setup(u_register_t arg0, u_register_t arg1, u_register_t arg2, + u_register_t arg3); void sp_min_main(void); void sp_min_warm_boot(void); void sp_min_fiq(void);