summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRabin Vincent <rabin.vincent@stericsson.com>2011-06-17 12:31:42 +0530
committerPhilippe Langlais <philippe.langlais@linaro.org>2011-07-22 15:52:14 +0200
commit6792200a23d79d847f8a78bf6658c17aa58771cf (patch)
treebd8464092f3e2db588585dacefb061a34786ae2a
parent572d1def8c214b2f97e841e02e1ff5e3704a0f14 (diff)
u5500: pm: check for TPIU clock before context save/restore
DB5500 has a new bit in PRCM_DBG_PWRCTL to control the A9 Debug peripherals clock. This is off by default. ST-Ericsson Linux next: - ST-Ericsson ID: 332226 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I7429583d90d34a878472bc6de979a11baa8fae1b Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/25286 Reviewed-by: QATEST Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
-rw-r--r--arch/arm/mach-ux500/pm/context.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/mach-ux500/pm/context.c b/arch/arm/mach-ux500/pm/context.c
index 441f91dc655..a78f2d9dbb9 100644
--- a/arch/arm/mach-ux500/pm/context.c
+++ b/arch/arm/mach-ux500/pm/context.c
@@ -88,6 +88,9 @@
#define STM_MMC_OFFSET 0x08
#define STM_TER_OFFSET 0x10
+#define U5500_PRCMU_DBG_PWRCTRL (U5500_PRCMU_BASE + 0x4AC)
+#define PRCMU_DBG_PWRCTRL_A9DBGCLKEN (1 << 4)
+
#define TPIU_PORT_SIZE 0x4
#define TPIU_TRIGGER_COUNTER 0x104
#define TPIU_TRIGGER_MULTIPLIER 0x108
@@ -302,6 +305,16 @@ static void restore_stm_ape(void)
context_stm_ape.base + STM_CR_OFFSET);
}
+static bool tpiu_clocked(void)
+{
+ if (cpu_is_u5500()) {
+ return readl_relaxed(__io_address(U5500_PRCMU_DBG_PWRCTRL))
+ & PRCMU_DBG_PWRCTRL_A9DBGCLKEN;
+ }
+
+ return true;
+}
+
/*
* Save the context of the Trace Port Interface Unit (TPIU).
* Saving/restoring is needed for the PTM tracing to work together
@@ -309,6 +322,9 @@ static void restore_stm_ape(void)
*/
static void save_tpiu(void)
{
+ if (!tpiu_clocked())
+ return;
+
context_tpiu.port_size = readl(context_tpiu.base +
TPIU_PORT_SIZE);
context_tpiu.trigger_counter = readl(context_tpiu.base +
@@ -332,6 +348,9 @@ static void save_tpiu(void)
*/
static void restore_tpiu(void)
{
+ if (!tpiu_clocked())
+ return;
+
writel(TPIU_UNLOCK_CODE,
context_tpiu.base + TPIU_LOCK_ACCESS_REGISTER);