diff options
| author | Michal Simek <[email protected]> | 2026-02-26 10:27:16 +0100 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2026-03-13 13:21:52 -0600 |
| commit | 60ef345b1a10ec859f29ebc706724f907e8771cb (patch) | |
| tree | ab2a01e64dabaab4787ef231d6e1fefb8a97410f | |
| parent | 7f35a4251dae2b1c94c959ac15cf4d0814485a88 (diff) | |
spl: Remake SPL elf from bin
On Xilinx MB-V there is a need to use ELF file for SPL which is placed
in BRAM (Block RAM) because tools for placing code to bitstream requires to
use ELF. That's why introduce SPL_REMAKE_ELF similar to REMAKE_ELF option
as was originally done by commit f4dc714aaa2d ("arm64: Turn u-boot.bin back
into an ELF file after relocate-rela").
There is already generic and simple linker script (arch/u-boot-elf.lds)
which can be also used without any modification.
Signed-off-by: Michal Simek <[email protected]>
| -rw-r--r-- | Makefile | 10 | ||||
| -rw-r--r-- | common/spl/Kconfig | 7 |
2 files changed, 17 insertions, 0 deletions
@@ -1231,6 +1231,7 @@ ifneq ($(CONFIG_SPL_TARGET),) INPUTS-$(CONFIG_SPL) += $(CONFIG_SPL_TARGET:"%"=%) endif INPUTS-$(CONFIG_REMAKE_ELF) += u-boot.elf +INPUTS-$(CONFIG_SPL_REMAKE_ELF) += spl/u-boot-spl.elf INPUTS-$(CONFIG_EFI_APP) += u-boot-app.efi INPUTS-$(CONFIG_EFI_STUB) += u-boot-payload.efi @@ -2000,6 +2001,15 @@ u-boot.elf: u-boot.bin u-boot-elf.lds FORCE $(Q)$(OBJCOPY) -I binary $(PLATFORM_ELFFLAGS) $< u-boot-elf.o $(call if_changed,u-boot-elf) +quiet_cmd_u-boot-spl-elf ?= LD $@ + cmd_u-boot-spl-elf ?= $(LD) spl/u-boot-spl-elf.o -o $@ \ + $(if $(CONFIG_SYS_BIG_ENDIAN),-EB,-EL) \ + -T u-boot-elf.lds --defsym=$(CONFIG_PLATFORM_ELFENTRY)=$(CONFIG_SPL_TEXT_BASE) \ + -Ttext=$(CONFIG_SPL_TEXT_BASE) +spl/u-boot-spl.elf: spl/u-boot-spl.bin u-boot-elf.lds + $(Q)$(OBJCOPY) -I binary $(PLATFORM_ELFFLAGS) $< spl/u-boot-spl-elf.o + $(call if_changed,u-boot-spl-elf) + u-boot-elf.lds: arch/u-boot-elf.lds prepare FORCE $(call if_changed_dep,cpp_lds) diff --git a/common/spl/Kconfig b/common/spl/Kconfig index dafc0cb91bd..69b6ad77346 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -707,6 +707,13 @@ config SPL_DRIVERS_MISC option to build the drivers in drivers/misc as part of an SPL build, for those that support building in SPL (not all drivers do). +config SPL_REMAKE_ELF + bool "Recreate an ELF image from raw SPL binary" + help + Enable this to recreate an ELF image (spl/u-boot-spl.elf) from the raw + SPL binary (spl/u-boot-spl.bin), which may already have been statically + relocated and may already have a device-tree appended to it. + config SPL_ENV_SUPPORT bool "Support an environment" help |
