enable GP timer 12 as wakeup source
cover enable GP timer 12 as wakeup source
This series enables GP timer 12 as a wakeup source since it is in the WKUP powerdomain.
Since Beagle boards <= B4 need to use gptimer12, this will allow these boards to sleep-when-idle using gptimer12 as the wakeup timer.
I've verified on my ES2.1 beagle that gptimer12 can wakeup the system from retention and off-mode.
Special thanks to Paul Walmsley for some advice on getting this working.
Kevin Hilman (3):
OMAP: move GP timer selection alongside other timer options
OMAP: dmtimer: enable all timers to be wakeup events
OMAP3: PM: enable gptimer12 as a wakeup source
arch/arm/mach-omap2/Kconfig | 16 ---------------- arch/arm/mach-omap2/pm34xx.c | 6 ++++-- arch/arm/mach-omap2/prcm-common.h | 2 ++ arch/arm/plat-omap/Kconfig | 15 +++++++++++++++ arch/arm/plat-omap/dmtimer.c | 6 ++---- 5 files changed, 23 insertions(+), 22 deletions(-)
PATCH 1/3 OMAP: move GP timer selection alongside other timer options
--- arch/arm/mach-omap2/Kconfig | 16 ---------------- arch/arm/plat-omap/Kconfig | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 16 deletions(-)
arch/arm/mach-omap2/Kconfig +0 -16
@@ -132,19 +132,3 @@ config MACH_OVERO config MACH_OMAP3_PANDORA bool "OMAP3 Pandora" depends on ARCH_OMAP3 && ARCH_OMAP34XX - -config OMAP_TICK_GPTIMER - int "GPTIMER used for system tick timer" - depends on ARCH_OMAP2 || ARCH_OMAP3 - range 1 12 - default 1 - help - Linux uses one of the twelve on-board OMAP GPTIMER blocks to generate - system tick interrupts. The twelve GPTIMERs have slightly - different powerdomain, source clock, and security properties - (mostly documented in the OMAP3 TRMs) that can affect the selection - of which GPTIMER to use. The historical default is GPTIMER1. - If CONFIG_OMAP_32K_TIMER is selected, Beagle may require GPTIMER12 - due to hardware sensitivity to glitches on the OMAP 32kHz clock - input. -
arch/arm/plat-omap/Kconfig +15 -0
@@ -214,6 +214,21 @@ config OMAP_32K_TIMER_HZ Kernel internal timer frequency should be a divisor of 32768, such as 64 or 128. +config OMAP_TICK_GPTIMER + int "GPTIMER used for system tick timer" + depends on ARCH_OMAP2 || ARCH_OMAP3 + range 1 12 + default 1 + help + Linux uses one of the twelve on-board OMAP GPTIMER blocks to generate + system tick interrupts. The twelve GPTIMERs have slightly + different powerdomain, source clock, and security properties + (mostly documented in the OMAP3 TRMs) that can affect the selection + of which GPTIMER to use. The historical default is GPTIMER1. + If CONFIG_OMAP_32K_TIMER is selected, Beagle may require GPTIMER12 + due to hardware sensitivity to glitches on the OMAP 32kHz clock + input. + config OMAP_DM_TIMER bool "Use dual-mode timer" depends on ARCH_OMAP16XX || ARCH_OMAP24XX || ARCH_OMAP34XX
Signature · 1 line
1.6.0.3
PATCH 2/3 OMAP: dmtimer: enable all timers to be wakeup events
All GP timers on OMAP2/3 can be wakeup events. The wakeup status is cleared in the PRCM interrupt handler.
--- arch/arm/plat-omap/dmtimer.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
arch/arm/plat-omap/dmtimer.c +2 -4
@@ -320,11 +320,9 @@ static void omap_dm_timer_reset(struct omap_dm_timer *timer) l |=0x2 <<8 ;/* Set clock activity to perserve f-clock on idle */ /* -* Enable wake-up only for GPT1 on OMAP2 CPUs. -* FIXME: All timers should have wake-up enabled and clear -* PRCM status. +* Enable wake-up on OMAP2 CPUs. */ -if (cpu_class_is_omap2 () && (timer == &dm_timers[0 ])) +if (cpu_class_is_omap2 ()) l |=1 <<2 ;omap_dm_timer_write_reg (timer,OMAP_TIMER_OCP_CFG_REG , l);
Signature · 1 line
1.6.0.3
PATCH 3/3 OMAP3: PM: enable gptimer12 as a wakeup source
GPT12 is in the WKUP powerdomain and can be useful as the system timer and thus a wakeup source for sleep while idle.
--- arch/arm/mach-omap2/pm34xx.c | 6 ++++-- arch/arm/mach-omap2/prcm-common.h | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/pm34xx.c +4 -2
@@ -505,10 +505,12 @@ static void __init prcm_setup_regs(void) OMAP3_PRM_CLKSRC_CTRL_OFFSET);/* setup wakup source */ -prm_write_mod_reg (OMAP3430_EN_IO |OMAP3430_EN_GPIO1 |OMAP3430_EN_GPT1 , +prm_write_mod_reg (OMAP3430_EN_IO |OMAP3430_EN_GPIO1 | +OMAP3430_EN_GPT1 |OMAP3430_EN_GPT12 ,WKUP_MOD ,PM_WKEN );/* No need to write EN_IO, that is always enabled */ -prm_write_mod_reg (OMAP3430_EN_GPIO1 |OMAP3430_EN_GPT1 , +prm_write_mod_reg (OMAP3430_EN_GPIO1 |OMAP3430_EN_GPT1 | +OMAP3430_EN_GPT12 ,WKUP_MOD ,OMAP3430_PM_MPUGRPSEL );/* For some reason IO doesn't generate wakeup event even if * it is selected to mpu wakeup goup */
arch/arm/mach-omap2/prcm-common.h +2 -0
@@ -276,6 +276,8 @@/* CM_FCLKEN_WKUP, CM_ICLKEN_WKUP, PM_WKEN_WKUP shared bits */ #define OMAP3430_EN_GPIO1 (1 << 3)#define OMAP3430_EN_GPIO1_SHIFT 3 +#define OMAP3430_EN_GPT12 (1 << 1) +#define OMAP3430_EN_GPT12_SHIFT 1#define OMAP3430_EN_GPT1 (1 << 0)#define OMAP3430_EN_GPT1_SHIFT 0
Signature · 1 line
1.6.0.3