[U-Boot-Users] [PATCH] Adds ndelay() common function (like udelay)

Signed-off-by: Eran Liberty
diff -x .svn -Nuar u-boot.git-5ffa76a032279bc6d3230b703eda32d13305ba13/include/common.h u-boot.exsw6000/include/common.h --- u-boot.git-5ffa76a032279bc6d3230b703eda32d13305ba13/include/common.h 2007-06-18 22:38:46.000000000 +0300 +++ u-boot.exsw6000/include/common.h 2007-06-20 19:04:44.000000000 +0300 @@ -559,6 +559,7 @@
/* lib_$(ARCH)/time.c */ void udelay (unsigned long); +void ndelay (unsigned long); ulong usec2ticks (unsigned long usec); ulong ticks2usec (unsigned long ticks); int init_timebase (void); diff -x .svn -Nuar u-boot.git-5ffa76a032279bc6d3230b703eda32d13305ba13/include/exports.h u-boot.exsw6000/include/exports.h --- u-boot.git-5ffa76a032279bc6d3230b703eda32d13305ba13/include/exports.h 2007-06-18 22:38:46.000000000 +0300 +++ u-boot.exsw6000/include/exports.h 2007-06-20 19:04:44.000000000 +0300 @@ -17,6 +17,7 @@ void *malloc(size_t); void free(void*); void udelay(unsigned long); +void ndelay(unsigned long); unsigned long get_timer(unsigned long); void vprintf(const char *, va_list); void do_reset (void);
diff -x .svn -Nuar u-boot.git-5ffa76a032279bc6d3230b703eda32d13305ba13/lib_ppc/time.c u-boot.exsw6000/lib_ppc/time.c --- u-boot.git-5ffa76a032279bc6d3230b703eda32d13305ba13/lib_ppc/time.c 2007-06-18 22:38:46.000000000 +0300 +++ u-boot.exsw6000/lib_ppc/time.c 2007-06-20 19:04:39.000000000 +0300 @@ -60,6 +60,15 @@
/* ------------------------------------------------------------------------- */
+void ndelay(unsigned long nsec) +{ + ulong ticks = usec2ticks(1)*nsec/1000 +1; + + wait_ticks (ticks); +} + +/* ------------------------------------------------------------------------- */ + unsigned long ticks2usec(unsigned long ticks) { ulong tbclk = get_tbclk();

In message ffc2b1d40706202327j608326f7mca0a7faaf71e3110@mail.gmail.com you wrote:
Signed-off-by: Eran Liberty
Again, your patch description is not sufficient.
Also, nobody uses this function, so why add it?
Finally, if you add it, you will have to add it for all architectures.
Best regards,
Wolfgang Denk

On 6/22/07, Wolfgang Denk wd@denx.de wrote:
In message ffc2b1d40706202327j608326f7mca0a7faaf71e3110@mail.gmail.com you wrote:
Signed-off-by: Eran Liberty
Again, your patch description is not sufficient.
I have nothing much to say about it.
Also, nobody uses this function, so why add it?
I think I am using it in the stratix.c file which is part of the stratix patch.. but I Will recheck
Finally, if you add it, you will have to add it for all architectures.
agreed.
Best regards,
Wolfgang Denk
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de "Deliver yesterday, code today, think tomorrow."
participants (2)
-
eran liberty
-
Wolfgang Denk