summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>2011-09-26 12:03:22 +0200
committerRobert Marklund <robert.marklund@stericsson.com>2011-10-05 13:01:21 +0200
commit2571652b26cb86109705f2ba1e1e2043b1180523 (patch)
tree1e8ee07dc514ea07ab3656b9bc309630bb665526
parent0fcb8ab9af1885093c7d78dc422b077aea48b641 (diff)
ux500: jtag: consolidate jtag enabled checks
Jtag debugging can be disabled from the secure world or form kernel configuration. Consolidate all jtag enabled checks for both u8500 and u5500. Change-Id: Ife5f4c47dd6470d2d9e31cbb83438c73131a4db5 Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/32141 Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Tested-by: Jonas ABERG <jonas.aberg@stericsson.com>
-rw-r--r--arch/arm/mach-ux500/pm/context.c18
-rw-r--r--arch/arm/mach-ux500/product.c19
2 files changed, 19 insertions, 18 deletions
diff --git a/arch/arm/mach-ux500/pm/context.c b/arch/arm/mach-ux500/pm/context.c
index b2b119c1c6c..b22e3ad7fd1 100644
--- a/arch/arm/mach-ux500/pm/context.c
+++ b/arch/arm/mach-ux500/pm/context.c
@@ -93,9 +93,6 @@
#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
@@ -310,20 +307,9 @@ static void restore_stm_ape(void)
context_stm_ape.base + STM_CR_OFFSET);
}
-static bool tpiu_clocked(void)
+static bool inline tpiu_clocked(void)
{
-#ifdef CONFIG_UX500_DEBUG_NO_LAUTERBACH
- return false;
-#else
- if (cpu_is_u5500())
- return readl_relaxed(__io_address(U5500_PRCMU_DBG_PWRCTRL))
- & PRCMU_DBG_PWRCTRL_A9DBGCLKEN;
-
- if (cpu_is_u8500())
- return ux500_jtag_enabled();
-
- return true;
-#endif
+ return ux500_jtag_enabled();
}
/*
diff --git a/arch/arm/mach-ux500/product.c b/arch/arm/mach-ux500/product.c
index c601a2e00ae..5e8eba9b16a 100644
--- a/arch/arm/mach-ux500/product.c
+++ b/arch/arm/mach-ux500/product.c
@@ -11,6 +11,7 @@
#include <linux/kernel.h>
#include <linux/init.h>
+#include <linux/io.h>
#include <linux/tee.h>
#include <linux/module.h>
#include <mach/hardware.h>
@@ -21,12 +22,26 @@
#define STATIC_TEE_TA_START_CLOCKSEQ \
{0x8E, 0x12, 0xEC, 0xDB, 0xDF, 0xD7, 0x20, 0x85}
+#define U5500_PRCMU_DBG_PWRCTRL (U5500_PRCMU_BASE + 0x4AC)
+#define PRCMU_DBG_PWRCTRL_A9DBGCLKEN (1 << 4)
+
static struct tee_product_config product_config;
bool ux500_jtag_enabled(void)
{
- return (product_config.rt_flags & TEE_RT_FLAGS_JTAG_ENABLED) ==
- TEE_RT_FLAGS_JTAG_ENABLED;
+#ifdef CONFIG_UX500_DEBUG_NO_LAUTERBACH
+ return false;
+#else
+ if (cpu_is_u5500())
+ return readl_relaxed(__io_address(U5500_PRCMU_DBG_PWRCTRL))
+ & PRCMU_DBG_PWRCTRL_A9DBGCLKEN;
+
+ if (cpu_is_u8500())
+ return (product_config.rt_flags & TEE_RT_FLAGS_JTAG_ENABLED) ==
+ TEE_RT_FLAGS_JTAG_ENABLED;
+
+ return true;
+#endif
}
static int __init product_detect(void)