All of lore.kernel.org
 help / color / mirror / Atom feed
From: Detlev Zundel <dzu@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] Question about fw_printenv settings
Date: Wed, 10 Mar 2010 11:22:31 +0100	[thread overview]
Message-ID: <m2pr3cfpco.fsf@ohwell.denx.de> (raw)
In-Reply-To: <67a3f13e1003092150o19ed0f64y3c200378c73b55bf@mail.gmail.com> (Joe Culler's message of "Wed, 10 Mar 2010 13:50:46 +0800")

Hi Joe,

> Hi,
>
> I have problems with fw_env.config in NOR flash.
> Would anyone please help me solve it? Thanks.
>
> In my board config:
>
> ifdef CONFIG_NAND
> #define CFG_NO_FLASH
> #define CONFIG_ENV_IS_IN_NAND           1
> #define CONFIG_ENV_OFFSET               0x400000         /* add for 2008.10 */
> #define CONFIG_ENV_OFFSET_REDUND        0x404000
> #define CONFIG_ENV_SIZE                 0x4000
> #else
> #define CONFIG_ENV_IS_IN_FLASH          1
> #define CONFIG_ENV_ADDR                 (CFG_FLASH_BASE + 0x000c0000)
> #define PHYS_FLASH_SIZE                 0x1000000        /* 16 MB */
> #define CONFIG_ENV_SIZE                 0x20000
> #define CONFIG_ENV_SECT_SIZE            0x20000
> #define CONFIG_ENV_ADDR_REDUND          (CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE)
> #endif

Maybe you want to reconsider these settings after fixing your current
problem.  The idea that we have an CONFIG_ENV_SIZE additionally to
CONFIG_ENV_SECT_SIZE is so that we can define an environment _smaller_
than a whole sector.  This speeds up U-Boot when calculating the CRC
over the environment.  With your settings, U-Boot will need to read the
whole 128k for this calculation.

> # cat /proc/mtd
> dev:    size   erasesize  name
> mtd0: 00dc0000 00020000 "Linux"
> mtd1: 00100000 00020000 "User"
> mtd2: 00100000 00020000 "Boot"

Are you sure these partitions are correct?  The sizes add to 15.75 MiB
whereas above a comment says 16 MiB nor flash.  Also the header above
says that the first environment is at the FLASH_BASE + 768k and the
second at FLASH_BASE + 896k.  If the partitions here are all on nor in
linear order, the environments would be somewhere in mtd0...

> My fw_env.config setting:
> /dev/mtd2              0x400000        0x20000         0x20000

How did you arrive at these settings?  The second column is the offset
into the mtd device.  So you put 4 MiB there although mtd2 is only 1
MiB.

> but it doesn't work :(
> #fw_printenv
> Read error on /dev/mtd2: Success

      parent reply	other threads:[~2010-03-10 10:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-10  5:50 [U-Boot] Question about fw_printenv settings Joe Culler
2010-03-10  6:30 ` Wolfgang Denk
2010-03-10  8:53   ` Joe Culler
2010-03-10  9:59     ` Wolfgang Denk
2010-03-10 10:22 ` Detlev Zundel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2pr3cfpco.fsf@ohwell.denx.de \
    --to=dzu@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.