On May 4, 2011, at 1:02 PM, Scott Wood wrote: > On Wed, 4 May 2011 12:34:20 -0500 > Kumar Gala <ga...@kernel.crashing.org> wrote: > >> >> On May 4, 2011, at 12:31 PM, Haiying Wang wrote: >> >>> On Wed, 2011-05-04 at 22:53 +0530, Poonam Aggrwal wrote: >>>> +sinclude $(obj).depend >>>> + >>>> +######################################################################### >>>> diff --git a/nand_spl/board/freescale/p1010rdb/nand_boot.c >>>> b/nand_spl/board/freescale/p1010rdb/nand_boot.c >>>> new file mode 100644 >>>> index 0000000..f0de279 >>>> --- /dev/null >>>> +++ b/nand_spl/board/freescale/p1010rdb/nand_boot.c >>>> @@ -0,0 +1,119 @@ >>>> +/* >>>> + * Copyright 2011 Freescale Semiconductor, Inc. >>>> + * >>>> + * This program is free software; you can redistribute it and/or >>>> + * modify it under the terms of the GNU General Public License as >>>> + * published by the Free Software Foundation; either version 2 of >>>> + * the License, or (at your option) any later version. >>>> + * >>>> + * This program is distributed in the hope that it will be useful, >>>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of >>>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >>>> + * >>>> + * GNU General Public License for more details. >>>> + * >>>> + * You should have received a copy of the GNU General Public License >>>> + * along with this program; if not, write to the Free Software >>>> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, >>>> + * MA 02111-1307 USA >>>> + * >>>> + */ >>>> +#include <common.h> >>>> +#include <mpc85xx.h> >>>> +#include <asm/io.h> >>>> +#include <ns16550.h> >>>> +#include <nand.h> >>>> +#include <asm/mmu.h> >>>> +#include <asm/immap_85xx.h> >>>> +#include <asm/fsl_ddr_sdram.h> >>>> +#include <asm/fsl_law.h> >>>> + >>>> +#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?
TB isn't running so you have to turn it on in the SoC (so a few CCSRBAR read/writes), than you have to calculate freq on some boards its a #define constant, on other its calculated reading I2C which would add a bunch of code for accessing I2C. I'm pretty sure we aren't going to be able to do that in 4k. - k _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot