diff options
author | Mikael Pettersson <mikpe@it.uu.se> | 2009-10-29 14:46:54 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2009-10-29 14:46:54 -0400 |
commit | 469d30448dad13600cdd246024f9db8e80614c45 (patch) | |
tree | a610e9dd4b40dd540376eba7aaaed2538298f828 /arch/arm/include | |
parent | a91549a8f27e63e0e537fe1c20d4845581de894f (diff) |
iop: clockevent support
This updates the IOP platform to expose the interrupting
timer 0 as a clockevent object. The timer interrupt handler
is changed to call the clockevent ->event_handler() instead
of timer_tick(), and ->set_next_event() and ->set_mode()
operations are added to allow the mode of the timer to be
updated (required for ONESHOT/NOHZ mode).
Timer 0 must now be properly initialised, which requires
a new write_tcr0() function from the mach-specific code.
The mode of timer 0 must be read at the start of ->set_mode(),
which requires a new read_tmr0() function from the mach-
specific code.
Initial setup of timer 0 is also rewritten to be more robust.
Tested on n2100, compile-tested for all plat-iop machines.
Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'arch/arm/include')
-rw-r--r-- | arch/arm/include/asm/hardware/iop3xx.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/include/asm/hardware/iop3xx.h b/arch/arm/include/asm/hardware/iop3xx.h index 643b7b95b25b..34601b952045 100644 --- a/arch/arm/include/asm/hardware/iop3xx.h +++ b/arch/arm/include/asm/hardware/iop3xx.h | |||
@@ -236,6 +236,13 @@ void iop_init_cp6_handler(void); | |||
236 | void iop_init_time(unsigned long tickrate); | 236 | void iop_init_time(unsigned long tickrate); |
237 | unsigned long iop_gettimeoffset(void); | 237 | unsigned long iop_gettimeoffset(void); |
238 | 238 | ||
239 | static inline u32 read_tmr0(void) | ||
240 | { | ||
241 | u32 val; | ||
242 | asm volatile("mrc p6, 0, %0, c0, c1, 0" : "=r" (val)); | ||
243 | return val; | ||
244 | } | ||
245 | |||
239 | static inline void write_tmr0(u32 val) | 246 | static inline void write_tmr0(u32 val) |
240 | { | 247 | { |
241 | asm volatile("mcr p6, 0, %0, c0, c1, 0" : : "r" (val)); | 248 | asm volatile("mcr p6, 0, %0, c0, c1, 0" : : "r" (val)); |
@@ -253,6 +260,11 @@ static inline u32 read_tcr0(void) | |||
253 | return val; | 260 | return val; |
254 | } | 261 | } |
255 | 262 | ||
263 | static inline void write_tcr0(u32 val) | ||
264 | { | ||
265 | asm volatile("mcr p6, 0, %0, c2, c1, 0" : : "r" (val)); | ||
266 | } | ||
267 | |||
256 | static inline u32 read_tcr1(void) | 268 | static inline u32 read_tcr1(void) |
257 | { | 269 | { |
258 | u32 val; | 270 | u32 val; |