linux/arch
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
..
alpha alpha: unbreak percpu again 2009-05-12 14:11:35 -07:00
arm davinci: Add compare register support to timer code 2009-05-28 15:17:48 -07:00
avr32 avr32: drop unused CLEAN_FILES 2009-05-01 10:54:00 +02:00
blackfin clocksource: pass clocksource to read() callback 2009-04-21 13:41:47 -07:00
cris CRISv32: Fix typo compile error in ARTPEC-3 gpio driver. 2009-04-28 19:08:10 +02:00
frv FRV: Use __INIT macro instead of .text.init. 2009-04-27 19:46:30 -07:00
h8300 Get rid of final remnants of include/asm-$(ARCH) 2009-04-17 09:59:27 -07:00
ia64 [IA64] xen_domu_defconfig: fix build issues/warnings 2009-05-05 11:43:13 -07:00
m32r m32r: use __stringify() macro in assembler.h 2009-05-02 22:38:21 +09:00
m68k m68k: arch/m68k/kernel/sun3-head.S needs <linux/init.h> 2009-04-28 16:07:18 -07:00
m68knommu Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu 2009-04-24 08:45:53 -07:00
microblaze microblaze: Fix kind-of-intr checking against number of interrupts 2009-05-18 14:47:42 +02:00
mips MIPS: IP32: Remove unnecessary if not even harmful volatile keywords. 2009-05-22 13:52:06 +01:00
mn10300 mn10300: convert to use __HEAD and HEAD_TEXT macros. 2009-04-26 09:20:38 -07:00
parisc Merge git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6 2009-04-03 09:52:04 -07:00
powerpc powerpc/maple: Add a quirk to disable MSI for IPR on Bimini 2009-05-22 16:01:11 +10:00
s390 s390: convert to use __HEAD and HEAD_TEXT macros. 2009-04-26 09:20:39 -07:00
sh sh: ap325 camera without i2c driver fix 2009-05-22 13:19:11 +09:00
sparc sparc: cleanup references to deprecated .text.init* sections. 2009-04-27 19:51:58 -07:00
um uml: kill a kconfig warning 2009-04-21 13:41:50 -07:00
x86 Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-05-18 09:17:37 -07:00
xtensa xtensa: Fix linker script to include .literal sections 2009-05-11 23:40:33 -07:00
.gitignore
Kconfig mutex: have non-spinning mutexes on s390 by default 2009-04-09 19:28:24 +02:00