Commit e246617b authored by Leo Yan's avatar Leo Yan
Browse files

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: default avatarMatthias Welwarsky <maw@sysgo.com>
Signed-off-by: default avatarLeo Yan <leo.yan@linaro.org>
parent e524d78f
...@@ -40,7 +40,9 @@ static int hikey_pwr_domain_on(u_register_t mpidr) ...@@ -40,7 +40,9 @@ static int hikey_pwr_domain_on(u_register_t mpidr)
hisi_ipc_cluster_on(cpu, cluster); hisi_ipc_cluster_on(cpu, cluster);
hisi_pwrc_set_core_bx_addr(cpu, cluster, hikey_sec_entrypoint); hisi_pwrc_set_core_bx_addr(cpu, cluster, hikey_sec_entrypoint);
hisi_pwrc_enable_debug(cpu, cluster);
hisi_ipc_cpu_on(cpu, cluster); hisi_ipc_cpu_on(cpu, cluster);
return 0; return 0;
} }
......
...@@ -51,6 +51,21 @@ void hisi_pwrc_set_cluster_wfi(unsigned int cluster) ...@@ -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) int hisi_pwrc_setup(void)
{ {
unsigned int reg, sec_entrypoint; unsigned int reg, sec_entrypoint;
......
...@@ -13,6 +13,8 @@ void hisi_pwrc_set_cluster_wfi(unsigned int id); ...@@ -13,6 +13,8 @@ void hisi_pwrc_set_cluster_wfi(unsigned int id);
void hisi_pwrc_set_core_bx_addr(unsigned int core, void hisi_pwrc_set_core_bx_addr(unsigned int core,
unsigned int cluster, unsigned int cluster,
uintptr_t entry_point); uintptr_t entry_point);
void hisi_pwrc_enable_debug(unsigned int core,
unsigned int cluster);
int hisi_pwrc_setup(void); int hisi_pwrc_setup(void);
#endif /*__ASSEMBLY__*/ #endif /*__ASSEMBLY__*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment