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/Kconfig b/arch/arm/mach-msm/Kconfig
index f3ae47e..db2eda5 100644
--- a/arch/arm/mach-msm/Kconfig
+++ b/arch/arm/mach-msm/Kconfig
@@ -133,6 +133,7 @@
select MSM_AUDIO_QDSP6 if SND_SOC
select CPU_HAS_L2_PMU
select MSM_SPM_V2
+ select HAS_QDSS
select MSM_L2_SPM
select MSM_NATIVE_RESTART
select DONT_MAP_HOLE_AFTER_MEMBANK0
@@ -869,13 +870,6 @@
help
Select this if the L2 cache controller has a Performance Monitoring Unit.
-config MSM_JTAG_V7
- depends on CPU_V7
- default y if DEBUG_KERNEL
- bool "JTAG debug support"
- help
- Add additional support for JTAG kernel debugging.
-
config HTC_HEADSET
tristate "HTC 2 Wire detection driver"
default n
@@ -1682,25 +1676,43 @@
make the kernel reboot on a kernel panic - that must be
enabled via another mechanism.
+config HAS_QDSS
+ bool "QDSS Present"
+ help
+ Select this if the chip has Qualcomm Debug Subsystem implemented.
+
+config MSM_DEBUG_ACROSS_PC
+ bool "Debug support across power collapse"
+ help
+ Enables debug state to be saved and restored across power collapse.
+
+config MSM_JTAG_V7
+ depends on CPU_V7 && !HAS_QDSS
+ default y if DEBUG_KERNEL
+ bool "JTAG debug support"
+ select MSM_DEBUG_ACROSS_PC
+ help
+ Add additional support for JTAG kernel debugging.
+
config MSM_TRACE_ACROSS_PC
bool "Trace support across power collapse"
- depends on ARCH_MSM8X60 || ARCH_MSM8960
help
Enables trace state to be saved and restored across power collapse.
config MSM_ETM
tristate "Enable MSM ETM and ETB"
- depends on ARCH_MSM8X60
+ depends on ARCH_MSM8X60 && !HAS_QDSS
select MSM_TRACE_ACROSS_PC
help
Enables embedded trace collection on Qualcomm v7 CPUs.
config MSM_QDSS
- bool "Coresight tracing support"
- depends on ARCH_MSM8960
+ bool "Qualcomm Debug Subsystem"
+ depends on HAS_QDSS
+ select MSM_DEBUG_ACROSS_PC
select MSM_TRACE_ACROSS_PC
help
- Enables support for Qualcomm debug subsystem.
+ Enables support for Qualcomm Debug Subsystem.
config MSM_SLEEP_STATS
bool "Enable exporting of MSM sleep stats to userspace"