* [U-Boot-Users] Excluding Env Variable section from the u-boot.bin
@ 2006-01-12 11:27 Albert David
2006-01-12 14:41 ` Wolfgang Denk
0 siblings, 1 reply; 9+ messages in thread
From: Albert David @ 2006-01-12 11:27 UTC (permalink / raw)
To: u-boot
Dears,
For my ppc405EP based custom board I would like to make few changes to
the u-boot memory map, so that every time I update the u-boot,
environment variables in the flash remain untouched.
Flash Memory used:S29GL128M(spansion 16MB Flash with 128 uniform
sectors of 128KB each)
Current mapping
U-Boot Start Flash Address 0xFFF60000 - 2 sectors
U-Bot Env Variable Start Addr 0xFFFA000 - 1 sector
U-Bot Env Variable(Redundant)Start Addr 0xFFFC000 - 1 sector
U-Boot End sector - 1 sector
Size of the binary output of u-boot(u-boot.bin) after build is
128kb*5sectors=648Kbytes.
Current settings in the source tree:
U-boot-1.1.4/include/configs/my_board.h
#define CFG_FLASH_BASE 0xFFF60000
#define CFG_MONITOR_BASE CFG_FLASH_BASE
#define CFG_MONITOR_LEN (640 * 1024)
#define CFG_ENV_IS_IN_FLASH 1
#define CFG_ENV_ADDR 0xFFFA0000
#define CFG_ENV_SECT_SIZE 0x20000
#define CFG_ENV_ADDR_REDUND 0xFFFC0000
#define CFG_ENV_SIZE_REDUND 0x20000
U-boot-1.1.4/my_board/config.mk
TEXT_BASE = 0xFFF60000
U-boot-1.1.4/my_board/u-boot.lds
ppcenv_assert = ASSERT(. < 0xFFFA0000, ".bss section too big,
overlaps .ppcenv section. Please update your confguration:
CFG_MONITOR_BASE, CFG_MONITOR_LEN and TEXT_BASE may need to be
modified.");
. = 0xFFFA0000;
.ppcenv :
{
common/environment.o(.ppcenv);
}
Required mapping:
U-Bot Env Variable Start Addr 0xFFF8000 - 1 sector
U-Bot Env Variable(Redundant)Start Addr 0xFFFA000 - 1 sector
U-Boot Start Flash Address 0xFFFC0000 - 2 sectors
Required Size of the binary output of u-boot(u-boot.bin) after build
is 128kb*2sectors=256Kbytes.
I have already tried to modify the above specified files to:
U-boot-1.1.4/include/configs/my_board.h
#define CFG_FLASH_BASE 0xFFFC0000
#define CFG_MONITOR_BASE CFG_FLASH_BASE
#define CFG_MONITOR_LEN (256 * 1024)
#define CFG_ENV_IS_IN_FLASH 1
#define CFG_ENV_ADDR 0xFFF80000
#define CFG_ENV_SECT_SIZE 0x20000
#define CFG_ENV_ADDR_REDUND 0xFFFA0000
#define CFG_ENV_SIZE_REDUND 0x20000
U-boot-1.1.4/my_board/config.mk
TEXT_BASE = 0xFFFC0000
U-boot-1.1.4/my_board/u-boot.lds
ppcenv_assert = ASSERT(. < 0xFFF80000, ".bss section too big,
overlaps .ppcenv section. Please update your confguration:
CFG_MONITOR_BASE, CFG_MONITOR_LEN and TEXT_BASE may need to be
modified.");
. = 0xFFF80000;
.ppcenv :
{
common/environment.o(.ppcenv);
}
But after doing "make all" I get the message
ppc_4xx-ld:.bss section too big, overlaps .ppcenv section. Please
update your confguration: CFG_MONITOR_BASE, CFG_MONITOR_LEN and
TEXT_BASE may need to be modified.
In a simple term, I wanted to build my u-boot by excluding environment
variable section of the memory..
Can any one help me?
Where am I going wrong??
Is there any other modification needs to be done other than the above
specified changes?
Thanks in advance for your support,
With best regards,
Albert.
^ permalink raw reply [flat|nested] 9+ messages in thread* [U-Boot-Users] Excluding Env Variable section from the u-boot.bin
2006-01-12 11:27 [U-Boot-Users] Excluding Env Variable section from the u-boot.bin Albert David
@ 2006-01-12 14:41 ` Wolfgang Denk
2006-01-13 4:29 ` Albert David
0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Denk @ 2006-01-12 14:41 UTC (permalink / raw)
To: u-boot
In message <61124de70601120327o12f9294die4bda6bbfdb464ac@mail.gmail.com> you wrote:
>
> For my ppc405EP based custom board I would like to make few changes to
> the u-boot memory map, so that every time I update the u-boot,
> environment variables in the flash remain untouched.
...
> U-boot-1.1.4/my_board/u-boot.lds
> ppcenv_assert = ASSERT(. < 0xFFF80000, ".bss section too big,
> overlaps .ppcenv section. Please update your confguration:
> CFG_MONITOR_BASE, CFG_MONITOR_LEN and TEXT_BASE may need to be
> modified.");
Now isn't this a very precise error message? Which other hints do you need?
> Where am I going wrong??
Your whole approach seems overkill to me. Why don;t you simply
include a "saveenv" command in your update script? As long as the
environment is not shifted (which seems unlikelyin your case) no
other changes are needed.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"There is no statute of limitations on stupidity."
- Randomly produced by a computer program called Markov3.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot-Users] Excluding Env Variable section from the u-boot.bin
2006-01-12 14:41 ` Wolfgang Denk
@ 2006-01-13 4:29 ` Albert David
2006-01-13 7:51 ` Tore Martin Hagen
2006-01-13 10:10 ` Wolfgang Denk
0 siblings, 2 replies; 9+ messages in thread
From: Albert David @ 2006-01-13 4:29 UTC (permalink / raw)
To: u-boot
> Your whole approach seems overkill to me. Why don;t you simply
> include a "saveenv" command in your update script? As long as the
> environment is not shifted (which seems unlikelyin your case) no
> other changes are needed.
oh! i didnt know this! it's an easy way to retain env variables :)
btw,
when i update my u-boot in the field (for some unavoidable reason),
the update_uboot script erases all the u-boot flash sectors and over
writes the new u-boot.bin - what if somethings goes wrong with the
communication or power while copying u-boot.bin to flash?? i may loose
important settings of my product in the field! u-boot.bin can always
be updated using the BDI tool! But i cannot recover the environment
variables.
i can make my update_uboot script in such a way that, before erasing
the u-boot sectors, it will copy the env section to some free flash
sector(as a backup) , update the u-boot.bin and then call 'saveenv'. i
hope this is the better way to protect my environment variables.
please let me know if someone has better idea than this.
Best regards,
Albert.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot-Users] Excluding Env Variable section from the u-boot.bin
2006-01-13 4:29 ` Albert David
@ 2006-01-13 7:51 ` Tore Martin Hagen
2006-01-13 10:10 ` Wolfgang Denk
1 sibling, 0 replies; 9+ messages in thread
From: Tore Martin Hagen @ 2006-01-13 7:51 UTC (permalink / raw)
To: u-boot
Albert David wrote:
>
>when i update my u-boot in the field (for some unavoidable reason),
>the update_uboot script erases all the u-boot flash sectors and over
>writes the new u-boot.bin -
>
Hi, I think you should change your update_uboot script so that it only
erases the sector with the bin. Are you updating u-boot from u-boot or
from Linux (or some other OS)?
>what if somethings goes wrong with the
>communication or power while copying u-boot.bin to flash?? i may loose
>important settings of my product in the field! u-boot.bin can always
>be updated using the BDI tool! But i cannot recover the environment
>variables.
>
>
In this case you would need to read the environment variables first and
keep them backed up during the u-boot update.
/Tore Martin Hagen
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot-Users] Excluding Env Variable section from the u-boot.bin
2006-01-13 4:29 ` Albert David
2006-01-13 7:51 ` Tore Martin Hagen
@ 2006-01-13 10:10 ` Wolfgang Denk
1 sibling, 0 replies; 9+ messages in thread
From: Wolfgang Denk @ 2006-01-13 10:10 UTC (permalink / raw)
To: u-boot
In message <61124de70601122029v6f84d9fbya8a6c22a9f59afa8@mail.gmail.com> you wrote:
>
> when i update my u-boot in the field (for some unavoidable reason),
> the update_uboot script erases all the u-boot flash sectors and over
> writes the new u-boot.bin - what if somethings goes wrong with the
> communication or power while copying u-boot.bin to flash?? i may loose
You shoudl always download theimage to ram *before* you start erasing
the flash, thus communication failures are not a problem.
If you have a power fail you are lost.
> important settings of my product in the field! u-boot.bin can always
> be updated using the BDI tool! But i cannot recover the environment
> variables.
You can make it more reliable for normal operation by using redundant
environment setors.
> i can make my update_uboot script in such a way that, before erasing
> the u-boot sectors, it will copy the env section to some free flash
> sector(as a backup) , update the u-boot.bin and then call 'saveenv'. i
> hope this is the better way to protect my environment variables.
Yes, you can additionally create a bacup copy for cases where you had
a power failure, but it is not as trivial as you (1) need to know
exactly where your environment is located (ok, not so difficult) and
(2) in case of redundand sectors you will have to test which one is
the active and which one the obsoleted sector.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
[Braddock:] Mr. Churchill, you are drunk.
[Churchill:] And you madam, are ugly. But I shall be sober tomorrow.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot-Users] Excluding Env Variable section from the u-boot.bin
@ 2006-01-12 12:56 Nuno João (Ext_NBS)
2006-01-12 14:43 ` Wolfgang Denk
0 siblings, 1 reply; 9+ messages in thread
From: Nuno João (Ext_NBS) @ 2006-01-12 12:56 UTC (permalink / raw)
To: u-boot
I have a configuration in 2 of "my" boards where the environment
variable's area lays in a different sector from u-boot code,
also so that it is possible to upgrade u-boot while keeping
the environment:
In mpc8xx board I have:
/*
* Environment in flash. It will be on the flash's 3rd 64KB block, fully
* using it. U-boot will use the 1st two 64KB blocks, as specified by
* CFG_MONITOR_LEN above.
*/
#define CFG_ENV_IS_IN_FLASH 1
#define CFG_ENV_OFFSET 0x20000 /* Offset of Environment Sector */
#define CFG_ENV_SIZE 0x10000 /* Total Size of Environment Sector */
In a mpc85xx board I have:
/*
* Environment
*/
#define CFG_ENV_IS_IN_FLASH 1
#define CFG_ENV_SECT_SIZE 0x40000 /* 256K (one sector) for env */
/* env in its own flash sector, right before u-boot */
#define CFG_ENV_SIZE CFG_ENV_SECT_SIZE
#define CFG_ENV_ADDR 0xffe00000
I didn't need to change anything else. There are some preprocessor
macros in the environment code that will handle most of the job.
Cheers
-----Original Message-----
From: u-boot-users-admin@lists.sourceforge.net [mailto:u-boot-users-admin at lists.sourceforge.net] On Behalf Of Albert David
Sent: quinta-feira, 12 de Janeiro de 2006 11:27
To: u-boot-users at lists.sourceforge.net
Subject: [U-Boot-Users] Excluding Env Variable section from the u-boot.bin
Dears,
For my ppc405EP based custom board I would like to make few changes to
the u-boot memory map, so that every time I update the u-boot,
environment variables in the flash remain untouched.
(...)
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot-Users] Excluding Env Variable section from the u-boot.bin
2006-01-12 12:56 Nuno João (Ext_NBS)
@ 2006-01-12 14:43 ` Wolfgang Denk
0 siblings, 0 replies; 9+ messages in thread
From: Wolfgang Denk @ 2006-01-12 14:43 UTC (permalink / raw)
To: u-boot
In message <0248B0F35AF7B8418CA72E88AC00BF1F5BB51B@lisi053a.siemens.pt> you wrote:
>
> I have a configuration in 2 of "my" boards where the environment
> variable's area lays in a different sector from u-boot code,
> also so that it is possible to upgrade u-boot while keeping
> the environment:
It is *always* possible to update the U-Boot image and keep the old
environment settings. Typically all you need for embedded environment
is a simple "saveenv" command.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Nail here --X-- for new monitor.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot-Users] Excluding Env Variable section from the u-boot.bin
@ 2006-01-12 14:52 Nuno João (Ext_NBS)
2006-01-12 15:36 ` Wolfgang Denk
0 siblings, 1 reply; 9+ messages in thread
From: Nuno João (Ext_NBS) @ 2006-01-12 14:52 UTC (permalink / raw)
To: u-boot
As far as I understood / remember, you can have the
environment and part of u-boot's code sharing the same
sector, which makes it at least more difficult to upgrade
the code using a BDI-like tool which usually works on
a full-sector basis.
-----Original Message-----
From: wd@denx.de [mailto:wd at denx.de]
Sent: quinta-feira, 12 de Janeiro de 2006 14:44
To: Nuno Jo?o (Ext_NBS)
Cc: u-boot-users at lists.sourceforge.net; Albert David
Subject: Re: [U-Boot-Users] Excluding Env Variable section from the u-boot.bin
(...)
It is *always* possible to update the U-Boot image and keep the old
environment settings. Typically all you need for embedded environment
is a simple "saveenv" command.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot-Users] Excluding Env Variable section from the u-boot.bin
2006-01-12 14:52 Nuno João (Ext_NBS)
@ 2006-01-12 15:36 ` Wolfgang Denk
0 siblings, 0 replies; 9+ messages in thread
From: Wolfgang Denk @ 2006-01-12 15:36 UTC (permalink / raw)
To: u-boot
In message <0248B0F35AF7B8418CA72E88AC00BF1F5BB51E@lisi053a.siemens.pt> you wrote:
>
> As far as I understood / remember, you can have the
> environment and part of u-boot's code sharing the same
Yes.
> sector, which makes it at least more difficult to upgrade
> the code using a BDI-like tool which usually works on
> a full-sector basis.
If you use a BDI, you need a 3 command sequence: dump, erase, prog.
This is not exactly difficult. And if you have U-Boot running you
just can use "saveenv". This is trivial.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I have a theory that it's impossible to prove anything, but I can't
prove it.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2006-01-13 10:10 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-12 11:27 [U-Boot-Users] Excluding Env Variable section from the u-boot.bin Albert David
2006-01-12 14:41 ` Wolfgang Denk
2006-01-13 4:29 ` Albert David
2006-01-13 7:51 ` Tore Martin Hagen
2006-01-13 10:10 ` Wolfgang Denk
-- strict thread matches above, loose matches on Subject: below --
2006-01-12 12:56 Nuno João (Ext_NBS)
2006-01-12 14:43 ` Wolfgang Denk
2006-01-12 14:52 Nuno João (Ext_NBS)
2006-01-12 15:36 ` Wolfgang Denk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox