public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Hendrik Donner <hd@os-cillation.de>
To: Quentin Schulz <quentin.schulz@cherry.de>, u-boot@lists.denx.de
Cc: Oliver Graute <oliver.graute@kococonnector.com>,
	Tom Rini <trini@konsulko.com>,
	Rasmus Villemoes <rasmus.villemoes@prevas.dk>,
	Jonathan Humphreys <j-humphreys@ti.com>,
	Michal Simek <michal.simek@amd.com>,
	Simon Glass <sjg@chromium.org>,
	Prasad Kummari <prasad.kummari@amd.com>
Subject: Re: [PATCH 2/2] Makefile.lib: Set xPL build related defines for DTB build
Date: Thu, 6 Mar 2025 17:28:34 +0100	[thread overview]
Message-ID: <edbda604-e8f8-4f4c-b506-2dfb528fe10d@os-cillation.de> (raw)
In-Reply-To: <33908f3c-b8d2-4beb-8caa-d6ff7cc3317c@cherry.de>


Hello,

On 06.03.25 11:18, Quentin Schulz wrote:
> Hi Hendrik,
> 
> On 3/5/25 7:35 PM, Hendrik Donner wrote:
>> [You don't often get email from hd@os-cillation.de. Learn why this is 
>> important at https://aka.ms/LearnAboutSenderIdentification ]
>>
>> The CONFIG_*PL_BUILD defines are currently not defined when
>> preprocessing the dts files, leading to build problems with binman. Set
>> the defines based on the related CONFIG_*PL values.
>>
>> Tested-by: Oliver Graute <oliver.graute@kococonnector.com>
> 
> Please have this person publicly answer they tested it instead of having 
> it already in the v1 of the patch, too easy to impersonate someone and 
> give a false sense of trust into a patch that may not actually have been 
> tested.
> 
>> Signed-off-by: Hendrik Donner <hd@os-cillation.de>
>> ---
>>   scripts/Makefile.lib | 10 ++++++++++
>>   1 file changed, 10 insertions(+)
>>
>> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
>> index 54403040f00..dd2c6363224 100644
>> --- a/scripts/Makefile.lib
>> +++ b/scripts/Makefile.lib
>> @@ -217,6 +217,16 @@ dtc_cpp_flags  = -Wp,-MD,$(depfile).pre.tmp - 
>> nostdinc                    \
>>                   - 
>> D__ASSEMBLY__                                          \
>>                   -undef -D__DTS__
>>
>> +ifeq ($(CONFIG_SPL),y)
>> +dtc_cpp_flags += -DCONFIG_XPL_BUILD  -DCONFIG_SPL_BUILD
>> +endif
>> +ifeq ($(CONFIG_TPL),y)
>> +dtc_cpp_flags += -DCONFIG_XPL_BUILD  -DCONFIG_TPL_BUILD
>> +endif
>> +ifeq ($(CONFIG_VPL),y)
>> +dtc_cpp_flags += -DCONFIG_XPL_BUILD  -DCONFIG_VPL_BUILD
>> +endif
>> +
> 
> You don't actually explain what you're trying to fix here and why this 
> fixes it?
> 
> Why would you need those symbols for the DT?
> 

well they are already in use in tree ([1], [2]), which breaks the build.

The history of both files is that the guards were introduced as
CONFIG_SPL, which builds, to CONFIG_SPL_BUILD, which should break the
build, haven't tested, and somewhat recently to CONFIG_XPL_BUILD,
which is when i noticed that it breaks the build for me.

Now the guards are around SPL specific nodes, so i didn't question it.
My understanding was that those are needed not necessarily during the
SPL phase, but only if SPL is defined at all.

If i understand you correctly none of it should have been introduced
like that in the first place?

I noticed it's broken in the uboot CI run too, but since the boards
need firmware blobs the CI build is erroring out in the first place, so
i guess no one noticed.

> For removing nodes in xPL, you can use one of the bootph- properties.
> 
> The DT is supposed to represent the HW, so having a different DT between 
> stages is very likely wrong. Note that having a subset of the full DT in 
> xPL stages is a bit of an exception here, for size purposes (usually 
> because of limited SRAM) or boot time purposes (you don't need to enable 
> everything in the DT in the first stage after BootROM simply to init 
> UART and DRAM :) ).
> 
> As for binman, why would it even need to be run during the xPL build 
> stages? Can you provide more context on this?
> 
> We have some big nasty ifdefery in arch/arm/dts/rockchip-u-boot.dtsi for 
> example, which has some logic on whether some symbols are defined, but 
> they are defined regardless of the stage and I assume binman gets run 
> only once, and not in xPL build phase? Is this something not applicable 
> for (I assume that's the user of that) imx8?

The arch/arm/dts/rockchip-u-boot.dtsi ifdefery is based directly on
CONFIG_SPL, not CONFIG_SPL_BUILD nor CONFIG_XPL_BUILD, so maybe the 2
dtsi i mentioned should have kept using CONFIG_SPL in the first place.

So move those back to using CONFIG_SPL?

Regards,
Hendrik

[1] 
https://source.denx.de/u-boot/u-boot/-/blob/master/arch/arm/dts/imx8qm-u-boot.dtsi#L13
[2] 
https://source.denx.de/u-boot/u-boot/-/blob/master/arch/arm/dts/imx8qxp-u-boot.dtsi#L13

> 
> Cheers,
> Quentin


  parent reply	other threads:[~2025-03-06 16:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-05 18:35 [PATCH 0/2] Build fixes for CONFIG_XPL_BUILD in dts files Hendrik Donner
2025-03-05 18:35 ` [PATCH 1/2] imx8qm: Fix build when using SPL Hendrik Donner
2025-03-05 18:35 ` [PATCH 2/2] Makefile.lib: Set xPL build related defines for DTB build Hendrik Donner
2025-03-06 10:18   ` Quentin Schulz
2025-03-06 10:22     ` Oliver Graute
2025-03-06 16:28     ` Hendrik Donner [this message]
2025-03-06 17:40       ` Quentin Schulz
2025-03-14 20:08         ` [PATCH 0/2] Do not use CONFIG_XPL_BUILD in device tree Hendrik Donner
2025-03-14 20:08           ` [PATCH 1/2] imx8qxp: " Hendrik Donner
2025-03-15 11:58             ` Fabio Estevam
2025-03-17 11:10               ` Quentin Schulz
2025-03-17 12:41                 ` Hendrik Donner
2025-03-17 13:40                 ` Tom Rini
2025-03-14 20:08           ` [PATCH 2/2] imx8qm: " Hendrik Donner
2025-03-06 17:56       ` [PATCH 2/2] Makefile.lib: Set xPL build related defines for DTB build Simon Glass

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=edbda604-e8f8-4f4c-b506-2dfb528fe10d@os-cillation.de \
    --to=hd@os-cillation.de \
    --cc=j-humphreys@ti.com \
    --cc=michal.simek@amd.com \
    --cc=oliver.graute@kococonnector.com \
    --cc=prasad.kummari@amd.com \
    --cc=quentin.schulz@cherry.de \
    --cc=rasmus.villemoes@prevas.dk \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox