spl: Support a relocating jump between phases (VBE part F)
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest19 patches 9 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/19 | spl: Reduce the size of the bl_len fieldinclude/ | +1 | 3 replies | |
| 2/19 | spl: Provide a way of indicating the phase to loadinclude/ | +23 | 0 replies | |
| 3/19 | spl: Avoid including hash algorithms which are not wantedlib/ | +3 | 0 replies | |
| 4/19 | spl: Provide a way to mark code needed for relocationinclude/ | +16 | 2 replies | |
| 5/19 | lib: Mark crc8 as relocation codelib/ | +3 | 0 replies | |
| 6/19 | lib: Mark lz4 as relocation codelib/ lib/ | +16 | 1 reply | |
| 7/19 | lib: Mark memcpy() and memmove() as relocation codelib/ | +3 | 0 replies | |
| 8/19 | spl: Add a type for the jumper functioncommon/ include/ | +4 | 0 replies | |
| 9/19 | spl: Add support for a relocating jump to the next phaseMAINTAINERS common/ common/ +5 more | +279 | 0 replies | |
| 10/19 | spl: Plumb in the relocating loadercommon/ | +12 | 0 replies | |
| 11/19 | spl: Support jumping to VPL from TPLcommon/ | +16 | 3 replies | |
| 12/19 | spl: Record the correct name of the next phasecommon/ | +1 | 0 replies | |
| 13/19 | spl: Show how to fill in the size of the next imagecommon/ | +1 | 0 replies | |
| 14/19 | spl: Add debugging in spl_set_header_raw_uboot()common/ | +5 | 0 replies | |
| 15/19 | arm: qemu: Allow SPL and TPLarch/ | +2 | 0 replies | |
| 16/19 | arm: Add a new qemu_arm64_tpl boardarch/ arch/ board/ +5 more | +166 | 0 replies | |
| 17/19 | arm: Provide an rcode section in ARMv8 link scriptarch/ | +8 | 0 replies | |
| 18/19 | arm: qemu_arm64_tpl: Enable the relocating loaderarch/ board/ configs/ +1 more | +38 | 0 replies | |
| 19/19 | CI: Add new test for reloc loader.azure-pipelines.yml .gitlab-ci.yml | +9 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 00/19] spl: Support a relocating jump between phases (VBE part F)
This series includes a way to deal with multiple XPL phases being built to run from the same region of SRAM. This is useful because it may not be possible to fit all the different phases in different parts of the SRAM. Also it is a pain to have to build them with different values for CONFIG_TEXT_BASE such that they can be loaded at different addresses.
The mechanism is to copy some relocation code to the top of memory, then load the next phase below that. Finally, the first phase jumps to the relocation code, which copies or decompresses the next phase, overwriting the first phase in the process. Finally, the relocation code jumps to the start of the next phase.
In this way the maximum amount of space can be used, particular if the next phase is compressed.
For this to work, some code in U-Boot must be placed in a 'rcode' (relocation code) section. This ensures it can be copied as a block, thus reducing the amount of the first-stage code which needs to survive the relocation process.
For now there is a qemu-arm64 test for this feature, which ensures that the basic mechanism is sound. Further work will likely expand this test to include VPL and LZ4-compression, which so far have only been used on real hardware.
Overall, without SPL_RELOC_LOADER enabled, this series provides a very small code-size benefit due to it dropping some unneeded symbols.
Simon Glass (19):
spl: Reduce the size of the bl_len field
spl: Provide a way of indicating the phase to load
spl: Avoid including hash algorithms which are not wanted
spl: Provide a way to mark code needed for relocation
lib: Mark crc8 as relocation code
lib: Mark lz4 as relocation code
lib: Mark memcpy() and memmove() as relocation code
spl: Add a type for the jumper function
spl: Add support for a relocating jump to the next phase
spl: Plumb in the relocating loader
spl: Support jumping to VPL from TPL
spl: Record the correct name of the next phase
spl: Show how to fill in the size of the next image
spl: Add debugging in spl_set_header_raw_uboot()
arm: qemu: Allow SPL and TPL
arm: Add a new qemu_arm64_tpl board
arm: Provide an rcode section in ARMv8 link script
arm: qemu_arm64_tpl: Enable the relocating loader
CI: Add new test for reloc loader
.azure-pipelines.yml | 3 + .gitlab-ci.yml | 6 + MAINTAINERS | 6 + arch/arm/Kconfig | 2 + arch/arm/cpu/armv8/u-boot-spl.lds | 8 ++ arch/arm/dts/qemu-arm64.dts | 17 +++ arch/arm/mach-qemu/Kconfig | 20 +++ board/emulation/qemu-arm/Kconfig | 2 +- board/emulation/qemu-arm/MAINTAINERS | 5 + board/emulation/qemu-arm/Makefile | 1 + board/emulation/qemu-arm/qemu-arm.env | 4 + board/emulation/qemu-arm/xpl.c | 50 +++++++ common/spl/Kconfig | 9 ++ common/spl/Kconfig.tpl | 9 ++ common/spl/Kconfig.vpl | 8 ++ common/spl/Makefile | 1 + common/spl/spl.c | 45 +++++-- common/spl/spl_reloc.c | 182 ++++++++++++++++++++++++++ configs/qemu_arm64_tpl_defconfig | 83 ++++++++++++ doc/develop/spl.rst | 35 +++++ include/asm-generic/sections.h | 16 +++ include/spl.h | 57 +++++++- lib/Makefile | 6 +- lib/crc8.c | 5 +- lib/lz4.c | 27 ++-- lib/lz4_wrapper.c | 2 +- lib/string.c | 5 +- test/py/tests/test_reloc.py | 21 +++ 28 files changed, 604 insertions(+), 31 deletions(-) create mode 100644 board/emulation/qemu-arm/xpl.c create mode 100644 common/spl/spl_reloc.c create mode 100644 configs/qemu_arm64_tpl_defconfig create mode 100644 test/py/tests/test_reloc.py
Signature · 1 line
2.43.0