linux/arch/arm
Mark A. Greer 3abd5acfff davinci: Add compare register support to timer code
The Timer64p timer has 8 compare registers that can
be used to generate interrupts when the timer value
matches the compare reg's value.  They do not disturb
the timer itself.  This can be useful when there is
only one timer available for both clock events and
clocksource.

When enabled, the clocksource remains a continuous
32-bit counter but the clock event will no longer
support periodic interrupts.  Instead only oneshot
timers will be supported and implemented by setting
the compare register to the current timer value plus
the period that the clock event subsystem is requesting.

Compare registers support is enabled automatically
when the following conditions are met:
1) The same timer is being used for clock events
   and clocksource.
2) The timer is the bottom half (32 bits) of the
   64-bit timer (hardware limitation).
3) The the compare register offset and irq are
   not zero.

Since the timer is always running, there is a hardware
race in timer32_config() between reading the current
timer value, and adding the period to the current
timer value and writing the compare register.
Testing on a da830 evm board with the timer clocked
at 24 MHz and the processor clocked at 300 MHz,
showed the number of counter ticks to do this ranged
from 20-53 (~1-2.2 usecs) but usually around 41 ticks.
This includes some artifacts from collecting the
information.  So, the minimum period should be
at least 5 usecs to be safe.

There is also an non-critical lower limit that
the period should be since there is no point in
setting an event that is much shorter than the
time it takes to set the event, and get & handle
the timer interrupt for that event.  There can
also be all sorts of delays from activities
occuring elsewhere in the system (including
hardware activitis like cache & TLB management).
These are virtually impossible to quantify so a
minimum period of 50 usecs was chosen.  That will
certianly be enough to avoid the actual hardware
race but hopefully not large enough to cause
unreasonably course-grained timers.

