[U-Boot-Users] Problem in writing downloaded image to NAND device
Dharmosoth Seetharam
seetharam_21 at yahoo.com
Tue Nov 27 10:04:41 CET 2007
Hi all,
I have a problem in writing to NAND device.
U-Boot 1.2.0 (Nov 27 2007 - 13:18:12)
Board - atmel
cpu - arm926ejs
fs - cramfs
Os - Linux, ARM based OS
64MB SDRAM and 256 MB NAND device.
What i am trying to achieve is:
To copy the downloaded kernel image and fs image
to NAND device.
What I have done is:
1) Downloaded the kernel image and fs image
using tftp download command at U-Boot.
*) tftp 0x22200000 kernel.img
## Checking Image at 22200000 ...
Image Name: Linux 2.6.22
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1872572 Bytes = 1.8 MB
Load Address: 20008000
Entry Point: 20008000
Verifying Checksum ... OK
U-Boot>
kernel image is downloaded to SDRAM.
Now want to write this kernel image to NAND device.
U-Boot> nand device
Device 0: NAND 256MiB 3,3V 8-bit
U-Boot> nand write 0x22200000 0x0 0x200000
NAND write: device 0 offset 0x0, size 0x200000
2097152 bytes written: OK
U-Boot> nboot 0x22200000 0
Loading from NAND 256MiB 3,3V 8-bit, offset 0x0
Magic Number : 0x0 , required : 0x27051956
Image Name:
Image Type: Invalid CPU Invalid OS Invalid Image
(uncompressed)
Data Size: 0 Bytes = 0 kB
Load Address: 00000000
Entry Point: 00000000
U-Boot>
I have looked @ the code for NAND write
nand_write() --> nand_write_ecc() -->
nand_write_page() --> nand_write_buf() --> writeb()
in nand_write_buf() :
for (i=0; i<len; i++) {
writeb(buf[i], this->IO_ADDR_W);
<< writeb is defined as
(*(volatile unsigned char *)(a) = (v)) >>
As per the above for loop every character (ie.
buf[i])
going to written @ the address this->IO_ADDR_W (??).
But, What we need is, start address and len to
write into the NAND device.
Can you please look at this and help me in this
regard.
My main goal here is to write to NAND device.
I wrote my own function to write to NAND device, but
somehow they are getting modified once the command
finishes the execution.
I have testes all these values in the memory using
md command.
<< md memory-addess >>
Please suggest me if i am doing wrong !!
Thanks,
Seetharam
Bollywood, fun, friendship, sports and more. You name it, we have it on http://in.promos.yahoo.com/groups
More information about the U-Boot
mailing list