summaryrefslogtreecommitdiff
path: root/plat/arm/common/arm_common.c
diff options
context:
space:
mode:
authorSoby Mathew <soby.mathew@arm.com>2016-07-11 14:13:56 +0100
committerSoby Mathew <soby.mathew@arm.com>2016-08-10 18:01:38 +0100
commit877cf3ff12fc6b71ea44e2a4bad2b9303298433c (patch)
treee171be4265537d12cb961fbe90b77b596f1792db /plat/arm/common/arm_common.c
parentc11ba852b970f2a125442da26d907c0842f09a25 (diff)
AArch32: Add essential ARM platform and FVP support
This patch adds AArch32 support for FVP and implements common platform APIs like `plat_get_my_stack`, `plat_set_my_stack`, `plat_my_core_cos` for AArch32. Only Multi Processor(MP) implementations of these functions are considered in this patch. The ARM Standard platform layer helpers are implemented for AArch32 and the common makefiles are modified to cater for both AArch64 and AArch32 builds. Compatibility with the deprecated platform API is not supported for AArch32. Change-Id: Iad228400613eec91abf731b49e21a15bcf2833ea
Diffstat (limited to 'plat/arm/common/arm_common.c')
-rw-r--r--plat/arm/common/arm_common.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/plat/arm/common/arm_common.c b/plat/arm/common/arm_common.c
index 93355fe4..c53723d5 100644
--- a/plat/arm/common/arm_common.c
+++ b/plat/arm/common/arm_common.c
@@ -134,6 +134,7 @@ uint32_t arm_get_spsr_for_bl32_entry(void)
/*******************************************************************************
* Gets SPSR for BL33 entry
******************************************************************************/
+#ifndef AARCH32
uint32_t arm_get_spsr_for_bl33_entry(void)
{
unsigned long el_status;
@@ -154,6 +155,28 @@ uint32_t arm_get_spsr_for_bl33_entry(void)
spsr = SPSR_64(mode, MODE_SP_ELX, DISABLE_ALL_EXCEPTIONS);
return spsr;
}
+#else
+/*******************************************************************************
+ * Gets SPSR for BL33 entry
+ ******************************************************************************/
+uint32_t arm_get_spsr_for_bl33_entry(void)
+{
+ unsigned int hyp_status, mode, spsr;
+
+ hyp_status = GET_VIRT_EXT(read_id_pfr1());
+
+ mode = (hyp_status) ? MODE32_hyp : MODE32_svc;
+
+ /*
+ * TODO: Consider the possibility of specifying the SPSR in
+ * the FIP ToC and allowing the platform to have a say as
+ * well.
+ */
+ spsr = SPSR_MODE32(mode, plat_get_ns_image_entrypoint() & 0x1,
+ SPSR_E_LITTLE, DISABLE_ALL_EXCEPTIONS);
+ return spsr;
+}
+#endif /* AARCH32 */
/*******************************************************************************
* Configures access to the system counter timer module.