From: Scott Wood Date: Wed, 4 May 2011 16:43:41 -0500 Subject: [U-Boot] [PATCH] powerpc/85xx: Add basic support for P1010RDB In-Reply-To: References: <1304529799-17702-1-git-send-email-poonam.aggrwal@freescale.com> <1304530307.1946.5.camel@haiying-laptop> <6D6BCCB6-0B15-46FA-943C-590EEDD02D7B@kernel.crashing.org> <20110504130247.2a72bb56@schlenkerla.am.freescale.net> Message-ID: <20110504164341.313fc79d@schlenkerla.am.freescale.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, 4 May 2011 14:15:58 -0500 Andy Fleming wrote: > >> >> + > >> >> +#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. I think it used to special-case such empty-body loops, but apparently not anymore. I did some test-compiles and such constructs are optimized away. -Scott