aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchin Gupta <achin.gupta@arm.com>2014-02-09 17:48:12 +0000
committerDan Handley <dan.handley@arm.com>2014-02-20 19:06:34 +0000
commit0a9f747379d81aef77e2ee8523dbb7eca22487c6 (patch)
tree7127521645437a8d8fdb5f1636c8642f12bce3b8
parent8aa0cd43a8c4c59012eb26fad11abbd7359ea114 (diff)
downloadarm-trusted-firmware-0a9f747379d81aef77e2ee8523dbb7eca22487c6.tar.gz
Move PSCI to runtime services directory
This patch creates a 'services' directory and moves the PSCI under it. Other runtime services e.g. the Secure Payload Dispatcher service will be placed under the same directory in the future. Also fixes issue ARM-software/tf-issues#12 Change-Id: I187f83dcb660b728f82155d91882e961d2255068
-rw-r--r--Makefile2
-rw-r--r--bl31/bl31.mk4
-rw-r--r--services/psci/psci_afflvl_off.c (renamed from common/psci/psci_afflvl_off.c)1
-rw-r--r--services/psci/psci_afflvl_on.c (renamed from common/psci/psci_afflvl_on.c)2
-rw-r--r--services/psci/psci_afflvl_suspend.c (renamed from common/psci/psci_afflvl_suspend.c)9
-rw-r--r--services/psci/psci_common.c (renamed from common/psci/psci_common.c)0
-rw-r--r--services/psci/psci_entry.S (renamed from common/psci/psci_entry.S)0
-rw-r--r--services/psci/psci_main.c (renamed from common/psci/psci_main.c)0
-rw-r--r--services/psci/psci_private.h (renamed from common/psci/psci_private.h)0
-rw-r--r--services/psci/psci_setup.c (renamed from common/psci/psci_setup.c)0
10 files changed, 15 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 4d925b3..a5a3a78 100644
--- a/Makefile
+++ b/Makefile
@@ -131,7 +131,7 @@ INCLUDES += -Ilib/include/ \
-Iinclude/${ARCH}/ \
-Iinclude/ \
-Iarch/system/gic \
- -Icommon/psci \
+ -Iservices/psci \
-Iinclude/stdlib \
-Iinclude/stdlib/sys \
-Iplat/${PLAT} \
diff --git a/bl31/bl31.mk b/bl31/bl31.mk
index fec8ebe..1522b83 100644
--- a/bl31/bl31.mk
+++ b/bl31/bl31.mk
@@ -33,13 +33,13 @@ vpath %.c common \
arch/system/gic \
plat/${PLAT} \
arch/${ARCH} \
- common/psci \
+ services/psci \
lib/sync/locks/bakery \
plat/${PLAT}/${ARCH} \
${PLAT_BL31_C_VPATH}
vpath %.S lib/arch/${ARCH} \
- common/psci \
+ services/psci \
include \
plat/${PLAT}/${ARCH} \
lib/sync/locks/exclusive \
diff --git a/common/psci/psci_afflvl_off.c b/services/psci/psci_afflvl_off.c
index 1d8f291..72557aa 100644
--- a/common/psci/psci_afflvl_off.c
+++ b/services/psci/psci_afflvl_off.c
@@ -31,6 +31,7 @@
#include <stdio.h>
#include <string.h>
#include <assert.h>
+#include <debug.h>
#include <arch_helpers.h>
#include <console.h>
#include <platform.h>
diff --git a/common/psci/psci_afflvl_on.c b/services/psci/psci_afflvl_on.c
index 14f524c..d22904c 100644
--- a/common/psci/psci_afflvl_on.c
+++ b/services/psci/psci_afflvl_on.c
@@ -31,11 +31,13 @@
#include <stdio.h>
#include <string.h>
#include <assert.h>
+#include <debug.h>
#include <arch_helpers.h>
#include <console.h>
#include <platform.h>
#include <psci.h>
#include <psci_private.h>
+#include <context_mgmt.h>
typedef int (*afflvl_on_handler)(unsigned long,
aff_map_node *,
diff --git a/common/psci/psci_afflvl_suspend.c b/services/psci/psci_afflvl_suspend.c
index c12ad43..4391580 100644
--- a/common/psci/psci_afflvl_suspend.c
+++ b/services/psci/psci_afflvl_suspend.c
@@ -31,6 +31,7 @@
#include <stdio.h>
#include <string.h>
#include <assert.h>
+#include <debug.h>
#include <arch_helpers.h>
#include <console.h>
#include <platform.h>
@@ -87,6 +88,7 @@ static int psci_afflvl0_suspend(unsigned long mpidr,
{
unsigned int index, plat_state;
unsigned long psci_entrypoint, sctlr = read_sctlr();
+ el3_state *saved_el3_state;
int rc = PSCI_E_SUCCESS;
/* Sanity check to safeguard against data corruption */
@@ -112,6 +114,13 @@ static int psci_afflvl0_suspend(unsigned long mpidr,
cm_el3_sysregs_context_save(NON_SECURE);
rc = PSCI_E_SUCCESS;
+ /*
+ * The EL3 state to PoC since it will be accessed after a
+ * reset with the caches turned off
+ */
+ saved_el3_state = get_el3state_ctx(cm_get_context(mpidr, NON_SECURE));
+ flush_dcache_range((uint64_t) saved_el3_state, sizeof(*saved_el3_state));
+
/* Set the secure world (EL3) re-entry point after BL1 */
psci_entrypoint = (unsigned long) psci_aff_suspend_finish_entry;
diff --git a/common/psci/psci_common.c b/services/psci/psci_common.c
index 214db78..214db78 100644
--- a/common/psci/psci_common.c
+++ b/services/psci/psci_common.c
diff --git a/common/psci/psci_entry.S b/services/psci/psci_entry.S
index 15e074c..15e074c 100644
--- a/common/psci/psci_entry.S
+++ b/services/psci/psci_entry.S
diff --git a/common/psci/psci_main.c b/services/psci/psci_main.c
index 67f189d..67f189d 100644
--- a/common/psci/psci_main.c
+++ b/services/psci/psci_main.c
diff --git a/common/psci/psci_private.h b/services/psci/psci_private.h
index 3d7ae74..3d7ae74 100644
--- a/common/psci/psci_private.h
+++ b/services/psci/psci_private.h
diff --git a/common/psci/psci_setup.c b/services/psci/psci_setup.c
index 8d7903c..8d7903c 100644
--- a/common/psci/psci_setup.c
+++ b/services/psci/psci_setup.c