Welcome! Log In Create A New Profile

Advanced

u-boot printenv and fw_printenv

Posted by moishap 
moishap
u-boot printenv and fw_printenv
September 10, 2011 08:42PM
I'm sure I'm lacking some basic knowledge, but in any case, could someone explain why u-boot command printenv and Rescue v2 fw_printenv are showing different data ?.

Marvell>> ver

U-Boot 2010.09 (Feb 16 2011 - 18:42:02)
UBIT v0.6 by Jeff Doozan and Peter Carmichael


Linux rescue 2.6.32.18-dockstar #1 Thu Feb 17 03:09:57 EST 2011 armv5tel GNU/Linux
rescue:~# cat /etc/fw_env.config
# MTD device name Device offset Env. size Flash sector size Number of sectors
/dev/mtd0 0xc0000 0x20000 0x20000

Just one example:
Marvell>> printenv mtdparts
printenv mtdparts
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(pogoplug),-(root)

rescue:~# fw_printenv | grep ^mtdparts=
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)

TIA !
Re: u-boot printenv and fw_printenv
September 11, 2011 09:25AM
You can have multiple Uboot environments at different locations in the nand. The linux rescue console is looking at 0xc0000 (based off /etc/fw_env.config). The original pogo environment is at 0xa0000 (at least on the dockstar it is.) The Marvell>> prompt may be referencing another location?
moishap
Re: u-boot printenv and fw_printenv
September 11, 2011 11:34PM
Thanks.
Following posts and install guides by Jeff, I blindly assumed that Jeff's UBIT uboot_uptodate and install_uboot_mtd0.sh do the same thing

I guess I missed the these parts:

UBIT:
Writing latest goflexnet firmware to /dev/mtd0
.............
Performing Flash Erase of length 131072 at offset 0x60000 done


and then u-boot:

Marvell>> saveenv
saveenv
Saving Environment to NAND...
Erasing Nand...
Erasing at
0x60000 -- 100% complete.
Writing to Nand... done


But install_uboot_mtd0.sh (which installed the fw_printenv)

$FLASH_ERASE /dev/mtd0 0xc0000 1
$NANDWRITE -s 786432 /dev/mtd0 "$UBOOT_ENV"


And also in /etc/fw_env.config :
# Configuration file for fw_(printenv/saveenv) utility.
# Up to two entries are valid, in this case the redundant
# environment sector is assumed present.


Interesting. I guess I'll have to look at uboot-tools if the redundant sector can be looked at by uboot if the first appears corrupted ...

Regards
Re: u-boot printenv and fw_printenv
September 12, 2011 12:14PM
I think you need to change /etc/fw_env.config to point to offset 0x60000 as that's where UBIT installed UBoot is saving its environment. (Everything else remains the same.) The other environment location isn't going to do you any good. It's not a backup. It's just where the non-UBIT UBoot saves it's environment. (And I wonder what it may have over written?)
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: