msm: qdss: save and restore debug registers across PC
Debug OS lock register is on the core (Krait) power domain and
so looses its contents on a power collapse. It's power on reset
state is locked and external debugger accesses are not allowed
while the debug OS lock is set.
This prevents JTag users from setting breakpoints after the first
Krait power collapse.
Saving and restoring debug registers across power collapse helps
preserve the breakpoints as well as clear the debug OS lock as
part of this procedure while coming out of power collapse.
CRs-Fixed: 310982
Change-Id: Icfccea17e556474241bf495885d9bb575d7571bf
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
diff --git a/arch/arm/mach-msm/qdss.h b/arch/arm/mach-msm/qdss.h
index a41d7e2..8d346c4 100644
--- a/arch/arm/mach-msm/qdss.h
+++ b/arch/arm/mach-msm/qdss.h
@@ -56,6 +56,13 @@
void funnel_enable(uint8_t id, uint32_t port_mask);
void funnel_disable(uint8_t id, uint32_t port_mask);
+#ifdef CONFIG_MSM_DEBUG_ACROSS_PC
+extern void msm_save_jtag_debug(void);
+extern void msm_restore_jtag_debug(void);
+#else
+static inline void msm_save_jtag_debug(void) {}
+static inline void msm_restore_jtag_debug(void) {}
+#endif
#ifdef CONFIG_MSM_TRACE_ACROSS_PC
extern void etm_save_reg_check(void);
extern void etm_restore_reg_check(void);