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 --- services/std_svc/std_svc_setup.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'services/std_svc') diff --git a/services/std_svc/std_svc_setup.c b/services/std_svc/std_svc_setup.c index 06647e00..e0966014 100644 --- a/services/std_svc/std_svc_setup.c +++ b/services/std_svc/std_svc_setup.c @@ -28,6 +28,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include #include @@ -41,6 +42,21 @@ DEFINE_SVC_UUID(arm_svc_uid, 0x108d905b, 0xf863, 0x47e8, 0xae, 0x2d, 0xc0, 0xfb, 0x56, 0x41, 0xf6, 0xe2); +/* Setup Standard Services */ +static int32_t std_svc_setup(void) +{ + uintptr_t svc_arg; + + svc_arg = get_arm_std_svc_args(PSCI_FID_MASK); + assert(svc_arg); + + /* + * PSCI is the only specification implemented as a Standard Service. + * The `psci_setup()` also does EL3 architectural setup. + */ + return psci_setup((const psci_lib_args_t *)svc_arg); +} + /* * Top-level Standard Service SMC handler. This handler will in turn dispatch * calls to PSCI SMC handler @@ -93,6 +109,6 @@ DECLARE_RT_SVC( OEN_STD_START, OEN_STD_END, SMC_TYPE_FAST, - NULL, + std_svc_setup, std_svc_smc_handler ); -- cgit