From 759ec93b6916dccca3e445e20b3bd2e20d1117d0 Mon Sep 17 00:00:00 2001 From: Vikram Kanigiri Date: Tue, 1 Apr 2014 19:26:26 +0100 Subject: Preserve PSCI cpu_suspend 'power_state' parameter. This patch saves the 'power_state' parameter prior to suspending a cpu and invalidates it upon its resumption. The 'affinity level' and 'state id' fields of this parameter can be read using a set of public and private apis. Validation of power state parameter is introduced which checks for SBZ bits are zero. This change also takes care of flushing the parameter from the cache to main memory. This ensures that it is available after cpu reset when the caches and mmu are turned off. The earlier support for saving only the 'affinity level' field of the 'power_state' parameter has also been reworked. Fixes ARM-Software/tf-issues#26 Fixes ARM-Software/tf-issues#130 Change-Id: Ic007ccb5e39bf01e0b67390565d3b4be33f5960a --- services/std_svc/psci/psci_setup.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'services/std_svc/psci/psci_setup.c') diff --git a/services/std_svc/psci/psci_setup.c b/services/std_svc/psci/psci_setup.c index e3a5d5d0..4525d78d 100644 --- a/services/std_svc/psci/psci_setup.c +++ b/services/std_svc/psci/psci_setup.c @@ -183,6 +183,8 @@ static void psci_init_aff_map_node(unsigned long mpidr, assert(psci_ns_einfo_idx < PSCI_NUM_AFFS); psci_aff_map[idx].data = psci_ns_einfo_idx; + /* Invalidate the suspend context for the node */ + psci_suspend_context[psci_ns_einfo_idx].power_state = PSCI_INVALID_DATA; psci_ns_einfo_idx++; /* -- cgit