[U-Boot-Users] Running u-boot from Flash itself
hskinnemoen at gmail.com
Tue Nov 14 12:02:25 CET 2006
On 11/13/06, Wolfgang Denk <wd at denx.de> wrote:
> In message <f1ed94ed0611131034l507e63c1j68ef0b4fe57109c7 at mail.gmail.com> you wrote:
> > Is there any other modifications do I need to run from flash? First
> > of all is this possible?
> It is possible, but it makes no sense to me. Remember that with most
> flash chips it is impossible to erase or porogram the flash and read
> normal data from it at the same time. So you would either lose all
> flash programming features (including savceenv etc.), or you would
> have to create flash code that get's relocated to RAM for execution -
> it's much easier to relocate everything.
Actually, the avr32/atstk1000 port does run directly from flash. It
sets up different VMA and LMA addresses for the writable sections in
the linker scripts and copies the data section from flash to RAM in
the early startup code.
Flash programming is handled by putting certain functions into a
.flashprog section which is loaded into the icache and locked.
As for the usefulness of it....well, I'm quite frankly not sure. It
does mean that certain features won't work without some modifications
(e.g. the FAT filesystem and the networking code bloat the .bss
something awful, making it not fit in the internal RAM on AP7000) and
the standard flash drivers can't be used. Both of these problems are
fixable though, and running directly from flash means less copying and
therefore possibly faster bootup time. Sure, reading from flash is
often slower than reading from RAM, but that's what the caches are
Even though I might submit patches to de-bloat the FAT and networking
code (zeroing out a 200K section isn't _that_ expensive, but it isn't
exactly free either, and it may have a negative effect on the boot
time) I'll probably add relocation support to the avr32 code first.
More information about the U-Boot