[U-Boot-Users] Booting from NAND Flash Problems

Frank frannk_m1 at yahoo.com
Thu May 18 06:28:35 CEST 2006

--- Daniel Laird <danieljlaird at hotmail.com> wrote:

> I am working on a  board that has a mips processor and only
> Nand Flash.
> This creates a problem as u-boot cannot be run directly from
> Nand Flash as
> only the first 16K of Nand flash can be read by a processor
> without a Nand
> Flash Driver.
> This means that a small program has to run first.  This small
> program is <
> 16K in size and copies U-Boot from Nand Flash into RAM and
> then executes it.
> In theory this should work fine.
> bootprom loads micro bootloader.
> bootloader loads u-boot
> u-boot starts and relocates itself 
> u-boot starts running.
> However i am having loads of issues with running u-boot with
> cache enabled. 
> If cache is enabled then the Nand Driver (I am using the
> latest Linux MTD
> based driver)
> has problems as it uses a DMA copy to copy to the Nand Flash.
> If I implement cache flushing I break u-boot.
> This is because it starts to flush the cache when reading the
> environment
> that is located in Nand Flash the problem is that the
> relocation seems to
> have not completed so the stack that is in Cache locked
> addresses goes wrong
> (PCI fails to work).
> If I try to run u-boot uncached I fail as well.
> I was wondering if anyone has any hints or tips on how u-boot
> is used in a
> system with only Nand Flash and a Mips processor.
> I have seen other posts suggesting mips processors should run
> uncached but
> this is obviously slower.
> Has the case been consider where relocation is not necessary
> i.e a small
> program just loads the executable to a location and runs it. 
> I know
> relocation can save memory but in my system it means extra
> copying and
> currently extra headaches!!
> Hope some people can help
> cheers
> dan

I had a similar problem with the AMD AU1500 SOC (mips32 core).
The relocation was copying the code to ram but the instructions
were being cached in data cache since it was just a data copy
(although the data was really instructions). 
I solved the problem by invaildating the instruction cache after
the copy but before jumping to the relocated code. This fixed my
Don't know if this your problem, but it might give you a clue...

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the U-Boot mailing list