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

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.

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@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.

Dear Peter Pan,
please don't top-post / full quote. And make sure never to post HTML again!
In message 48abf2c20911292253q4850af1dy1767fdd9e3456533@mail.gmail.com you wrote:
--0016368319a25758030479911a75 Content-Type: text/plain; charset=ISO-8859-1
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?
This phrase does not make any sense to me. "The stack" is something that is organized internally by the compiler, and if the compiler supports "long long", then it does so everywhere, including on the stack.
You claim "I'm using U-Boot-2009-08", but I understand that your port is still out of tree, and nobody but you has access to it. As it appears to be working fine for everyone else, I suspect that the problems are in your own board code / initialization / configuration.
Best regards,
Wolfgang Denk
participants (2)
-
Peter Pan
-
Wolfgang Denk