[U-Boot] [PATCH v2 0/3] Enable spl relocation on arm

Andy Yan andy.yan at rock-chips.com
Thu May 16 12:19:26 UTC 2019


Some times we want to relocate spl code to dram after dram
initialization or relocate spl code to a high memory to avoid
code overid.

For example on Rockchip armv8 platform, we run with boot flow
TPL->SPL->ATF->U-Boot.
TPL run in sram and is responsible for dram initialization.
SPL run from the start address of dram and is responsible for
loading ATF and U-Boot.

The case here is that the ATF load address is from 64KB of dram,
which overlaps with spl code itself.

So we want to relocate spl itself to high memory to aovid this.

When look the code, I found powerpc use the spl relocation. So
I dicide share the config with powerpc.

Changes in v2:
- Move Kconfig modification to PATCH 1/3
- Add more detial commit message

Andy Yan (3):
  powerpc: Convert CONFIG_SPL_RELOC_TEXT_BASE to Kconfig
  spl: add relocation support
  arm: add spl relocation support for arm

 arch/arm/config.mk                           |  6 +++
 arch/arm/cpu/armv8/start.S                   |  4 ++
 arch/arm/cpu/armv8/u-boot-spl.lds            | 17 ++++++
 arch/arm/lib/Makefile                        |  2 +-
 arch/arm/lib/crt0_64.S                       |  3 +-
 common/spl/Kconfig                           | 13 +++++
 common/spl/spl.c                             | 55 ++++++++++++++++++++
 configs/BSC9131RDB_NAND_SYSCLK100_defconfig  |  2 +
 configs/BSC9131RDB_NAND_defconfig            |  2 +
 configs/BSC9132QDS_NAND_DDRCLK100_defconfig  |  2 +
 configs/BSC9132QDS_NAND_DDRCLK133_defconfig  |  2 +
 configs/C29XPCIE_NAND_defconfig              |  2 +
 configs/P1010RDB-PA_36BIT_NAND_defconfig     |  2 +
 configs/P1010RDB-PA_36BIT_SDCARD_defconfig   |  2 +
 configs/P1010RDB-PA_36BIT_SPIFLASH_defconfig |  2 +
 configs/P1010RDB-PA_NAND_defconfig           |  2 +
 configs/P1010RDB-PA_SDCARD_defconfig         |  2 +
 configs/P1010RDB-PA_SPIFLASH_defconfig       |  2 +
 configs/P1010RDB-PB_36BIT_NAND_defconfig     |  2 +
 configs/P1010RDB-PB_36BIT_SDCARD_defconfig   |  2 +
 configs/P1010RDB-PB_36BIT_SPIFLASH_defconfig |  2 +
 configs/P1010RDB-PB_NAND_defconfig           |  2 +
 configs/P1010RDB-PB_SDCARD_defconfig         |  2 +
 configs/P1010RDB-PB_SPIFLASH_defconfig       |  2 +
 configs/P1020MBG-PC_36BIT_SDCARD_defconfig   |  2 +
 configs/P1020MBG-PC_SDCARD_defconfig         |  2 +
 configs/P1020RDB-PC_36BIT_NAND_defconfig     |  2 +
 configs/P1020RDB-PC_36BIT_SDCARD_defconfig   |  2 +
 configs/P1020RDB-PC_36BIT_SPIFLASH_defconfig |  2 +
 configs/P1020RDB-PC_NAND_defconfig           |  2 +
 configs/P1020RDB-PC_SDCARD_defconfig         |  2 +
 configs/P1020RDB-PC_SPIFLASH_defconfig       |  2 +
 configs/P1020RDB-PD_NAND_defconfig           |  2 +
 configs/P1020RDB-PD_SDCARD_defconfig         |  2 +
 configs/P1020RDB-PD_SPIFLASH_defconfig       |  2 +
 configs/P1020UTM-PC_36BIT_SDCARD_defconfig   |  2 +
 configs/P1020UTM-PC_SDCARD_defconfig         |  2 +
 configs/P1021RDB-PC_36BIT_NAND_defconfig     |  2 +
 configs/P1021RDB-PC_36BIT_SDCARD_defconfig   |  2 +
 configs/P1021RDB-PC_36BIT_SPIFLASH_defconfig |  2 +
 configs/P1021RDB-PC_NAND_defconfig           |  2 +
 configs/P1021RDB-PC_SDCARD_defconfig         |  2 +
 configs/P1021RDB-PC_SPIFLASH_defconfig       |  2 +
 configs/P1022DS_36BIT_NAND_defconfig         |  2 +
 configs/P1022DS_36BIT_SDCARD_defconfig       |  2 +
 configs/P1022DS_36BIT_SPIFLASH_defconfig     |  2 +
 configs/P1022DS_NAND_defconfig               |  2 +
 configs/P1022DS_SDCARD_defconfig             |  2 +
 configs/P1022DS_SPIFLASH_defconfig           |  2 +
 configs/P1024RDB_NAND_defconfig              |  2 +
 configs/P1024RDB_SDCARD_defconfig            |  2 +
 configs/P1024RDB_SPIFLASH_defconfig          |  2 +
 configs/P1025RDB_NAND_defconfig              |  2 +
 configs/P1025RDB_SDCARD_defconfig            |  2 +
 configs/P1025RDB_SPIFLASH_defconfig          |  2 +
 configs/P2020RDB-PC_36BIT_NAND_defconfig     |  2 +
 configs/P2020RDB-PC_36BIT_SDCARD_defconfig   |  2 +
 configs/P2020RDB-PC_36BIT_SPIFLASH_defconfig |  2 +
 configs/P2020RDB-PC_NAND_defconfig           |  2 +
 configs/P2020RDB-PC_SDCARD_defconfig         |  2 +
 configs/P2020RDB-PC_SPIFLASH_defconfig       |  2 +
 include/configs/BSC9131RDB.h                 |  1 -
 include/configs/BSC9132QDS.h                 |  1 -
 include/configs/C29XPCIE.h                   |  3 --
 include/configs/P1010RDB.h                   |  4 --
 include/configs/P1022DS.h                    |  3 --
 include/configs/p1_p2_rdb_pc.h               |  3 --
 67 files changed, 206 insertions(+), 17 deletions(-)

-- 
2.17.1





More information about the U-Boot mailing list