[U-Boot] [PATCH 2/8] u8500: Add utimer support

Lee Jones lee.jones at linaro.org
Tue Nov 20 15:33:48 CET 2012


Provide support for microsecond level timer support.

Signed-off-by: Lee Jones <lee.jones at linaro.org>
---
 arch/arm/cpu/armv7/u8500/timer.c |    5 +++++
 include/common.h                 |    1 +
 2 files changed, 6 insertions(+)

diff --git a/arch/arm/cpu/armv7/u8500/timer.c b/arch/arm/cpu/armv7/u8500/timer.c
index 40326d8..d9a6a2d 100644
--- a/arch/arm/cpu/armv7/u8500/timer.c
+++ b/arch/arm/cpu/armv7/u8500/timer.c
@@ -129,6 +129,11 @@ ulong get_timer(ulong base)
 	return get_timer_masked() - base;
 }
 
+u64 get_timer_us(void)
+{
+	return COUNT_TO_USEC(READ_TIMER());
+}
+
 /*
  * Emulation of Power architecture long long timebase.
  *
diff --git a/include/common.h b/include/common.h
index 5e3c5ee..5d24add 100644
--- a/include/common.h
+++ b/include/common.h
@@ -690,6 +690,7 @@ void	irq_install_handler(int, interrupt_handler_t *, void *);
 void	irq_free_handler   (int);
 void	reset_timer	   (void);
 ulong	get_timer	   (ulong base);
+ulong	get_timer_us       (void);
 void	enable_interrupts  (void);
 int	disable_interrupts (void);
 
-- 
1.7.9.5



More information about the U-Boot mailing list