linux-mainline/arch/arm/plat-omap/include/plat
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
..
am33xx.h ARM: OMAP: am33xx: Update common OMAP machine specific sources 2011-12-13 10:46:43 -08:00
board-ams-delta.h ASoC: OMAP: ams-delta: drop .set_bias_level callback 2012-03-05 11:25:34 -08:00
board-sx1.h
board-voiceblue.h
board.h OMAP: Remove OMAP_TAG_LCD and OMAP_TAG_FBMEM 2012-02-23 09:39:27 +02:00
clkdev_omap.h ARM: OMAP: clock: convert AM3517/3505 detection/flags to AM35xx 2012-05-07 23:55:11 -06:00
clock.h ARM: OMAP: clock: cleanup CPUfreq leftovers, fix build errors 2012-04-14 17:49:07 -07:00
common.h ARM: OMAP: Make OMAP clocksource source selection using kernel param 2012-05-09 10:07:05 -07:00
cpu.h ARM: SoC specific updates 2012-03-27 16:14:44 -07:00
dma-44xx.h
dma.h
dmtimer.h ARM: OMAP2+: dmtimer: cleanup iclk usage 2012-05-07 23:55:30 -06:00
dsp.h
flash.h
fpga.h
gpio-switch.h
gpio.h Merge branch 'fixes-gpio-to-irq' into fixes 2012-03-29 10:16:04 -07:00
gpmc-smc91x.h
gpmc-smsc911x.h
gpmc.h
hardware.h ARM: create a common IOMEM definition 2012-03-13 21:22:09 -05:00
hdq1w.h ARM: OMAP2+: HDQ1W: add custom reset function 2012-05-08 17:25:36 -06:00
i2c.h
iommu2.h
iommu.h iommu/omap: eliminate the public omap_find_iommu_device() method 2011-12-05 15:47:39 +02:00
iopgtable.h
iovmm.h iommu/omap: eliminate the public omap_find_iommu_device() method 2011-12-05 15:47:39 +02:00
irda.h
irqs-44xx.h
irqs.h ARM: OMAP: irqs: Fix NR_IRQS value to handle PRCM interrupts 2012-02-28 15:49:54 -08:00
keypad.h ARM: OMAP2+: Limit omap_read/write usage to legacy USB drivers 2012-02-24 10:34:36 -08:00
l3_2xxx.h
l3_3xxx.h
l4_2xxx.h
l4_3xxx.h
lcd_mipid.h
led.h
mailbox.h
mcbsp.h ARM/ASoC: OMAP McBSP: Move remainig defines from arch to ASoC header 2012-03-12 13:34:23 +00:00
mcspi.h ARM: OMAP: McSPI: Remove unused flag from struct omap2_mcspi_device_config 2012-02-24 10:33:58 -08:00
menelaus.h
mmc.h ARM: OMAP2420: hwmod data: Add MMC hwmod data for 2420 2012-05-08 17:23:33 -06:00
multi.h
mux.h
nand.h
omap4-keypad.h Input: omap4-keypad - move platform_data to <linux/platform_data> 2012-03-16 22:49:46 -07:00
omap7xx.h
omap16xx.h
omap24xx.h
omap34xx.h ARM: OMAP: am33xx: Update common OMAP machine specific sources 2011-12-13 10:46:43 -08:00
omap44xx.h ARM: OMAP4: PM: Add SAR RAM support 2011-12-08 11:28:59 -08:00
omap730.h
omap850.h
omap1510.h
omap_device.h ARM: OMAP: omap_device: remove omap_device_parent 2012-03-05 15:38:02 -08:00
omap_hwmod.h ARM: OMAP4: hwmod data: add some interconnect-related IP blocks 2012-04-19 13:33:54 -06:00
omap-pm.h ARM: OMAP: change get_context_loss_count ret value to int 2011-11-04 17:41:07 -07:00
omap-secure.h ARM: OMAP4: Move the barrier memboclk_steal() as part of reserve callback 2012-02-14 11:42:42 -08:00
omap-serial.h ARM: OMAP2+: UART: Remove omap_uart_can_sleep and add pm_qos 2011-12-14 16:05:26 -08:00
onenand.h
param.h
prcm.h
remoteproc.h remoteproc/omap: add a remoteproc driver for OMAP4 2012-02-08 22:53:47 +02:00
sdrc.h ARM: OMAP: Remove remaining includes for mach/io.h 2012-03-06 21:34:38 -06:00
serial.h ARM: OMAP2+: remove some orphan function declarations. 2012-02-21 11:13:11 -08:00
sram.h ARM: OMAP: sram: Add am33xx SRAM support (minimal) 2012-03-05 16:11:01 -08:00
tc.h 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
ti81xx.h ARM: OMAP: TI81XX: Prepare for addition of TI814X support 2011-12-13 10:46:44 -08:00
timex.h
uncompress.h ARM: OMAP: add minimal support for Nokia RM-696 2012-03-05 11:08:37 -08:00
usb.h ARM: create a common IOMEM definition 2012-03-13 21:22:09 -05:00
voltage.h
vram.h OMAPDSS: Remove video SRAM support 2012-02-23 09:38:26 +02:00
vrfb.h