Signed-off-by: Mark A. Greer <mgreer@mvista.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
2009-05-28 15:17:48 -07:00
..
boot arm: allow usage of string functions in linux/string.h 2009-03-31 13:05:36 +10:30
common [ARM] smp: fix cpumask usage in ARM SMP code 2009-05-17 16:22:46 +01:00
configs davinci: update davinci_all_defconfig for dm355, dm6467 2009-05-26 07:18:15 -07:00
include/asm [ARM] smp: fix cpumask usage in ARM SMP code 2009-05-17 16:22:46 +01:00
kernel [ARM] smp: fix cpumask usage in ARM SMP code 2009-05-17 16:22:46 +01:00
lib
mach-aaec2000 [ARM] pass reboot command line to arch_reset() 2009-03-19 16:20:24 +00:00
mach-at91 clocksource: pass clocksource to read() callback 2009-04-21 13:41:47 -07:00
mach-clps711x [ARM] pass reboot command line to arch_reset() 2009-03-19 16:20:24 +00:00
mach-davinci davinci: Add compare register support to timer code 2009-05-28 15:17:48 -07:00
mach-ebsa110 [ARM] pass reboot command line to arch_reset() 2009-03-19 16:20:24 +00:00
mach-ep93xx [ARM] 5509/1: ep93xx: clkdev enable UARTS 2009-05-16 19:55:56 +01:00
mach-footbridge [ARM] pass reboot command line to arch_reset() 2009-03-19 16:20:24 +00:00
mach-gemini [ARM] arch_reset() now takes a second parameter 2009-03-30 10:40:12 +01:00
mach-h720x [ARM] pass reboot command line to arch_reset() 2009-03-19 16:20:24 +00:00
mach-imx Merge master.kernel.org:/home/rmk/linux-2.6-arm 2009-04-24 08:36:41 -07:00
mach-integrator [ARM] 5517/1: integrator: don't put clock lookups in __initdata 2009-05-18 17:43:16 +01:00
mach-iop13xx dma-mapping: replace all DMA_64BIT_MASK macro with DMA_BIT_MASK(64) 2009-04-07 08:31:10 -07:00
mach-iop32x [ARM] pass reboot command line to arch_reset() 2009-03-19 16:20:24 +00:00
mach-iop33x [ARM] pass reboot command line to arch_reset() 2009-03-19 16:20:24 +00:00
mach-ixp4xx Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2009-05-10 10:46:45 -07:00
mach-ixp23xx [ARM] pass reboot command line to arch_reset() 2009-03-19 16:20:24 +00:00
mach-ixp2000 [ARM] pass reboot command line to arch_reset() 2009-03-19 16:20:24 +00:00
mach-kirkwood [ARM] 5460/1: Orion: reduce namespace pollution 2009-04-23 23:25:41 +01:00
mach-ks8695 Merge branch 'highmem' into devel 2009-03-24 22:47:45 +00:00
mach-l7200 [ARM] mach-l7200: fix spelling of SYS_CLOCK_OFF 2009-05-18 11:25:08 +01:00
mach-lh7a40x [ARM] pass reboot command line to arch_reset() 2009-03-19 16:20:24 +00:00
mach-loki [ARM] 5460/1: Orion: reduce namespace pollution 2009-04-23 23:25:41 +01:00
mach-mmp [ARM] arch_reset() now takes a second parameter 2009-03-30 10:40:12 +01:00
mach-msm clocksource: pass clocksource to read() callback 2009-04-21 13:41:47 -07:00
mach-mv78xx0 [ARM] 5460/1: Orion: reduce namespace pollution 2009-04-23 23:25:41 +01:00
mach-mx1 MX1ADS: remove I2C ifdefs 2009-04-16 12:57:15 +02:00
mach-mx2 imx21: activate i2c 2009-04-16 12:57:13 +02:00
mach-mx3 mx31ads: Mark as having full regulatoion constraints with 1133-EV1 board 2009-04-16 13:03:56 +02:00
mach-netx clocksource: pass clocksource to read() callback 2009-04-21 13:41:47 -07:00
mach-ns9xxx clocksource: pass clocksource to read() callback 2009-04-21 13:41:47 -07:00
mach-omap1 Merge branch 'omap-clock-fixes' into omap-fixes 2009-04-24 09:56:16 -07:00
mach-omap2 ARM: OMAP2/3: Change omapfb to use clkdev for dispc and rfbi, v2 2009-05-16 08:28:17 -07:00
mach-orion5x [ARM] 5460/1: Orion: reduce namespace pollution 2009-04-23 23:25:41 +01:00
mach-pnx4008 [ARM] pass reboot command line to arch_reset() 2009-03-19 16:20:24 +00:00
mach-pxa [ARM] 5513/1: Eurotech VIPER SBC: fix compilation error 2009-05-16 19:55:56 +01:00
mach-realview [ARM] realview: fix broadcast tick support 2009-05-17 17:11:35 +01:00
mach-rpc [ARM] pass reboot command line to arch_reset() 2009-03-19 16:20:24 +00:00
mach-s3c24a0/include/mach [ARM] S3C: Make IRQ_EINT sleep control common 2009-03-08 12:35:36 +00:00
mach-s3c2400
mach-s3c2410 [ARM] S3C2410: mach-bast.c registering i2c data too early 2009-05-15 15:13:25 +01:00
mach-s3c2412 [ARM] S3C2412: Add missing cache flush in suspend code 2009-05-01 12:28:16 +01:00
mach-s3c2440 [ARM] Osiris: Fix double initialisation in machine block 2009-04-17 12:42:24 +01:00
mach-s3c2442
mach-s3c2443 S3C24XX: Move and update IIS headers 2009-03-05 12:00:59 +00:00
mach-s3c6400 [ARM] S3C64XX: Add S3C64XX_PA_IIS{0,1} to <mach/map.h> 2009-05-01 12:28:16 +01:00
mach-s3c6410 [ARM] SMDK6410: Request GPIOs for LCD power control 2009-04-15 14:46:03 +01:00
mach-sa1100 [ARM] lart: fix build error 2009-04-26 13:56:01 +01:00
mach-shark [ARM] pass reboot command line to arch_reset() 2009-03-19 16:20:24 +00:00
mach-versatile [ARM] 5518/1: versatile: don't put clock lookups in __initdata 2009-05-18 17:43:06 +01:00
mach-w90x900 [ARM] pass reboot command line to arch_reset() 2009-03-19 16:20:24 +00:00
mm Merge master.kernel.org:/home/rmk/linux-2.6-arm 2009-05-02 16:40:20 -07:00
nwfpe [ARM] nwfpe: fix 'floatx80_is_nan' sparse warning 2009-05-15 12:49:14 +01:00
oprofile Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm 2009-03-28 14:03:14 -07:00
plat-iop dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32) 2009-04-07 08:31:11 -07:00
plat-mxc mx27ads: move PBC mapping out of vmalloc space 2009-05-05 09:37:08 +02:00
plat-omap ARM: OMAP3: Fix number of GPIO lines for 34xx 2009-05-16 08:28:16 -07:00
plat-orion Merge master.kernel.org:/home/rmk/linux-2.6-arm 2009-04-24 08:36:41 -07:00
plat-pxa [ARM] pxa: fix issue of muxed GPIO irq_chip functions touching non-muxed GPIOs 2009-04-27 11:45:16 +08:00
plat-s3c [ARM] S3C: Do not set clk->owner field if unset 2009-05-15 15:21:57 +01:00
plat-s3c24xx [ARM] S3C24XX: Fix unused code warning in arch/arm/plat-s3c24xx/dma.c 2009-05-15 15:13:24 +01:00
plat-s3c64xx [ARM] S3C64XX: fix GPIO debug 2009-05-15 15:13:18 +01:00
tools [ARM] update mach-types 2009-03-23 16:12:37 -04:00
vfp [ARM] 5440/1: Fix VFP state corruption due to preemption during VFP exceptions 2009-04-01 22:17:50 +01:00
Kconfig [ARM] Double check memmap is actually valid with a memmap has unexpected holes V2 2009-05-18 11:22:24 +01:00
Kconfig-nommu
Kconfig.debug [ARM] 5412/1: XSCALE: add ice dcc support 2009-02-27 20:57:46 +00:00
Makefile Merge branch 'for-rmk' of git://gitorious.org/linux-gemini/mainline into devel 2009-03-26 23:10:11 +00:00