[Resolved] uboot install on E02 fails

This forum is for Marvell Kirkwood devices such as the GoFlex Home/Net, PogoPlug v1/v2, SheevaPlug, and ZyXEL devices.

[Resolved] uboot install on E02 fails

Postby nwestfal » Thu Sep 04, 2014 12:31 am


RESOLVED - see post here.


Hi,

I'm pretty new to ArchLinux ARM. I successfully installed it on a pogoplug mobile, but now I'm trying to install on an E02 and running into a problem when the uboot install tries to erase the environment at mt0 block 0xc0000.

I'm using the instructions here:

http://archlinuxarm.org/platforms/armv5 ... 2-pinkgray

Mine is not pink, it is black, but says E02 on the bottom of the device.

$this->bbcode_second_pass_code('', '
-bash-3.2# uname -a
Linux Pogoplug 2.6.22.18 #81 Tue Oct 19 16:05:00 PDT 2010 armv5tejl unknown
')

$this->bbcode_second_pass_code('', '
-bash-3.2# ./pogo_e02.sh

Downloading flash utilities..
blparam [OK]
flash_erase [OK]
fw_printenv [OK]
nanddump [OK]
nandwrite [OK]

Downloading U-Boot and environment..
uboot-pogo_e02.kwb [OK]
uboot-pogo_e02.env [OK]

Installing..
saving MAC address [00:25:31:04:86:2C]
erasing U-Boot NAND [OK]
erasing environment
MTD Erase failure: Input/output error
')

I'm afraid to reboot, since it looks like it successfully erased the existing U-Boot, but failed at the point of erasing the environment, and the script has not yet flashed the new U-Boot.

This is what I get if I try to run the command from the script that fails:

$this->bbcode_second_pass_code('', '
-bash-3.2# /tmp/flash_erase /dev/mtd0 0xc0000 1
Erase Total 1 Units
Performing Flash Erase of length 131072 at offset 0xc0000
MTD Erase failure: Input/output error
-bash-3.2#
')

Please help!
Last edited by nwestfal on Fri Sep 12, 2014 4:01 pm, edited 1 time in total.
-Neal
nwestfal
 
Posts: 30
Joined: Wed Sep 03, 2014 11:24 pm

Re: uboot install on E02 fails

Postby moonman » Thu Sep 04, 2014 1:01 am

Don't reboot! Is there anything in dmesg?
At least try to flash the uboot as in case of power failure you will at least be able to use serial console .As it stands now you have no bootloader on your device and it does not support kwboot over serial. The only way to recover (without u-boot) from that would be to jtag which is a little more difficult so flash it while you can.
$this->bbcode_second_pass_code('', '/tmp/nandwrite /dev/mtd0 uboot-pogo_e02.kwb')

You likely have a bad block where the uboot environment is supposed to go. Wait until somebody else chimes in.
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Re: uboot install on E02 fails

Postby nwestfal » Thu Sep 04, 2014 1:25 am

Flashing uboot is successful at least:

$this->bbcode_second_pass_code('', '
-bash-3.2# /tmp/nandwrite /dev/mtd0 uboot-pogo_e02.kwb
Writing data to block 0 at offset 0x0
Writing data to block 1 at offset 0x20000
Writing data to block 2 at offset 0x40000
Writing data to block 3 at offset 0x60000
')

Here is relevant bits of dmesg:

$this->bbcode_second_pass_code('', '
[ 677.650000] nand_erase: attempt to erase a bad block at page 0x00000180
[ 980.390000] nand_erase: attempt to erase a bad block at page 0x00000180
[ 1381.280000] nand_erase: attempt to erase a bad block at page 0x00000180
[ 1497.780000] nand_erase: attempt to erase a bad block at page 0x00000180
[ 2064.000000] nand_erase: attempt to erase a bad block at page 0x00000180
[ 2871.650000] nand_erase: attempt to erase a bad block at page 0x00000180
[ 4308.740000] nand_erase: attempt to erase a bad block at page 0x00000180
[ 5046.600000] nand_erase: attempt to erase a bad block at page 0x00000180
[ 5246.630000] nand_erase: attempt to erase a bad block at page 0x00000180
')

I'm somewhat ignorant of the way this stuff works, but is it possible to relocate the environment to a different location beyond the bad block?
-Neal
nwestfal
 
Posts: 30
Joined: Wed Sep 03, 2014 11:24 pm

Re: uboot install on E02 fails

Postby nwestfal » Thu Sep 04, 2014 1:44 am

Just for kicks, I tried to write the environment:

$this->bbcode_second_pass_code('', '
-bash-3.2# /tmp/nandwrite -s 0xc0000 /dev/mtd0 uboot-pogo_e02.env
Writing data to block 6 at offset 0xc0000
Bad block at c0000, 1 block(s) from c0000 will be skipped
Writing data to block 7 at offset 0xe0000
pwrite: Input/output error
Erasing failed write from 000e0000-000fffff
Data was only partially written due to error
: Input/output error
-bash-3.2#
')

But then tried it again, and it seems to skip the bad block and writes it to block 7 at offset 0xe0000:

$this->bbcode_second_pass_code('', '
-bash-3.2#
-bash-3.2#
-bash-3.2# /tmp/nandwrite -s 0xc0000 /dev/mtd0 uboot-pogo_e02.env
Writing data to block 6 at offset 0xc0000
Bad block at c0000, 1 block(s) from c0000 will be skipped
Writing data to block 7 at offset 0xe0000
')

I'm guessing it's not usable in this state though.
-Neal
nwestfal
 
Posts: 30
Joined: Wed Sep 03, 2014 11:24 pm

Re: uboot install on E02 fails

Postby bodhi » Thu Sep 04, 2014 2:29 am

Look in dmesg:

dmesg | grep -i bad

I expect the output will show a bad block at 0xc0000.

Update: indeed from the post above it is bad. Anbody has this uboot default env listing? It should be looked at to determine the next recovery step.
bodhi
 
Posts: 225
Joined: Sat Aug 13, 2011 10:06 am

Re: uboot install on E02 fails

Postby moonman » Thu Sep 04, 2014 2:53 am

The default from the arch:
$this->bbcode_second_pass_code('', 'baudrate=115200
bootcmd=usb start; setenv letter 9;for type in usb; do for disk in 0 1 2 3; do if ${type} part ${disk};then setexpr letter $letter + 1;run load;fi;done;done;
bootdelay=3
bootm=echo Booting from ${disk} ...; run setargs; bootm ${loadaddr};
bootz=echo Booting from ${disk} ...; run setargs; bootz ${loadaddr} - ${fdt_addr};
console=ttyS0
fdt_addr=0x800000
fdt_file=/boot/dtbs/kirkwood-pogo_e02.dtb
importbootenv=echo Importing environment (uEnv.txt)...; env import -t $loadaddr $filesize
load=echo Attempting to boot from ${type} ${disk}:1...;if run loadbootenv; then run importbootenv;fi;echo Checking if uenvcmd is set ...;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;echo Running default loadzimage ...;if run loadzimage; then run loadfdt;run bootz;fi;echo Running default loaduimage ...;if run loaduimage; then run bootm;fi;
loadaddr=0x810000
loadbootenv=load ${type} ${disk}:1 ${loadaddr} /boot/uEnv.txt
loadfdt=load ${type} ${disk}:1 ${fdt_addr} ${fdt_file}
loaduimage=load ${type} ${disk}:1 ${loadaddr} ${uimage}
loadzimage=load ${type} ${disk}:1 ${loadaddr} ${zimage}
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:1M(u-boot),-(rootfs)
setargs=setenv bootargs console=${console},${baudrate} ${optargs} root=/dev/sd${letter}1 rw rootwait ${mtdparts}
uimage=/boot/uImage
zimage=/boot/zImage
ethaddr=')
ethaddr copy from the bottom of the box

The old default should've been saved to /etc/fw_env.config
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Re: uboot install on E02 fails

Postby nwestfal » Thu Sep 04, 2014 3:24 am

Yes, bad block at 0x000c0000:

$this->bbcode_second_pass_code('', '
-bash-3.2# dmesg | grep -i bad
[ 1.050000] Scanning device for bad blocks
[ 1.050000] Bad eraseblock 6 at 0x000c0000
[ 677.650000] nand_erase: attempt to erase a bad block at page 0x00000180
[ 980.390000] nand_erase: attempt to erase a bad block at page 0x00000180
[ 1381.280000] nand_erase: attempt to erase a bad block at page 0x00000180
[ 1497.780000] nand_erase: attempt to erase a bad block at page 0x00000180
[ 2064.000000] nand_erase: attempt to erase a bad block at page 0x00000180
[ 2871.650000] nand_erase: attempt to erase a bad block at page 0x00000180
[ 4308.740000] nand_erase: attempt to erase a bad block at page 0x00000180
[ 5046.600000] nand_erase: attempt to erase a bad block at page 0x00000180
[ 5246.630000] nand_erase: attempt to erase a bad block at page 0x00000180
-bash-3.2#
')

No /etc/fw_env.config file:

$this->bbcode_second_pass_code('', '
-bash-3.2# ls -l /etc
drwxr-xr-x 3 root root 0 Jan 1 00:05 Wireless
-rw-r--r-- 1 root root 17 Sep 8 2009 cefs.conf
drwxr-xr-x 2 root root 0 Jan 1 00:00 dropbear
-rw-r--r-- 1 root root 93 Jan 1 00:33 fstab
-rw-r--r-- 1 root root 14 Dec 12 2005 group
drwxr-xr-x 2 root root 0 Jan 1 00:05 init.d
-rw-r--r-- 1 root root 123 Dec 18 2005 inittab
-rw-r--r-- 1 root root 16 Feb 7 2007 ld.so.conf
lrwxrwxrwx 1 root root 12 Nov 4 2009 mtab -> /proc/mounts
-rw-r--r-- 1 root root 26 Jan 1 00:35 nsswitch.conf
-rw-r--r-- 1 root root 32 Jan 1 00:39 passwd
lrwxrwxrwx 1 root root 16 Nov 4 2009 resolv.conf -> /tmp/resolv.conf
-rw-r----- 1 root root 59 Jan 1 00:00 shadow
-rw-r----- 1 root root 59 Nov 3 2009 shadow-
-rw-r--r-- 1 root root 18 Sep 3 2007 shells
-bash-3.2#
')

What next?

thanks
Last edited by nwestfal on Thu Sep 04, 2014 3:13 pm, edited 1 time in total.
-Neal
nwestfal
 
Posts: 30
Joined: Wed Sep 03, 2014 11:24 pm

Re: uboot install on E02 fails

Postby bodhi » Thu Sep 04, 2014 3:40 am

moonman,

Sorry I should have been more precise: Is it the same envs defined in the #define CONFIG_EXTRA_ENV_SETTINGS in the code?

./include/configs/pogo_e02.h
$this->bbcode_second_pass_code('', '
/*
* Default environment variables
*/
#define CONFIG_BOOTCOMMAND \
"<this string defines default boot command>
"
#define CONFIG_EXTRA_ENV_SETTINGS \
"<this string defines all default envs>
"
')

Base on the default envs defined in CONFIG_EXTRA_ENV_SETTINGS, nwestfal can set up the boot drive exactly the way the envs are defined so that it will boot successfully upon power up. This is the one way to recover without JTAG (unless u-boot binary is rebuilt to point to a different envs location from location 0xC0000, that I don't think anybody wants to do). The other way is to reflash orginal u-boot.
bodhi
 
Posts: 225
Joined: Sat Aug 13, 2011 10:06 am

Re: uboot install on E02 fails

Postby nwestfal » Thu Sep 04, 2014 3:56 am

I noticed the script runs /tmp/blparam to get the ethaddr. Not sure if this is helpful or not:

$this->bbcode_second_pass_code('', '
-bash-3.2# /tmp/blparam
baudrate=115200
loads_echo=0
rootpath=/mnt/ARM_FS/
netmask=255.255.0.0
run_diag=yes
console=console=ttyS0,115200
CASset=min
MALLOC_len=1
ethprime=egiga0
bootargs_root=root=/dev/mtdblock2 ro
ethmtu=1500
usb0Mode=host
nandEcc=1bit
ethact=egiga0
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
bootargs=console=ttyS0,115200 root=/dev/mtdblock2 ro
serverip=169.254.254.252
ipaddr=169.254.254.253
ethaddr=xx:xx:xx:xx:xx:xx
cesvcid=HL8GZS9TLGT289GUBXPBH7RTQJ
ceboardver=PPV2
bootcmd=nand read.e 0x800000 0x100000 0x200000; setenv bootargs $(console) $(bootargs_root);bootm 0x800000
')
Last edited by nwestfal on Thu Sep 04, 2014 2:03 pm, edited 1 time in total.
-Neal
nwestfal
 
Posts: 30
Joined: Wed Sep 03, 2014 11:24 pm

Re: uboot install on E02 fails

Postby moonman » Thu Sep 04, 2014 5:23 am

It does seem to have the default config compiled in, however AFAIK nobody tested it. I really can't tell you for sure how it will behave. Another option is to set the config variables by hand with fw_setenv and see if it works. fw_setenv and u-boot might just ignore the bad block. I would still wait until someone more knowledgeable in this respect to reply here or try the irc channel.
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Next

Return to Marvell Kirkwood

Who is online

Users browsing this forum: No registered users and 4 guests