[U-Boot] mtdparts not agreeing wiht fw_printenv

Wolfgang Denk wd at denx.de
Thu Mar 7 07:52:57 CET 2013


Dear John Stile,

In message <1362532855.20183.135.camel at genx> you wrote:
> I am quite confused about partitions in my NAND flash.
> 
> Linux can mount my rootfs, so partitions make sense to the kernel, but
> from the shell fw_printenv can't read the uboot environment, not matter
> what I use in /etc/fw_env.config.

That means that all settings were incorrect.

> dev:    size   erasesize  name
> mtd0: 00020000 00020000 "bootstrap1"
> mtd1: 00040000 00020000 "uboot1"
> mtd2: 001a0000 00020000 "env1"
^^^^^^ mtd2
> mtd3: 00200000 00020000 "linux1"
> mtd4: 07c00000 00020000 "rootfs1"
> mtd5: 00020000 00020000 "bootstrap2"
> mtd6: 00040000 00020000 "uboot2"
> mtd7: 001a0000 00020000 "env2"
^^^^^^ mtd7
> mtd8: 00200000 00020000 "linux2"
> mtd9: 07c00000 00020000 "rootfs2"
> mtd10: 00004200 00000420 "bootstrap3"
> mtd11: 00004200 00000420 "env3"
^^^^^^ mtd11
> mtd12: 00039c00 00000420 "uboot3"
> mtd13: 00252000 00000420 "linux3"
> mtd14: 005ac000 00000420 "rootfs3"
> 
What's that? This makes no sense to me - either you have a single copy
of the environment, or two (in case of redudant env).  Three copies is
not a supported configuration.

> I purposefully created more /dev/mtd devices than mtdparts would
> require, in order to find which partitions actually contain the uboot
> env.

mtdparts does not "require" anything.  You configure your systems as
needed, and then set mtdparts to match that setting.  SO the setting
comes first (starting in your head or - probably better - on a sheet
of paper), and then you set mtdparts as needed.

> /dev/mtd4 and /dev/mtd5 create binary equivalent dumps of env1
> /dev/mtd14 and /dev/mtd15 create binary equivalent dumps of env2.

The names and use of your partitions is in serious mismatch.  Fix this
first!

> /etc/fw_env.config does not like either of those, saying the crc does
> not checkout.
> 
> /etc/fw_env.config:
> /dev/mtd2              0x0          0x20000          0x20000
> /dev/mtd2              0x20000      0x20000          0x20000

Well, if you find the environment in /dev/mtd4 and /dev/mtd5, then you
should use these in the fw_env.config

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Making files is easy under  the  UNIX  operating  system.  Therefore,
users  tend  to  create  numerous  files  using large amounts of file
space. It has been said that the only standard thing about  all  UNIX
systems  is  the  message-of-the-day  telling users to clean up their
files.                             - System V.2 administrator's guide


More information about the U-Boot mailing list