[PATCH v2 8/9] mach-snapdragon: Add commands to create wrapper ELF

Simon Glass sjg at chromium.org
Sat Apr 11 15:14:38 CEST 2026


Hi Varadarajan,

On 2026-04-10T09:11:45, Varadarajan Narayanan
<varadarajan.narayanan at oss.qualcomm.com> wrote:
> mach-snapdragon: Add commands to create wrapper ELF
>
> The IPQ5210 boot ROM expects the SPL binary image to be embedded within
> an ELF along with additional binaries. Hence add the relevant commands
> and linker script needed to convert u-boot-spl.bin to the expected
> format.
>
> Signed-off-by: Varadarajan Narayanan <varadarajan.narayanan at oss.qualcomm.com>
>
> arch/arm/mach-snapdragon/Kconfig                  |  6 ++++++
>  arch/arm/mach-snapdragon/ipq5210-spl-wrap-elf.lds | 14 ++++++++++++++
>  scripts/Makefile.xpl                              | 21 +++++++++++++++++++++
>  3 files changed, 41 insertions(+)

> diff --git a/arch/arm/mach-snapdragon/ipq5210-spl-wrap-elf.lds b/arch/arm/mach-snapdragon/ipq5210-spl-wrap-elf.lds
> new file mode 100644
> @@ -0,0 +1,14 @@
> +PHDRS {

Please add SPDX licence identifier.

> diff --git a/arch/arm/mach-snapdragon/ipq5210-spl-wrap-elf.lds b/arch/arm/mach-snapdragon/ipq5210-spl-wrap-elf.lds
> @@ -0,0 +1,14 @@
> +SECTIONS {
> +     . = 0x8c24000;

This hardcodes the load address. It would be better to use
CONFIG_SPL_TEXT_BASE here so it stays in sync with the defconfig. You
can pass it via LDPPFLAGS in Makefile.xpl similar to how
IMAGE_TEXT_BASE is passed.

> diff --git a/arch/arm/mach-snapdragon/Kconfig b/arch/arm/mach-snapdragon/Kconfig
> @@ -45,4 +45,10 @@ config SYS_CONFIG_NAME
> +config SPL_WRAPPER_ELF
> +     bool "Create wrapper ELF for applicable platforms"
> +     help
> +       Some platforms embed the U-Boot SPL binary within an ELF as a
> +       segment. Additional tools are used to convert this ELF into a
> +       image that is usable for the boot ROM.

into an image

Since you are adding a new SPL feature you may need to add "depends on
SPL" to make the dependency explicit.

Regards,
Simon


More information about the U-Boot mailing list