[U-Boot] [PATCH v2 0/4] Factorize ARM relocate_code instances

Albert ARIBAUD albert.u.boot at aribaud.net
Tue May 14 11:50:26 CEST 2013


This series replaces all instances of relocate_code in
various start.S files from the ARM architecture with a
single instance in arch/arm/lib/relocate.S.

This is done in steps, each step keeping the whole of ARM
U-Boot buildable and runnable and touching as little code
as necessary.

1. Drop mx31pdk SPL call to relocate_code

In SPL of mx31pdk, board_init_f calls relocate_code to
move SPL from the NAND read buffer to SRAM. This move
is not a relocation and is thus better implemented as
a simple ad hoc copy loop.

2. Drop tx25 SPL call to relocate_code

Same as mx31pdk.

3. Prevent all SPLs from assembling relocate_code

Now that no SPL uses relocate_code any more, remove
it completely from SPL builds by putting it entirely
between #ifndef CONFIG_SPL_BUILD and #endif preprocessor
conditional.

4. Actual factorization of relocate_code

Remove all instances of relocate_code from start.S and
create a new file, arch/arm/lib/relocate.S, to provide
the new single instance of relocate_code.

The only non-trivial change is that for PXA25X, a call
to unlock (actually disable) dcache is moved from before
relocating to after relocating. As this cache is either
locked-as-RAM or disabled, but never used as actual DDR
cache, this move has no performance effect on relocation
and no functional impact either.

Changes in v2:
- dropped relocate_code() call from mx31pdk SPL
- dropped relocate_code() call from tx25 SPL
- dropped all relocate_code instances from SPL builds
- use ENTRY / ENDPROC macros
- preserve PXA25X dcache unlocking

Albert ARIBAUD (4):
  mx31pdk: copy SPL directly, not using relocate_code.
  tx25: copy SPL directly, not using relocate_code.
  arm: do not compile relocate_code() for SPL builds
  arm: factorize relocate_code routine

 arch/arm/cpu/arm1136/start.S      |   81 ---------------------------
 arch/arm/cpu/arm1176/start.S      |   77 -------------------------
 arch/arm/cpu/arm720t/start.S      |   77 -------------------------
 arch/arm/cpu/arm920t/start.S      |   77 -------------------------
 arch/arm/cpu/arm925t/start.S      |   77 -------------------------
 arch/arm/cpu/arm926ejs/start.S    |   81 ---------------------------
 arch/arm/cpu/arm946es/start.S     |   77 -------------------------
 arch/arm/cpu/arm_intcm/start.S    |   77 -------------------------
 arch/arm/cpu/armv7/start.S        |   78 --------------------------
 arch/arm/cpu/ixp/start.S          |   77 -------------------------
 arch/arm/cpu/pxa/start.S          |   96 +++-----------------------------
 arch/arm/cpu/s3c44b0/start.S      |   77 -------------------------
 arch/arm/cpu/sa1100/start.S       |   77 -------------------------
 arch/arm/lib/Makefile             |    1 +
 arch/arm/lib/relocate.S           |  111 +++++++++++++++++++++++++++++++++++++
 board/freescale/mx31pdk/mx31pdk.c |   16 +++++-
 board/karo/tx25/tx25.c            |   16 +++++-
 17 files changed, 151 insertions(+), 1022 deletions(-)
 create mode 100644 arch/arm/lib/relocate.S

-- 
1.7.10.4



More information about the U-Boot mailing list