linux/arch/arm/plat-omap
Vaibhav Hiremath 1fe97c8f6a ARM: OMAP: Make OMAP clocksource source selection using kernel param
Current OMAP code supports couple of clocksource options based
on compilation flag (CONFIG_OMAP_32K_TIMER). The 32KHz sync-timer
and a gptimer which can run on 32KHz or system clock (e.g 38.4 MHz).
So there can be 3 options -

1. 32KHz sync-timer
2. Sys_clock based (e.g 13/19.2/26/38.4 MHz) gptimer
3. 32KHz based gptimer.

The optional gptimer based clocksource was added so that it can
give the high precision than sync-timer, so expected usage was 2
and not 3.
Unfortunately option 2, clocksource doesn't meet the requirement of
free-running clock as per clocksource need. It stops in low power states
when sys_clock is cut. That makes gptimer based clocksource option
useless for OMAP2/3/4 devices with sys_clock as a clock input.
So, in order to use option 2, deeper idle state MUST be disabled.

Option 3 will still work but it is no better than 32K sync-timer
based clocksource.

We must support both sync timer and gptimer based clocksource as
some OMAP based derivative SoCs like AM33XX does not have the
sync timer.

Considering above, make sync-timer and gptimer clocksource runtime
selectable so that both OMAP and AMXXXX continue to use the same code.

And, in order to precisely configure/setup sched_clock for given
clocksource, decision has to be made early enough in boot sequence.

So, the solution is,

Use standard kernel parameter ("clocksource=") to override
default 32k_sync-timer, in addition to this, we also use hwmod database
lookup mechanism, through which at run-time we can identify availability
of 32k-sync timer on the device, else fall back to gptimer.

Also, moved low-level SoC specific init code to respective files,
(mach-omap1/timer32k.c and mach-omap2/timer.c)

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Kevin Hilman <khilman@ti.com>
Tested-by: Kevin Hilman <khilman@ti.com>
Cc: Benoit Cousson <b-cousson@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Tarun Kanti DebBarma <tarun.kanti@ti.com>
Cc: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-05-09 10:07:05 -07:00
..
include/plat ARM: OMAP: Make OMAP clocksource source selection using kernel param 2012-05-09 10:07:05 -07:00
clock.c ARM: OMAP: clock: cleanup CPUfreq leftovers, fix build errors 2012-04-14 17:49:07 -07:00
common.c Merge commit 'v3.3-rc6' 2012-03-06 13:20:31 +02:00
counter_32k.c ARM: OMAP: Make OMAP clocksource source selection using kernel param 2012-05-09 10:07:05 -07:00
debug-devices.c ARM: gpio: convert includes of mach/gpio.h and asm/gpio.h to linux/gpio.h 2011-08-08 14:27:41 +01:00
debug-leds.c Disintegrate asm/system.h for ARM 2012-03-28 18:30:01 +01:00
devices.c ARM: Add arm_memblock_steal() to allocate memory away from the kernel 2012-01-13 15:02:35 +00:00
dma.c Disintegrate and delete asm/system.h 2012-03-28 15:58:21 -07:00
dmtimer.c ARM: global cleanups 2012-03-27 16:03:32 -07:00
fb.c ARM: OMAP2+: Fix compile error when FB_OMAP2 is not set 2012-03-09 09:53:21 +02:00
i2c.c ARM: OMAP: I2C: Fix omap_register_i2c_bus() return value on success 2011-11-04 17:41:07 -07:00
Kconfig ARM: fix __io macro for PCMCIA 2012-04-05 11:29:55 -07:00
mailbox.c ARM: OMAP: mailbox: trivial whitespace fix 2012-03-05 16:11:03 -08:00
Makefile OMAP: mcbsp: Move core driver under sound/soc/omap 2012-03-12 13:34:19 +00:00
mux.c Disintegrate asm/system.h for ARM 2012-03-28 18:30:01 +01:00
ocpi.c [ARM] Convert asm/io.h to linux/io.h 2008-09-06 12:10:45 +01:00
omap_device.c ARM: device tree work 2012-03-27 16:47:35 -07:00
omap-pm-noop.c ARM: OMAP: omap_device: remove omap_device_parent 2012-03-05 15:38:02 -08:00
sram.c ARM: global cleanups 2012-03-27 16:03:32 -07:00
sram.h OMAP: plat-omap: Fix static function warnings 2010-10-08 10:12:38 -07:00
usb.c ARM: OMAP: Remove plat/io.h by splitting it into mach/io.h and mach/hardware.h 2012-02-24 10:34:35 -08:00