From: Tom Rini <trini@konsulko.com>
To: michael.srba@seznam.cz
Cc: u-boot@lists.denx.de, Sumit Garg <sumit.garg@kernel.org>,
u-boot-qcom@groups.io,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Simon Glass <sjg@chromium.org>,
Sughosh Ganu <sughosh.ganu@arm.com>,
Anshul Dalal <anshuld@ti.com>, Peng Fan <peng.fan@nxp.com>,
Mattijs Korpershoek <mkorpershoek@kernel.org>,
Quentin Schulz <quentin.schulz@cherry.de>,
Heinrich Schuchardt <xypron.glpk@gmx.de>,
Andrew Davis <afd@ti.com>, Hrushikesh Salunke <h-salunke@ti.com>,
Dario Binacchi <dario.binacchi@amarulasolutions.com>,
Ye Li <ye.li@nxp.com>, Andre Przywara <andre.przywara@arm.com>,
Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>,
Leo Yu-Chi Liang <ycliang@andestech.com>,
Andrew Goodbody <andrew.goodbody@linaro.org>,
Dhruva Gole <d-gole@ti.com>,
Kaustabh Chakraborty <kauschluss@disroot.org>,
Jerome Forissier <jerome.forissier@arm.com>,
Heiko Schocher <hs@nabladev.com>,
Marek Vasut <marek.vasut+renesas@mailbox.org>,
Lukasz Majewski <lukma@denx.de>,
Mateusz Kulikowski <mateusz.kulikowski@gmail.com>,
Dinesh Maniyam <dinesh.maniyam@altera.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
Patrice Chotard <patrice.chotard@foss.st.com>,
Patrick Delaunay <patrick.delaunay@foss.st.com>,
Michal Simek <michal.simek@amd.com>, Yao Zi <me@ziyao.cc>,
Peter Korsgaard <peter@korsgaard.com>,
Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>,
Casey Connolly <casey.connolly@linaro.org>,
Tingting Meng <tingting.meng@altera.com>,
Tien Fong Chee <tien.fong.chee@altera.com>,
Alice Guo <alice.guo@nxp.com>, George Chan <gchan9527@gmail.com>,
Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>,
Alexey Charkov <alchark@gmail.com>,
Ronald Wahl <ronald.wahl@legrand.com>,
Michael Trimarchi <michael@amarulasolutions.com>
Subject: Re: [PATCH v3 01/11] Makefile: add SPL_REMAKE_ELF_LDSCRIPT feature
Date: Tue, 21 Apr 2026 14:45:36 -0600 [thread overview]
Message-ID: <20260421204536.GA41863@bill-the-cat> (raw)
In-Reply-To: <20260421-qcom_spl-v3-1-efee3f76754d@seznam.cz>
[-- Attachment #1: Type: text/plain, Size: 3111 bytes --]
On Tue, Apr 21, 2026 at 09:43:44PM +0200, michael.srba@seznam.cz wrote:
> From: Michael Srba <Michael.Srba@seznam.cz>
>
> Some platforms (e.g. least Qualcomm), use the ELF format in creative
> ways, including in the bootrom. Make SPL_REMAKE_ELF use a linker script
> specified in SPL_REMAKE_ELF_LDSCRIPT (with the previously hardcoded path
> as the default).
>
> Signed-off-by: Michael Srba <Michael.Srba@seznam.cz>
> ---
> Makefile | 10 ++++++++--
> common/spl/Kconfig | 10 ++++++++++
> 2 files changed, 18 insertions(+), 2 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 8af18668b0f..50893d5689e 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -2004,16 +2004,22 @@ u-boot.elf: u-boot.bin u-boot-elf.lds FORCE
> 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) \
> + -T spl/u-boot-spl-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
> +spl/u-boot-spl.elf: spl/u-boot-spl.bin spl/u-boot-spl-elf.lds
> $(Q)$(OBJCOPY) -I binary $(PLATFORM_ELFFLAGS) $< spl/u-boot-spl-elf.o
> $(call if_changed,u-boot-spl-elf)
>
> +SPL_REMAKE_ELF_LDSCRIPT := $(addprefix $(srctree)/,$(CONFIG_SPL_REMAKE_ELF_LDSCRIPT:"%"=%))
> +
> +spl/u-boot-spl-elf.lds: $(SPL_REMAKE_ELF_LDSCRIPT) FORCE
> + $(call if_changed_dep,cpp_lds)
> +
> u-boot-elf.lds: arch/u-boot-elf.lds prepare FORCE
> $(call if_changed_dep,cpp_lds)
>
> PHONY += prepare0
> +
> # MediaTek's ARM-based u-boot needs a header to contains its load address
> # which is parsed by the BootROM.
> # If the SPL build is enabled, the header will be added to the spl binary,
> diff --git a/common/spl/Kconfig b/common/spl/Kconfig
> index d1a85f50209..1d279a2bb05 100644
> --- a/common/spl/Kconfig
> +++ b/common/spl/Kconfig
> @@ -247,6 +247,16 @@ config SPL_HANDOFF
> proper. Also SPL can receive information from TPL in the same place
> if that is enabled.
>
> +config SPL_REMAKE_ELF_LDSCRIPT
> + string "Linker script for SPL ELF"
> + depends on SPL_REMAKE_ELF
> + default "arch/$(ARCH)/u-boot-spl-elf.lds"
> + help
> + This allows specifying a linker script that will act on u-boot-spl.bin.
> + Some platforms (e.g Qualcomm) use the ELF format in creative ways,
> + including in the bootrom. For such platforms, you can change the default
> + linker script to a platform-specific one.
> +
> config SPL_LDSCRIPT
> string "Linker script for the SPL stage"
> default "arch/arm/cpu/arm926ejs/sunxi/u-boot-spl.lds" if MACH_SUNIV
Did what I said about cleaning up the remake elf Makefile logic itself
get lost somewhere? Sorry. To repeat, we should have a remake elf
function, make use of $(PHASE_) and have Kconfig entries for both
REMAKE_ELF_LDSCRIPT and SPL_REMAKE_ELF_SCRIPT (so we can use $(PHASE_)
again to get the right one. Thanks!
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2026-04-21 21:01 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-21 19:43 [PATCH v3 00/11] Add SPL support for Qualcomm platforms, starting with sdm845 michael.srba
2026-04-21 19:43 ` [PATCH v3 01/11] Makefile: add SPL_REMAKE_ELF_LDSCRIPT feature michael.srba
2026-04-21 20:45 ` Tom Rini [this message]
2026-04-21 21:09 ` Michael Srba
[not found] ` <68690d5a-e48c-4ff7-920f-f0d4b65f5bec@seznam.cz>
2026-04-24 16:19 ` Tom Rini
2026-04-24 17:05 ` Michael Srba
2026-04-24 17:56 ` Tom Rini
2026-04-21 19:43 ` [PATCH v3 02/11] of_live: support in SPL michael.srba
2026-04-21 19:43 ` [PATCH v3 03/11] drivers: allow clk_stub and spmi " michael.srba
2026-04-21 20:46 ` Tom Rini
2026-04-21 21:05 ` Michael Srba
2026-04-21 21:10 ` Tom Rini
2026-04-24 22:46 ` Michael Srba
2026-04-24 23:15 ` Tom Rini
2026-04-21 19:43 ` [PATCH v3 04/11] mach-snapdragon: boot0.h: split out msm8916_boot0.h michael.srba
2026-04-21 19:43 ` [PATCH v3 05/11] mach-snapdragon: add u-boot-spl-elf-sdm845.lds michael.srba
2026-04-21 19:43 ` [PATCH v3 06/11] mach-snapdragon: Kconfig: fix duplicate SYS_MALLOC_LEN michael.srba
2026-04-22 1:12 ` Simon Glass
2026-04-21 19:43 ` [PATCH v3 07/11] mach-snapdragon: Kconfig: changes / additions to support SPL michael.srba
2026-04-22 1:13 ` Simon Glass
2026-04-21 19:43 ` [PATCH v3 08/11] mach-snapdragon: boot0.h: add sdm845_spl_boot0.h michael.srba
2026-04-21 19:43 ` [PATCH v3 09/11] mach-snapdragon: add board_spl.c and split out common code michael.srba
2026-04-21 19:43 ` [PATCH v3 10/11] qualcomm: add defconfig, env and docs for SPL on sdm845 michael.srba
2026-04-22 1:14 ` Simon Glass
2026-04-21 19:43 ` [PATCH v3 11/11] dts: add u-boot specific sdm845 .dtsi and a .dtsi for shift-axolotl michael.srba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260421204536.GA41863@bill-the-cat \
--to=trini@konsulko.com \
--cc=afd@ti.com \
--cc=alchark@gmail.com \
--cc=alice.guo@nxp.com \
--cc=alif.zakuan.yuslaimi@altera.com \
--cc=andre.przywara@arm.com \
--cc=andrew.goodbody@linaro.org \
--cc=anshuld@ti.com \
--cc=balaji.selvanathan@oss.qualcomm.com \
--cc=casey.connolly@linaro.org \
--cc=d-gole@ti.com \
--cc=dario.binacchi@amarulasolutions.com \
--cc=dinesh.maniyam@altera.com \
--cc=gchan9527@gmail.com \
--cc=h-salunke@ti.com \
--cc=hs@nabladev.com \
--cc=ilias.apalodimas@linaro.org \
--cc=jerome.forissier@arm.com \
--cc=kauschluss@disroot.org \
--cc=lukma@denx.de \
--cc=marek.vasut+renesas@mailbox.org \
--cc=mateusz.kulikowski@gmail.com \
--cc=me@ziyao.cc \
--cc=michael.srba@seznam.cz \
--cc=michael@amarulasolutions.com \
--cc=michal.simek@amd.com \
--cc=mkorpershoek@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=patrice.chotard@foss.st.com \
--cc=patrick.delaunay@foss.st.com \
--cc=peng.fan@nxp.com \
--cc=peter@korsgaard.com \
--cc=quentin.schulz@cherry.de \
--cc=rayagonda.kokatanur@broadcom.com \
--cc=ronald.wahl@legrand.com \
--cc=sjg@chromium.org \
--cc=sughosh.ganu@arm.com \
--cc=sumit.garg@kernel.org \
--cc=tien.fong.chee@altera.com \
--cc=tingting.meng@altera.com \
--cc=u-boot-qcom@groups.io \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.de \
--cc=ycliang@andestech.com \
--cc=ye.li@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.