summaryrefslogtreecommitdiff
path: root/bl31
diff options
context:
space:
mode:
authorSoby Mathew <soby.mathew@arm.com>2016-09-19 17:21:15 +0100
committerSoby Mathew <soby.mathew@arm.com>2016-09-22 17:07:20 +0100
commit58e946aec50c022578fd47da93b0b4bd62e94d5b (patch)
tree3c259a2688e4851a4d60e21bafd2e10700ab7b2b /bl31
parentf426fc0519103defb3dcf4a9d86d985d48204424 (diff)
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
Diffstat (limited to 'bl31')
-rw-r--r--bl31/bl31_main.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/bl31/bl31_main.c b/bl31/bl31_main.c
index 7b0b675b..fae5ee4e 100644
--- a/bl31/bl31_main.c
+++ b/bl31/bl31_main.c
@@ -53,21 +53,27 @@ static int32_t (*bl32_init)(void);
******************************************************************************/
static uint32_t next_image_type = NON_SECURE;
+/*
+ * Implement the ARM Standard Service function to get arguments for a
+ * particular service.
+ */
+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, bl31_warm_entrypoint);
+
+ /* PSCI is the only ARM Standard Service implemented */
+ assert(svc_mask == PSCI_FID_MASK);
+
+ return (uintptr_t)&psci_args;
+}
+
/*******************************************************************************
* Simple function to initialise all BL31 helper libraries.
******************************************************************************/
void bl31_lib_init(void)
{
- /* Setup the arguments for PSCI Library */
- DEFINE_STATIC_PSCI_LIB_ARGS_V1(psci_args, bl31_warm_entrypoint);
-
cm_init();
-
- /*
- * Initialize the PSCI library here. This also does EL3 architectural
- * setup.
- */
- psci_setup(&psci_args);
}
/*******************************************************************************
@@ -89,7 +95,7 @@ void bl31_main(void)
/* Initialise helper libraries */
bl31_lib_init();
- /* Initialize the runtime services e.g. psci */
+ /* Initialize the runtime services e.g. psci. */
INFO("BL31: Initializing runtime services\n");
runtime_svc_init();