public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Wegner <wolfgang@leila.ping.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] environment in NAND
Date: Wed, 7 Sep 2011 09:02:32 +0200	[thread overview]
Message-ID: <20110907070232.GG21272@leila.ping.de> (raw)
In-Reply-To: <CAACX+R1_Q5Bg-8sXcxj61FSKv60p2uSRjCAx0hc5fq_dNJJusQ@mail.gmail.com>

Hi Arno,

On Wed, Sep 07, 2011 at 08:20:22AM +0200, Arno Steffen wrote:
> Hi Marek and Wolfgang, Thanks for your answers.
> I kept already one sector space for bad blocks, so 1st environment is
> at c.0000, 2nd at 10.0000. Blocksize is 2.0000 (so 1 block left).
> Maybe I have to announce uboot, that there is one block more
> available. But how, in wich defininition? I can declare size (which is
> just 8k) and blocksize (128k), but not block number ?!?
> I found that this below more or less relates to environment: Maybe I
> miss something here? Some look redundant to me. I adopted this from
> another board included in uboot, just changed size,location and
> redundancy.
> 
> #define CONFIG_ENV_SIZE			(8 << 10)	/* 8 KiB */
> #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + (128 << 10))
> #define CONFIG_SYS_GBL_DATA_SIZE	128	/* bytes reserved for */
> 
> #define SMNAND_ENV_OFFSET		0x0C0000 /* environment starts here */
> 
> #define CONFIG_SYS_ENV_SECT_SIZE	boot_flash_sec
> #define CONFIG_ENV_OFFSET		boot_flash_off
> #define CONFIG_ENV_ADDR			boot_flash_env_addr
> 
> #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
> #define CONFIG_ENV_OFFSET_REDUND	0x100000
> #define CONFIG_ENV_SIZE_REDUND		(CONFIG_ENV_SIZE)

this is my adapted openrd configuration:
#define CONFIG_ENV_IS_IN_NAND           1
#define CONFIG_ENV_SECT_SIZE            0x20000 /* 128K */

#define CONFIG_ENV_SIZE                 0x20000 /* 128k */
#define CONFIG_ENV_ADDR                 0x60000
#define CONFIG_ENV_OFFSET               0x60000 /* env starts here */
#define CONFIG_ENV_RANGE                (6 * CONFIG_ENV_SIZE)
#define CONFIG_ENV_OFFSET_REDUND        (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE)

It is too long ago I made this modification, so I am not sure (but of
course hope so) that CONFIG_ENV_SIZE_REDUND does not have to be
explicitly specified.

Concerning your hint about making CONFIG_ENV_SIZE smaller: there
is a comment in the original openrd_base.h config file
/*
 * max 4k env size is enough, but in case of nand
 * it has to be rounded to sector size
 */
and I simply adhered to it. It is not clear to me if this is really
a requirement or just made for convenience (having overview over the
flash usage layout).

Up to now, I did not have any problems with this setup on something
like 100+ boards.

Best regards,
Wolfgang

  reply	other threads:[~2011-09-07  7:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-06 14:16 [U-Boot] environment in NAND Arno Steffen
2011-09-06 14:22 ` Wolfgang Wegner
2011-09-06 14:23 ` Marek Vasut
2011-09-07  6:20   ` Arno Steffen
2011-09-07  7:02     ` Wolfgang Wegner [this message]
2011-09-07  9:34       ` Arno Steffen
2011-09-07  9:35         ` Wolfgang Wegner
2011-09-07 10:20           ` Arno Steffen
2011-09-07 11:07             ` Wolfgang Wegner
2011-09-15 22:34         ` Scott Wood

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=20110907070232.GG21272@leila.ping.de \
    --to=wolfgang@leila.ping.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox