All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@amd.com>
To: Simon Glass <sjg@chromium.org>, Michael Srba <Michael.Srba@seznam.cz>
Cc: u-boot@lists.denx.de, Sumit Garg <sumit.garg@kernel.org>,
	u-boot-qcom@groups.io, Tom Rini <trini@konsulko.com>,
	Ilias Apalodimas <ilias.apalodimas@linaro.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>,
	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>
Subject: Re: [PATCH 1/5] Makefile: add SPL_REMAKE_ELF_LDSCRIPT feature
Date: Mon, 13 Apr 2026 08:22:48 +0200	[thread overview]
Message-ID: <710bc45a-2846-4bae-96e2-1bbd5b0a898e@amd.com> (raw)
In-Reply-To: <CAFLszTi+sn9RZkBFFafKAcY4W4PJWsgdfBbOEv4C9=Fr1EmW=A@mail.gmail.com>



On 4/12/26 14:04, Simon Glass wrote:
> Hi Michael,
> 
> On Mon, 6 Apr 2026 at 16:44, Michael Srba <Michael.Srba@seznam.cz> wrote:
>>
>> On 4/6/26 17:50, Simon Glass wrote:
>>> Hi Michael,
>>>
>>> On 2026-04-03T23:18:18, Michael Srba <michael.srba@seznam.cz> wrote:
>>>> Makefile: add SPL_REMAKE_ELF_LDSCRIPT feature
>>>>
>>>> On some platforms (at least Qualcomm), the bootrom expects an ELF file.
>>>> Since the contents of the ELF file are platform specific, add a config
>>>> option that allows specifying a linker script to use to produce the
>>>> ELF file.
>>>>
>>>> Signed-off-by: Michael Srba <Michael.Srba@seznam.cz>
>>>> diff --git a/Makefile b/Makefile
>>>> @@ -2014,6 +2017,26 @@ u-boot-elf.lds: arch/u-boot-elf.lds prepare FORCE
>>>> +quiet_cmd_u-boot-spl-elf ?= LD      $@
>>>> +     cmd_u-boot-spl-elf ?= $(LD) spl/u-boot-spl-elf.o -o $@ \
>>>> +     -T spl/u-boot-spl-elf.lds --defsym=$(CONFIG_PLATFORM_ELFENTRY)=$(CONFIG_SPL_TEXT_BASE) \
>>>> +     -Ttext=$(CONFIG_SPL_TEXT_BASE) -z max-page-size=0x1000
>>> The existing cmd_u-boot-spl-elf includes $(if
>>> $(CONFIG_SYS_BIG_ENDIAN),-EB,-EL) for endianness. Please can you add
>>> the same here for consistency.
>>>
>>> Since this redefines cmd_u-boot-spl-elf using ?=, the earlier
>>> definition takes precedence if both SPL_REMAKE_ELF and
>>> SPL_REMAKE_ELF_LDSCRIPT are enabled. This is probably fine since
>>> enabling both does not make sense, but maybe add 'depends on
>>> !SPL_REMAKE_ELF' or a note in the Kconfig help text.
>> Hi,
>> slowly going through the reviews, I think when I originally worked on this
>> u-boot didn't support remaking SPL into an ELF at all. I completely missed
>> this change when rebasing (or didn't miss it, made a mental note, and
>> completely forgot... hard to say at this point).
>>
>> I could certainly just
>> add a conditional, though there's probably cleaner ways to do this where
>> only the linker script is conditional (not sure what to do about the page
>> size, would need to test to double check if it's even actually necessary).
>>
>> Actually, making the linker script path default to the standard one would be
>> the cleanest option by some measures, but since you didn't suggest it
>> I assume that's not your preferred solution?
> 
> Actually that seems better, something like:
> 
>    config SPL_REMAKE_ELF_LDSCRIPT
>        string "Linker script for SPL ELF"
>        depends on SPL_REMAKE_ELF
>        default "arch/$(ARCH)/u-boot-spl-elf.lds"
> 
> Then your platform can override it and there is only a single
> cmd_u-boot-spl-elf with no problems with ?= !


Keep in your mind that SPL elf remake patch has been recently merged.

Passing custom linker script needs to be done on the top of this.


Thanks,
Michal

commit 60ef345b1a10ec859f29ebc706724f907e8771cb
Author:     Michal Simek <michal.simek@amd.com>
AuthorDate: Thu Feb 26 10:27:16 2026 +0100
Commit:     Tom Rini <trini@konsulko.com>
CommitDate: Fri Mar 13 13:21:52 2026 -0600

     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 <michal.simek@amd.com>



  reply	other threads:[~2026-04-13  6:48 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-03 23:18 [PATCH 0/5] Add SPL support for Qualcomm platforms, starting with sdm845 michael.srba
2026-04-03 23:18 ` [PATCH 1/5] Makefile: add SPL_REMAKE_ELF_LDSCRIPT feature michael.srba
2026-04-06 15:50   ` Simon Glass
2026-04-06 22:43     ` Michael Srba
2026-04-12 12:04       ` Simon Glass
2026-04-13  6:22         ` Michal Simek [this message]
2026-04-03 23:18 ` [PATCH 2/5] of_live: support in SPL michael.srba
2026-04-06 14:20   ` Tom Rini
2026-04-06 15:51   ` Simon Glass
2026-04-06 22:57     ` Michael Srba
2026-04-03 23:18 ` [PATCH 3/5] drivers: allow clk_stub and spmi " michael.srba
2026-04-06 14:21   ` Tom Rini
2026-04-06 15:52   ` Simon Glass
2026-04-03 23:18 ` [PATCH 4/5] mach-snapdragon: support building SPL michael.srba
2026-04-06 14:27   ` Tom Rini
2026-04-08 17:03     ` Michael Srba
2026-04-08 17:44       ` Tom Rini
2026-04-06 15:47   ` Simon Glass
2026-04-08  8:52   ` Casey Connolly
2026-04-03 23:18 ` [PATCH 5/5] dts: add empty .dtsi for shift-axolotl michael.srba
2026-04-06 15:53   ` Simon Glass
2026-04-06 22:54     ` Michael Srba
2026-04-06 15:48 ` [0/5] Add SPL support for Qualcomm platforms, starting with sdm845 Simon Glass
2026-04-06 23:53   ` Michael Srba
2026-04-07  8:12 ` [PATCH 0/5] " Sumit Garg
2026-04-08 18:16   ` Michael Srba
2026-04-13 10:25     ` Sumit Garg

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=710bc45a-2846-4bae-96e2-1bbd5b0a898e@amd.com \
    --to=michal.simek@amd.com \
    --cc=Michael.Srba@seznam.cz \
    --cc=afd@ti.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=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=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=trini@konsulko.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.