Commit 0c00fb73 authored by Paul Walmsley's avatar Paul Walmsley Committed by Tony Lindgren

OMAP2/3 GPTIMER: allow system tick GPTIMER to be configurable at build

Add Kbuild code to allow the builder to select which GPTIMER block to use
for the Linux clockevents timer.  Practical choices at this point are
GPTIMER1 or GPTIMER12.  Both of these timers are in the WKUP powerdomain,
and so are unaffected by chip power management.  GPTIMER1 can use sys_clk
as a source, for applications where a high-resolution timer is more important
than power management.  GPTIMER12 has the special property that it has
the secure 32kHz oscillator as its source clock, which may be less prone
to glitches than the off-chip 32kHz oscillator.  But on HS devices, it may
not be available for Linux use.

At this point, it appears that most boards are fine with GPTIMER1, but
Beagle should use GPTIMER12.
Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent b5ea90ae
...@@ -122,3 +122,19 @@ config MACH_OMAP3EVM ...@@ -122,3 +122,19 @@ config MACH_OMAP3EVM
config MACH_OMAP3_BEAGLE config MACH_OMAP3_BEAGLE
bool "OMAP3 BEAGLE board" bool "OMAP3 BEAGLE board"
depends on ARCH_OMAP3 && ARCH_OMAP34XX 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.
...@@ -99,7 +99,7 @@ static void __init omap2_gp_clockevent_init(void) ...@@ -99,7 +99,7 @@ static void __init omap2_gp_clockevent_init(void)
{ {
u32 tick_rate; u32 tick_rate;
gptimer = omap_dm_timer_request_specific(1); gptimer = omap_dm_timer_request_specific(CONFIG_OMAP_TICK_GPTIMER);
BUG_ON(gptimer == NULL); BUG_ON(gptimer == NULL);
#if defined(CONFIG_OMAP_32K_TIMER) #if defined(CONFIG_OMAP_32K_TIMER)
...@@ -109,6 +109,9 @@ static void __init omap2_gp_clockevent_init(void) ...@@ -109,6 +109,9 @@ static void __init omap2_gp_clockevent_init(void)
#endif #endif
tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gptimer)); tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gptimer));
pr_info("OMAP clockevent source: GPTIMER%d at %u Hz\n",
CONFIG_OMAP_TICK_GPTIMER, tick_rate);
omap2_gp_timer_irq.dev_id = (void *)gptimer; omap2_gp_timer_irq.dev_id = (void *)gptimer;
setup_irq(omap_dm_timer_get_irq(gptimer), &omap2_gp_timer_irq); setup_irq(omap_dm_timer_get_irq(gptimer), &omap2_gp_timer_irq);
omap_dm_timer_set_int_enable(gptimer, OMAP_TIMER_INT_OVERFLOW); omap_dm_timer_set_int_enable(gptimer, OMAP_TIMER_INT_OVERFLOW);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment