feat(tc): add save/restore DSU PMU register support
This patch adds support for preserving DSU PMU registers
over a power cycle in TC platform.
These PMU registers need to be manually saved/restored
because they are part of cluster power domain and OS
doesn't know when DSU is powered OFF.
Change-Id: Ife9573f205d99d092039cb95674e7434bb5f9239
Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
diff --git a/plat/arm/css/common/css_pm.c b/plat/arm/css/common/css_pm.c
index bb64e73..db4a169 100644
--- a/plat/arm/css/common/css_pm.c
+++ b/plat/arm/css/common/css_pm.c
@@ -12,6 +12,7 @@
#include <bl31/interrupt_mgmt.h>
#include <common/debug.h>
#include <drivers/arm/css/css_scp.h>
+#include <drivers/arm/css/dsu.h>
#include <lib/cassert.h>
#include <plat/arm/common/plat_arm.h>
@@ -82,8 +83,12 @@
* Perform the common cluster specific operations i.e enable coherency
* if this cluster was off.
*/
- if (CSS_CLUSTER_PWR_STATE(target_state) == ARM_LOCAL_STATE_OFF)
+ if (CSS_CLUSTER_PWR_STATE(target_state) == ARM_LOCAL_STATE_OFF) {
+#if PRESERVE_DSU_PMU_REGS
+ cluster_on_dsu_pmu_context_restore();
+#endif
plat_arm_interconnect_enter_coherency();
+ }
}
/*******************************************************************************
@@ -131,8 +136,12 @@
plat_arm_gic_cpuif_disable();
/* Cluster is to be turned off, so disable coherency */
- if (CSS_CLUSTER_PWR_STATE(target_state) == ARM_LOCAL_STATE_OFF)
+ if (CSS_CLUSTER_PWR_STATE(target_state) == ARM_LOCAL_STATE_OFF) {
+#if PRESERVE_DSU_PMU_REGS
+ cluster_off_dsu_pmu_context_save();
+#endif
plat_arm_interconnect_exit_coherency();
+ }
}
/*******************************************************************************