From 58e946aec50c022578fd47da93b0b4bd62e94d5b Mon Sep 17 00:00:00 2001 From: Soby Mathew Date: Mon, 19 Sep 2016 17:21:15 +0100 Subject: PSCI: Do psci_setup() as part of std_svc_setup() This patch moves the invocation of `psci_setup()` from BL31 and SP_MIN into `std_svc_setup()` as part of ARM Standard Service initialization. This allows us to consolidate ARM Standard Service initializations which will be added to in the future. A new function `get_arm_std_svc_args()` is introduced to get arguments corresponding to each standard service. This function must be implemented by the EL3 Runtime Firmware and both SP_MIN and BL31 implement it. Change-Id: I38e1b644f797fa4089b20574bd4a10f0419de184 --- bl32/sp_min/sp_min_main.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'bl32') diff --git a/bl32/sp_min/sp_min_main.c b/bl32/sp_min/sp_min_main.c index c1ba8fc5..02663a29 100644 --- a/bl32/sp_min/sp_min_main.c +++ b/bl32/sp_min/sp_min_main.c @@ -151,30 +151,33 @@ static void sp_min_prepare_next_image_entry(void) } /****************************************************************************** - * The SP_MIN main function. Do the platform and PSCI Library setup. Also - * initialize the runtime service framework. + * Implement the ARM Standard Service function to get arguments for a + * particular service. *****************************************************************************/ -void sp_min_main(void) +uintptr_t get_arm_std_svc_args(unsigned int svc_mask) { /* Setup the arguments for PSCI Library */ DEFINE_STATIC_PSCI_LIB_ARGS_V1(psci_args, sp_min_warm_entrypoint); + /* PSCI is the only ARM Standard Service implemented */ + assert(svc_mask == PSCI_FID_MASK); + + return (uintptr_t)&psci_args; +} + +/****************************************************************************** + * The SP_MIN main function. Do the platform and PSCI Library setup. Also + * initialize the runtime service framework. + *****************************************************************************/ +void sp_min_main(void) +{ NOTICE("SP_MIN: %s\n", version_string); NOTICE("SP_MIN: %s\n", build_message); /* Perform the SP_MIN platform setup */ sp_min_platform_setup(); - /* - * Initialize the PSCI library and perform the remaining generic - * architectural setup from PSCI. - */ - psci_setup(&psci_args); - - /* - * Initialize the runtime services e.g. psci - * This is where the monitor mode will be initialized - */ + /* Initialize the runtime services e.g. psci */ INFO("SP_MIN: Initializing runtime services\n"); runtime_svc_init(); -- cgit v1.2.3