[PATCH v7 05/11] mach-snapdragon: add u-boot-spl-elf-sdm845.lds

Casey Connolly casey.connolly at linaro.org
Mon May 11 15:21:32 CEST 2026


Hi Michael,

On 08/05/2026 23:45, michael.srba at seznam.cz wrote:
> From: Michael Srba <Michael.Srba at seznam.cz>
> 
> This custom linker script is required to produce a bootable ELF
> for the sdm845 SoC. An xbl_sec.elf must be provided, which will
> be put in a section in the ELF as required by the boot rom.
> 
> Signed-off-by: Michael Srba <Michael.Srba at seznam.cz>
> Reviewed-by: Simon Glass <sjg at chromium.org>
> ---
>  arch/arm/mach-snapdragon/u-boot-spl-elf-sdm845.lds | 44 ++++++++++++++++++++++

Can you put this in a new board/qualcomm/sdm845-spl directory? Also
missed this with the other patch but the .env file can go there too (as
well as a debug config fragment if you add that).

>  1 file changed, 44 insertions(+)
> 
> diff --git a/arch/arm/mach-snapdragon/u-boot-spl-elf-sdm845.lds b/arch/arm/mach-snapdragon/u-boot-spl-elf-sdm845.lds
> new file mode 100644
> index 00000000000..3740209d499
> --- /dev/null
> +++ b/arch/arm/mach-snapdragon/u-boot-spl-elf-sdm845.lds
> @@ -0,0 +1,44 @@
> +/* SPDX-License-Identifier: GPL-2.0+ */
> +
> +/*
> + * The boot rom uses the segment type to identify the xbl_sec program header.
> + * See https://github.com/coreboot/coreboot/blob/643efabd2af9f7ac/util/qualcomm/mbn_tools.py#L143.
> + */
> +#define PF_SEGMENT_TYPE_XBL_SEC 5
> +
> +/*
> + * The boot rom expects this to be equal to a seemingly magic value possibly specific
> + * to a particular xbl_sec.elf. If you're extracting your xbl_sec.elf from an xbl elf,
> + * you can just reuse the value; otherwise you can either compute it yourself or use
> + * coreboot's tool.
> + * See https://github.com/coreboot/coreboot/blob/643efabd2af9f7ac/util/qualcomm/createxbl.py#L638.
> + */
> +#define XLB_SEC_SEGMENT_ADDR 0x0000000014699000
> +
> +
> +TARGET("binary")
> +INPUT("./xbl_sec.elf")
> +
> +OUTPUT_FORMAT("default")
> +
> +ENTRY(CONFIG_PLATFORM_ELFENTRY)
> +PHDRS
> +{
> +	data PT_LOAD FLAGS(7);
> +	xbl_sec PT_LOAD FLAGS(5 | (PF_SEGMENT_TYPE_XBL_SEC << 24));
> +}
> +SECTIONS
> +{
> +
> +	. = XLB_SEC_SEGMENT_ADDR;
> +	.xbl_sec : { // XBL_SEC nested ELF
> +		. = .;
> +		"./xbl_sec.elf"
> +	} :xbl_sec
> +
> +	. = CONFIG_PLATFORM_ELFENTRY;
> +
> +	.data : {
> +		*(.data*)
> +	} :data
> +}
> 

-- 
// Casey (she/her)



More information about the U-Boot mailing list