aboutsummaryrefslogtreecommitdiffstats
path: root/plat
diff options
context:
space:
mode:
authorLeo Yan <leo.yan@linaro.org>2017-09-07 14:56:32 +0800
committerLeo Yan <leo.yan@linaro.org>2017-09-07 16:57:31 +0800
commite246617b41825e5278ac0057e800afa3b3944fe3 (patch)
tree00c4aef07d814e06d29a189fe631762a13dc967b /plat
parente524d78f9fc904b0e831855145320384e9656a46 (diff)
downloadplatform_external_arm-trusted-firmware-e246617b41825e5278ac0057e800afa3b3944fe3.tar.gz
platform_external_arm-trusted-firmware-e246617b41825e5278ac0057e800afa3b3944fe3.tar.bz2
platform_external_arm-trusted-firmware-e246617b41825e5278ac0057e800afa3b3944fe3.zip
Hikey: enable CPU debug module
Every CPU has its own debug module and this module is used by JTAG debugging and coresight tracing. If without enabling it, it's easily to introduce lockup issue when we enable debugging features. This patch is to enable CPU debug module when power on CPU; this allows connecting to all cores through JTAG and used by kernel coresight driver. Signed-off-by: Matthias Welwarsky <maw@sysgo.com> Signed-off-by: Leo Yan <leo.yan@linaro.org>
Diffstat (limited to 'plat')
-rw-r--r--plat/hisilicon/hikey/hikey_pm.c2
-rw-r--r--plat/hisilicon/hikey/hisi_pwrc.c15
-rw-r--r--plat/hisilicon/hikey/include/hisi_pwrc.h2
3 files changed, 19 insertions, 0 deletions
diff --git a/plat/hisilicon/hikey/hikey_pm.c b/plat/hisilicon/hikey/hikey_pm.c
index c796e8a54..d4dd683e0 100644
--- a/plat/hisilicon/hikey/hikey_pm.c
+++ b/plat/hisilicon/hikey/hikey_pm.c
@@ -40,7 +40,9 @@ static int hikey_pwr_domain_on(u_register_t mpidr)
hisi_ipc_cluster_on(cpu, cluster);
hisi_pwrc_set_core_bx_addr(cpu, cluster, hikey_sec_entrypoint);
+ hisi_pwrc_enable_debug(cpu, cluster);
hisi_ipc_cpu_on(cpu, cluster);
+
return 0;
}
diff --git a/plat/hisilicon/hikey/hisi_pwrc.c b/plat/hisilicon/hikey/hisi_pwrc.c
index 8e9d1fc44..b635fb16f 100644
--- a/plat/hisilicon/hikey/hisi_pwrc.c
+++ b/plat/hisilicon/hikey/hisi_pwrc.c
@@ -51,6 +51,21 @@ void hisi_pwrc_set_cluster_wfi(unsigned int cluster)
}
}
+void hisi_pwrc_enable_debug(unsigned int core, unsigned int cluster)
+{
+ unsigned int val, enable;
+
+ enable = 1U << (core + PDBGUP_CLUSTER1_SHIFT * cluster);
+
+ /* Enable debug module */
+ val = mmio_read_32(ACPU_SC_PDBGUP_MBIST);
+ mmio_write_32(ACPU_SC_PDBGUP_MBIST, val | enable);
+ do {
+ /* RAW barrier */
+ val = mmio_read_32(ACPU_SC_PDBGUP_MBIST);
+ } while (!(val & enable));
+}
+
int hisi_pwrc_setup(void)
{
unsigned int reg, sec_entrypoint;
diff --git a/plat/hisilicon/hikey/include/hisi_pwrc.h b/plat/hisilicon/hikey/include/hisi_pwrc.h
index 3a87e72be..cffe70e3b 100644
--- a/plat/hisilicon/hikey/include/hisi_pwrc.h
+++ b/plat/hisilicon/hikey/include/hisi_pwrc.h
@@ -13,6 +13,8 @@ void hisi_pwrc_set_cluster_wfi(unsigned int id);
void hisi_pwrc_set_core_bx_addr(unsigned int core,
unsigned int cluster,
uintptr_t entry_point);
+void hisi_pwrc_enable_debug(unsigned int core,
+ unsigned int cluster);
int hisi_pwrc_setup(void);
#endif /*__ASSEMBLY__*/