summaryrefslogtreecommitdiff
path: root/services
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 /services
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 'services')
-rw-r--r--services/std_svc/std_svc_setup.c18
1 files changed, 17 insertions, 1 deletions
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 <assert.h>
#include <debug.h>
#include <psci.h>
#include <runtime_svc.h>
@@ -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
);