diff --git a/Makefile b/Makefile index 4d925b3d7d34fcc048e66e77529d48e52465772b..a5a3a78e9a7a4ec772e4306d72c5f3dc8beeee84 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 fec8ebe249643066030984f63aaf79d92a9ab4ac..1522b8399dd85c8156bcfd56edf87f5bc15ee82e 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 similarity index 99% rename from common/psci/psci_afflvl_off.c rename to services/psci/psci_afflvl_off.c index 1d8f2912da84a895d1348944b5876049c08cac80..72557aa318e51b186bc872489e3da630de31cf82 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 similarity index 99% rename from common/psci/psci_afflvl_on.c rename to services/psci/psci_afflvl_on.c index 14f524c8fe6fcdc4657e7774189ab622c7eb64f9..d22904cd9559ddc297015dc141b78a4d1895f46d 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 similarity index 98% rename from common/psci/psci_afflvl_suspend.c rename to services/psci/psci_afflvl_suspend.c index c12ad437ce011c7a5c0130f7e45c05339f229fba..4391580be270df61d816857d91144b93b680a5bd 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 similarity index 100% rename from common/psci/psci_common.c rename to services/psci/psci_common.c diff --git a/common/psci/psci_entry.S b/services/psci/psci_entry.S similarity index 100% rename from common/psci/psci_entry.S rename to services/psci/psci_entry.S diff --git a/common/psci/psci_main.c b/services/psci/psci_main.c similarity index 100% rename from common/psci/psci_main.c rename to services/psci/psci_main.c diff --git a/common/psci/psci_private.h b/services/psci/psci_private.h similarity index 100% rename from common/psci/psci_private.h rename to services/psci/psci_private.h diff --git a/common/psci/psci_setup.c b/services/psci/psci_setup.c similarity index 100% rename from common/psci/psci_setup.c rename to services/psci/psci_setup.c