User error with fw_printenv - I hope

Mike Frysinger vapier.adi at gmail.com
Tue Apr 3 22:16:00 EDT 2012


On Tue, Apr 3, 2012 at 19:09, Bishop, Mark
<Mark.Bishop at cooperindustries.com> wrote:
> ioctl(3, MEMGETINFO or MFB_SET_CHROMA_KEY, {type=MTD_NANDFLASH, flags=MTD_WRITEABLE, size=0x80000, erasesize=0x20000, writesize=0x800, oobsize=0x40, padding=0xffffffff}) = 0
> ioctl(3, MEMGETBADBLOCK, [393216])      = 1
> ioctl(3, MEMGETBADBLOCK, [524288])      = -1 EINVAL (Invalid argument)
> write(2, "Cannot read bad block mark", 26Cannot read bad block mark) = 26

thanks, this shows the issue.  looks like a bug in u-boot's
fw_printenv code.  it first tests block 0x60000 to see if it's bad,
then tries 0x80000.

> root:/> cat /etc/fw_env.config
> /dev/mtd0               0x60000         0x20000         0x20000                 1

your config though says you only have 1 block starting at 0x60000 with
a length of 0x20000.  so there's no reason it should be testing
0x80000 -- after all, you only care about bytes 0x60000 - 0x7ffff.

i guess time to raise the issue on the u-boot mailing list.  i'm
guessing you aren't running the latest mainline code, but in looking
at the git history, there doesn't seem to be many changes recently let
alone relevant ones.  wouldn't hurt to test though and should be easy
to try:
$ make env HOSTCC=bfin-uclinux-gcc
-mike



More information about the linux-mtd mailing list