Skip to contentSkip to conversation

Adds ndelay() common function (like udelay)

PATCH New eran liberty 2 participants 3 messages Jun 21, 2007 – Jun 22, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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();

#1 lore raw

PATCH 1/1 Adds ndelay() common function (like udelay)

Quoted 2 lines · In message <[email protected]> you…
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

Signature · 4 lines
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 at denx.de
"Deliver yesterday, code today, think tomorrow."
#2 lore raw

PATCH 1/1 Adds ndelay() common function (like udelay)

Quoted 6 lines · Wolfgang Denk
Quoted 2 lines · In message <[email protected]> you…
Signed-off-by Eran Liberty

Again, your patch description is not sufficient.

I have nothing much to say about it.

Quoted 2 lines

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

Quoted 2 lines

Finally, if you add it, you will have to add it for all architectures.

agreed.

Quoted 11 lines

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 at denx.de "Deliver yesterday, code today, think tomorrow."