[U-Boot] [PATCH] powerpc/85xx: Add basic support for P1010RDB
Andy Fleming
afleming at gmail.com
Wed May 4 21:15:58 CEST 2011
>> >> +
>> >> +#define udelay(x) {int i, j; for (i = 0; i < x; i++) for (j = 0; j < 10000; j++); }
>> > There were many comments on this udelay before, we should not use this
>> > define, but use the udelay() which u-boot provides.
>> >
>>
>> Is there a udelay that is defined for the nand_spl build? The problem is doing proper time based delay in nand_spl would require a lot more code.
>
> This loop is similar to what nand_spl/nand_boot.c is using. It's ugly, but
> the goal here is small code rather than cleanliness. Is the timebase
> running at this point? How much code is required to get the timebase
> frequency?
Is it possible to compromise and not call it udelay? udelay(x) is
supposed to delay for x microseconds, but clearly this delays for
x*10000 iterations through a loop. Also, are we sure that such a macro
works at all? It looks like the sort of thing compilers optimize away
all the time.
Andy
More information about the U-Boot
mailing list