Hello,
Sorry if this is wrong forum. I read many posts here while trying to solve my problem, and the board users were helpful and knowledgeable. If I’m in the wrong place, let me know.
I wish to flash the NAND on my Sheeva Plug with uImage linux kernel.
I believe a bad block in the region intended to hold the uImage file file prevents it.
Why do I think this?
-sh-3.2# flash_erase /dev/mtdblock1
Erase Total 1 Units
-sh-3.2# flash_eraseall /dev/mtd1
Erasing 128 Kibyte @ 1e0000 – 93 % complete.
-sh-3.2# nandwrite -p /dev/mtd1 uImage.sheeva.20090319
Image 2106760 bytes, NAND page 2048 bytes, OOB area 2048 bytes, device size 2097152 bytes
Input file does not fit into device: Success
Data was only partially written due to error
The uImage file is provided - I did not create it. The uImage file I’m trying to flash with is not corrupt, because I boot the exact same file via nfs, and it works fine. (Valid assumption?)
If I get really desperate, I might try re-compiling uImage file to make it smaller, but that leads to solving cross compiler issues and I did not want to go down that path right away…
I think I can work around the problem in a couple of ways;
-
I think it possible to redefine “partition size” of uImage area (/dev/mtd1) such that the uImage would fit, even with a bad block. Implications seem to be that the rootfs beginning address (/dev/mtd2) will also need to relocate, to accommodate re-sizing the uImage area (/dev/mtd1). I think it means altering bootargs - the hex addresses of uImage location & size, the hex address of root fs location & size.
-
I think it possible to execute uboot command ‘nand scrub’ and mark bad blocks good, maybe. Implications are more risky here. Block might really be bad, and a corrupt file won’t boot, either. Also, I don’t really know what I’m doing, and I might accidentally erase the uboot code, which is still running fine. If that happens, I’m all done. I’m lacking a JTAG debugger capable of re-flashing uboot code (and lacking knowledge of how to do it comfortably.)
I can try to tell how I got in this state, if that helps.
Any suggestions, guidance, hints, URLs, readme’s, How2s are welcome.
Thanks in advance,
alex
Additional detail below; Sorry if too much.
** MARVELL BOARD: SHEEVA PLUG LE
U-Boot 1.1.4 (Mar 16 2009 - 18:03:32) Marvell version: 3.4.16
U-Boot code: 00600000 → 0067FFF0 BSS: → 006CEE80
Soc: 88F6281 A0 (DDR2)
CPU running @ 1200Mhz L2 running @ 400Mhz
SysClock = 400Mhz , TClock = 200Mhz
DRAM CAS Latency = 5 tRP = 5 tRAS = 18 tRCD=6
DRAM CS[0] base 0x00000000 size 256MB
DRAM CS[1] base 0x10000000 size 256MB
DRAM Total size 512MB 16bit width
Flash: 0 kB
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done
NAND:512 MB
CPU : Marvell Feroceon (Rev 1)
{ here are some details about Linux version - from nfs booted kernel image }
Marvell>> boot
Using egiga0 device
TFTP from server 192.168.1.103; our IP address is 192.168.1.105
Filename ‘uImage.sheeva.20090319’.
Load address: 0x200000
Loading: T ######################…#deleted#…
done
Bytes transferred = 2106760 (202588 hex)
Booting image at 00200000 …
Image Name: Linux-2.6.22.18
Created: 2009-03-19 9:18:16 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2106696 Bytes = 2 MB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum … OK
OK
Starting kernel …
Uncompressing Linux…
Linux version 2.6.22.18 (dhaval@devbox) (gcc version 4.2.1) #1 Thu Mar 19 14:46:22 IST 2009
CPU: ARM926EJ-S [56251311] revision 1 (ARMv5TE), cr=00053177
Machine: Feroceon-KW
Using UBoot passing parameters structure
{ lots more kernel boot msgs available, not really applicable to my problem.
I can supply any or all of it upon request. }
{ this is env from the uboot, set up to boot NFS. It works. }
Marvell>> printenv
baudrate=115200
loads_echo=0
netmask=255.255.255.0
CASset=min
MALLOC_len=1
ethprime=egiga0
bootargs_end=:::DB88FXX81:eth0:none
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end)
(more but word-wrapped off terminal)
ethaddr=00:50:43:fd:1d:23
ethmtu=1500
mvPhoneConfig=mv_phone_config=dev0:fxs,dev1:fxs
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
usb0Mode=host
yuk_ethaddr=00:00:00:EE:51:81
nandEcc=1bit
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
ethact=egiga0
run_diag=no
ipaddr=192.168.1.105
serverip=192.168.1.103
rootpath=/home/sheeva
image_name=uImage.sheeva.20090319
console=console=ttyS0,115200 mtdparts=nand_flash:0x100000@0x00000(u-boot),0x400000@0x100000(uImage),0x1f800000@0x500000(rootfs)rw
bootargs_root=root=/dev/nfs rw
bootargs=console=ttyS0,115200 mtdparts=nand_flash:0x400000@0x100000(uImage)ro,0x1fC00000@0x500000(rootfs)rw root=/dev/mtdblock2
bootcmd=tftpboot 0x200000 $(image_name);setenv bootargs $(console) $(bootargs_root) nfsroot=$(serverip):$(rootpath) ip=$(ipaddr):$(serverip)$(0
(more but word-wrapped. tftpboot works…)
stdin=serial
stdout=serial
stderr=serial
mainlineLinux=no
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
netbsd_en=no
vxworks_en=no
bootdelay=3
disaMvPnp=no
enaAutoRecovery=yes
Environment size: 1432/131068 bytes
Marvell>>
{ here is the bootargs & bootcmd I use that fails, because uImage incomplete. }
setenv bootargs 'console=ttyS0,115200 mtdparts=nand_flash:0x400000@0x100000(uImage)ro,0x1fC00000@0x500000(
rootfs)rw root=/dev/mtdblock2’
setenv bootcmd 'nand read.e 0x800000 0x100000 0x400000; bootm
0x800000’
{ after I boot via nfs and using above nfs bootargs, see what can be seen on flash. }
-sh-3.2# mtd_debug info /dev/mtd1
mtd.type = MTD_NANDFLASH
mtd.flags = MTD_CAP_NANDFLASH
mtd.size = 2097152 (2M)
mtd.erasesize = 131072 (128K)
mtd.writesize = 2048 (2K)
mtd.oobsize = 64
regions = 0
{ here is link to Sheeva Plug docs; How2 flash NAND, Board drawings, initial (shipped) env }