summaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2/pm34xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/pm34xx.c')
-rw-r--r--arch/arm/mach-omap2/pm34xx.c84
1 files changed, 83 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index bdb2388ef4c..ebe383ded55 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -281,6 +281,86 @@ static int omap34xx_do_sram_idle(unsigned long save_state)
return 0;
}
+static u32 wkup_debug_get_reg(phys_addr_t reg)
+{
+ u32 val;
+ char *baseptr = ioremap(reg, 4);
+
+ val = *(u32 *)baseptr;
+ iounmap(baseptr);
+
+ return val;
+}
+
+struct wkup_debug_t {
+ char name[20];
+ u32 reg;
+};
+
+struct wkup_debug_t wkup_debug_map[] = {
+ {
+ .reg = 0x4831001C,
+ .name = "GPIO_IRQENABLE1",
+ },
+ {
+ .reg = 0x48310020,
+ .name = "GPIO_WAKEUPENABLE",
+ },
+ {
+ .reg = 0x48310010,
+ .name = "GPIO_SYSCONFIG",
+ },
+ {
+ .reg = 0x48310064,
+ .name = "GPIO_SETIRQENABLE1",
+ },
+ {
+ .reg = 0x48310084,
+ .name = "GPIO_SETWKUENA",
+ },
+ {
+ .reg = 0x48310048,
+ .name = "GPIO_RISINGDETECT",
+ },
+ {
+ .reg = 0x4831004C,
+ .name = "GPIO_FALLINGDETECT",
+ },
+ {
+ .reg = 0x4830681C,
+ .name = "PRM_IRQENABLE_MPU",
+ },
+ {
+ .reg = 0x483069C8,
+ .name = "PM_WKDEP_MPU",
+ },
+ {
+ .reg = 0x48306CA4,
+ .name = "PM_MPUGRPSEL_WKUP",
+ },
+ {
+ .reg = 0x48306CA0,
+ .name = "PM_WKEN_WKUP",
+ },
+ {
+ .reg = 0x48306CB0,
+ .name = "PM_WKST_WKUP",
+ },
+};
+
+static void wkup_debug_print_regs(void)
+{
+ int i;
+ u32 val;
+ struct wkup_debug_t *p = wkup_debug_map;
+
+ for (i = 0; i < ARRAY_SIZE(wkup_debug_map); i++) {
+ val = wkup_debug_get_reg(p->reg);
+ trace_printk("%s, 0x%x, val: 0x%x\n", p->name, p->reg, val);
+ p++;
+ }
+}
+
void omap_sram_idle(bool in_suspend)
{
/* Variable to tell what needs to be saved and restored
@@ -360,8 +440,10 @@ void omap_sram_idle(bool in_suspend)
core_next_state == PWRDM_POWER_OFF)
sdrc_pwr = sdrc_read_reg(SDRC_POWER);
- if (suspend_debug)
+ if (suspend_debug) {
pm_dbg_regs_save(1);
+ wkup_debug_print_regs();
+ }
/*
* omap3_arm_context is the location where some ARM context