[U-Boot] Having problem Booting linux from nand flash

Peter Pan pppeterpppan at gmail.com
Mon Nov 30 07:53:45 CET 2009


I assumed that the stack does not support "loff_t", so I search for
its definition. In /include/asm-ppc/posix_types.h has a definition
for "__kernel_loff_t" which is type defined to "loff_t" in
/include/linux/types.h. I change this "__kernel)loff_t" from "long long"
to "unsigned long". And the Function gets the same parameters caller gives.

Maybe ppc stack here does not support long long?

2009/11/30 Peter Pan <pppeterpppan at gmail.com>

> Dear Wolfgang Denk:
> I'm using U-Boot-2009-08 now. And I have a problem booting
> my linux image from nand flash. I can boot from my norflash
> using NFS, and mount my Nand flash, nand flash works file with
> fstype yaffs2.
> I run command nboot 800000 0 0 (device 0, offset 0, into memory
> 0x800000), then it prints out my image information and then says
> that it reads failed. The prints are:
> -----------------------------------------------------------------
> Loading from NAND 1GiB 3,3V 8-bit, offset 0x0
>    Image Name:   Linux-2.6.22.sac.rd
>    Image Type:   PowerPC Linux Kernel Image (gzip compressed)
>    Data Size:    1045865 Bytes = 1021.4 kB
>    Load Address: 00000000
>    Entry Point:  00000000
> NAND read from offset ffffffff failed 0
> ** Read error
> -----------------------------------------------------------------
> This seems that all the blocks are bad blocks, so I try "nand bad",
> there are no bad blocks in my nand flash as it says.
>     Then, I look into the source, and find something strange. In
> function "nand_load_image" in /common/cmd_nand.c, I print out the
> parameters of function "nand_load_image" gives "nand_read_skip_bad"
> and function "nand_read_skip_bad" gets, they are different.
> -----------------------------------------------------------------
> nand = 0xfffdab8, offset = 0x0, &cnt = 0xfba1768. addr = 0x800000 in
> nand_load_image.
> nand = 0xfffdab8, offset = 0x0, length = 0x0, buffer = 0xfba1768 in
> nand_read_skip_bad.
> -----------------------------------------------------------------
> This seems the stack is wrong?  I don't know what to do next now.
>


More information about the U-Boot mailing list