diff options
author | Rabin Vincent <rabin.vincent@stericsson.com> | 2011-06-17 12:31:42 +0530 |
---|---|---|
committer | said m bagheri <ebgheri@steludxu2848.(none)> | 2011-06-29 10:30:35 +0200 |
commit | 766fe351fbc520402312c1b84240e44d8754ce18 (patch) | |
tree | b223dceb634e23daf2111e16719c911bd67ff31a /arch | |
parent | be6039e3c724bce3d561d390b0fc1668ca3364cd (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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-ux500/pm/context.c | 19 |
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 f76be7958f6..429b724b4d0 100644 --- a/arch/arm/mach-ux500/pm/context.c +++ b/arch/arm/mach-ux500/pm/context.c @@ -85,6 +85,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 @@ -299,6 +302,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 @@ -306,6 +319,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 + @@ -329,6 +345,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); |