[U-Boot] [RFC][PATCH 16/21] [sc520] Allow boards to override udelay

Graeme Russ graeme.russ at gmail.com
Thu Mar 25 12:22:58 CET 2010


If the board has a high precision mico-second timer, it maked sense to use
it instead of the on-chip one
---
 cpu/i386/sc520/sc520_timer.c |    4 ++++
 include/asm-i386/ic/sc520.h  |    1 +
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/cpu/i386/sc520/sc520_timer.c b/cpu/i386/sc520/sc520_timer.c
index eca48e0..d5617e9 100644
--- a/cpu/i386/sc520/sc520_timer.c
+++ b/cpu/i386/sc520/sc520_timer.c
@@ -69,7 +69,11 @@ int timer_init(void)
 	return 0;
 }
 
+/* Allow boards to override udelay implementation */
 void __udelay(unsigned long usec)
+	__attribute__((weak, alias("sc520_udelay")));
+
+void sc520_udelay(unsigned long usec)
 {
 	int m = 0;
 	long u;
diff --git a/include/asm-i386/ic/sc520.h b/include/asm-i386/ic/sc520.h
index 57c9904..20384a4 100644
--- a/include/asm-i386/ic/sc520.h
+++ b/include/asm-i386/ic/sc520.h
@@ -28,6 +28,7 @@
 
 void init_sc520(void);
 unsigned long init_sc520_dram(void);
+void sc520_udelay(unsigned long usec);
 
 /* Memory mapped configuration registers */
 typedef struct sc520_mmcr {
-- 
1.7.0.2.182.ge007



More information about the U-Boot mailing list