[U-Boot] [PATCH] arm: Add option to disable code relocation

Graeme Russ graeme.russ at gmail.com
Wed Feb 8 23:05:27 CET 2012


Hi Simon,

On Wed, Feb 8, 2012 at 6:12 PM, Simon Glass <sjg at chromium.org> wrote:
> Hi Dirk,
>

> But turning on the cache should be trivial - it is already supported
> so you just need to implement the enable_dcache() function(?) I think.
>
> Also make sure that the I-Cache is on as early as possible. Relocation
> is done with the d-cache off so is slow. Takes about 40ms for me from

I have shown that this does not need to be the case - For x86 relocation
is performed in the following sequence:

  1) CPU Init, Disable Cache, Setup 'Cache-As-RAM', init global data and
     stack in 'Cache-As-RAM'
  2) Init SDRAM
  3) Allocate new stack in SDRAM
  4) Pivot U-Boot so now SDRAM stack is being used but code is still being
     executed in Flash
  5) Copy global data from CAR to SDRAM
  6) Init cache (trashes CAR, but that's OK - it's not being used anymore)
  7) Copy U-Boot from Flash to SDRAM
  8) Perform relocation fixups
  9) Jump to in-RAM copy of U-Boot
 10) Continue init sequence...

> memory, but we do have things which can speed it up. But d-cache
> matters more than just about anything.

Regards,

Graeme


More information about the U-Boot mailing list