public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] Dynamic location of the environment sector
@ 2006-06-14 11:55 Angelos Manousarides
  2006-06-14 14:31 ` Wolfgang Denk
  0 siblings, 1 reply; 14+ messages in thread
From: Angelos Manousarides @ 2006-06-14 11:55 UTC (permalink / raw)
  To: u-boot

I have a board that comes in three flash confirurations:
- 32MB
- 64MB
- 128MB

The cfi code can safely detect the flash sizes, banks and widths at boot 
time. I have however the problem that the flash chips are "top" type and 
the small sectors are at the end of the address space. So I want to make 
the last sector (a small sector) to contain the environment. The last 
sector though is in a different address (and has a different size) 
depending on the flash configuration.

Currently the defines for the environment expect raw numerical values. 
Is there an infrastructure somewhere to define the flash size at 
runtime? I tried to print the flash sizes in the board specific codes, 
for instance:

extern flash_info_t flash_info[];

printf("flash 0 : %d %x\n", flash_info[0].size, 
flash_info[0].start[flash_info[0].sector_count-1]);
...

prints:

Flash: 64 MB
In:    serial
Out:   serial
Err:   serial
flash 0 : 67108864 3ff0000

(the second number is the address of the last sector)

And all sizes are detected correctly. I want to use these values to 
calculate the location of the environment dynamically at runtime. This 
way I can have a single u-boot image for all flash configurations!

--
Angelos Manousaridis

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2006-06-27  9:20 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-14 11:55 [U-Boot-Users] Dynamic location of the environment sector Angelos Manousarides
2006-06-14 14:31 ` Wolfgang Denk
2006-06-21 10:48   ` Angelos Manousarides
2006-06-21 14:11     ` Wolfgang Denk
2006-06-21 17:16       ` Angelos Manousarides
2006-06-21 17:21         ` Angelos Manousarides
2006-06-21 20:47           ` Wolfgang Denk
2006-06-21 20:46         ` Wolfgang Denk
2006-06-22 10:21           ` Angelos Manousarides
2006-06-22 10:44             ` Wolfgang Denk
2006-06-22 11:02               ` Angelos Manousarides
2006-06-26 14:57                 ` Angelos Manousarides
2006-06-26 21:10                   ` Wolfgang Denk
2006-06-27  9:20                     ` Angelos Manousarides

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox