* [PATCH/RFC] ARM: OMAP2: PRCM: more init, and clear wakeup events.
@ 2007-11-01 23:11 Kevin Hilman
2007-11-17 0:01 ` Tony Lindgren
0 siblings, 1 reply; 2+ messages in thread
From: Kevin Hilman @ 2007-11-01 23:11 UTC (permalink / raw)
To: linux-omap-open-source
More initialization of wake dependencies.
Clear PRCM wake-up events after coming out of full-retention.
Signed-off-by: Kevin Hilman <khilman@mvista.com>
---
arch/arm/mach-omap2/pm.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
Index: dev/arch/arm/mach-omap2/pm.c
===================================================================
--- dev.orig/arch/arm/mach-omap2/pm.c
+++ dev/arch/arm/mach-omap2/pm.c
@@ -397,7 +397,7 @@ void omap2_allow_sleep(void)
static void omap2_enter_full_retention(void)
{
- u32 sleep_time = 0;
+ u32 l, sleep_time = 0;
/* There is 1 reference hold for all children of the oscillator
* clock, the following will remove it. If no one else uses the
@@ -450,6 +450,24 @@ no_sleep:
clk_enable(osc_ck);
+ /* clear CORE wake-up events */
+ prm_write_mod_reg(0xffffffff, CORE_MOD, PM_WKST1);
+ prm_write_mod_reg(0xffffffff, CORE_MOD, OMAP24XX_PM_WKST2);
+
+ /* wakeup domain events */
+ l = prm_read_mod_reg(WKUP_MOD, PM_WKST);
+ l &= 0x5; /* bit 1: GPT1, bit5 GPIO */
+ prm_write_mod_reg(l, WKUP_MOD, PM_WKST);
+
+ /* MPU domain wake events */
+ l = prm_read_reg(OMAP24XX_PRCM_IRQSTATUS_MPU);
+ if (l & 0x01)
+ prm_write_reg(0x01, OMAP24XX_PRCM_IRQSTATUS_MPU);
+ if (l & 0x20)
+ prm_write_reg(0x20, OMAP24XX_PRCM_IRQSTATUS_MPU);
+
+ /* Mask future PRCM-to-MPU interrupts */
+ prm_write_reg(0x0, OMAP24XX_PRCM_IRQSTATUS_MPU);
}
static int omap2_i2c_active(void)
@@ -654,6 +672,9 @@ static void __init prcm_setup_regs(void)
prm_write_mod_reg(OMAP_EN_WKUP, MPU_MOD, PM_WKDEP);
prm_write_mod_reg(0, OMAP24XX_DSP_MOD, PM_WKDEP);
prm_write_mod_reg(0, GFX_MOD, PM_WKDEP);
+ prm_write_mod_reg(0, CORE_MOD, PM_WKDEP);
+ if (cpu_is_omap2430())
+ prm_write_mod_reg(0, OMAP2430_MDM_MOD, PM_WKDEP);
l = prm_read_mod_reg(CORE_MOD, PM_PWSTCTRL);
/* Enable retention for all memory blocks */
--
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH/RFC] ARM: OMAP2: PRCM: more init, and clear wakeup events.
2007-11-01 23:11 [PATCH/RFC] ARM: OMAP2: PRCM: more init, and clear wakeup events Kevin Hilman
@ 2007-11-17 0:01 ` Tony Lindgren
0 siblings, 0 replies; 2+ messages in thread
From: Tony Lindgren @ 2007-11-17 0:01 UTC (permalink / raw)
To: Kevin Hilman; +Cc: linux-omap-open-source
* Kevin Hilman <khilman@mvista.com> [071101 16:13]:
> More initialization of wake dependencies.
> Clear PRCM wake-up events after coming out of full-retention.
>
> Signed-off-by: Kevin Hilman <khilman@mvista.com>
>
> ---
> arch/arm/mach-omap2/pm.c | 23 ++++++++++++++++++++++-
> 1 file changed, 22 insertions(+), 1 deletion(-)
>
> Index: dev/arch/arm/mach-omap2/pm.c
> ===================================================================
> --- dev.orig/arch/arm/mach-omap2/pm.c
> +++ dev/arch/arm/mach-omap2/pm.c
> @@ -397,7 +397,7 @@ void omap2_allow_sleep(void)
>
> static void omap2_enter_full_retention(void)
> {
> - u32 sleep_time = 0;
> + u32 l, sleep_time = 0;
>
> /* There is 1 reference hold for all children of the oscillator
> * clock, the following will remove it. If no one else uses the
> @@ -450,6 +450,24 @@ no_sleep:
>
> clk_enable(osc_ck);
>
> + /* clear CORE wake-up events */
> + prm_write_mod_reg(0xffffffff, CORE_MOD, PM_WKST1);
> + prm_write_mod_reg(0xffffffff, CORE_MOD, OMAP24XX_PM_WKST2);
> +
> + /* wakeup domain events */
> + l = prm_read_mod_reg(WKUP_MOD, PM_WKST);
> + l &= 0x5; /* bit 1: GPT1, bit5 GPIO */
> + prm_write_mod_reg(l, WKUP_MOD, PM_WKST);
> +
> + /* MPU domain wake events */
> + l = prm_read_reg(OMAP24XX_PRCM_IRQSTATUS_MPU);
> + if (l & 0x01)
> + prm_write_reg(0x01, OMAP24XX_PRCM_IRQSTATUS_MPU);
> + if (l & 0x20)
> + prm_write_reg(0x20, OMAP24XX_PRCM_IRQSTATUS_MPU);
> +
> + /* Mask future PRCM-to-MPU interrupts */
> + prm_write_reg(0x0, OMAP24XX_PRCM_IRQSTATUS_MPU);
> }
>
> static int omap2_i2c_active(void)
> @@ -654,6 +672,9 @@ static void __init prcm_setup_regs(void)
> prm_write_mod_reg(OMAP_EN_WKUP, MPU_MOD, PM_WKDEP);
> prm_write_mod_reg(0, OMAP24XX_DSP_MOD, PM_WKDEP);
> prm_write_mod_reg(0, GFX_MOD, PM_WKDEP);
> + prm_write_mod_reg(0, CORE_MOD, PM_WKDEP);
> + if (cpu_is_omap2430())
> + prm_write_mod_reg(0, OMAP2430_MDM_MOD, PM_WKDEP);
>
> l = prm_read_mod_reg(CORE_MOD, PM_PWSTCTRL);
> /* Enable retention for all memory blocks */
> --
Pushing today.
Tony
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-11-17 0:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-01 23:11 [PATCH/RFC] ARM: OMAP2: PRCM: more init, and clear wakeup events Kevin Hilman
2007-11-17 0:01 ` Tony Lindgren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox