[PATCH 1/4] build: Respect CONFIG_SPL_BUILD in DT sources

Hendrik Donner hd at os-cillation.de
Fri Apr 25 16:24:04 CEST 2025


Hello,

On 25.04.25 16:17, Tom Rini wrote:
> On Fri, Apr 25, 2025 at 10:52:17AM -0300, Fabio Estevam wrote:
> 
>> From: Marek Vasut <marex at denx.de>
>>
>> Currently the U-Boot SPL build uses the same DTBs that were generated
>> during U-Boot proper build, and calls 'fdtgrep' on those DTBs to filter
>> out uninteresting nodes and properties. Those U-Boot proper DTBs are
>> built from DTS which are first preprocessed by CPP, but that CPP is
>> invoked in U-Boot proper build context and effectively ignores the
>> CONFIG_SPL_BUILD macro. In case the CONFIG_SPL_BUILD macro is used
>> in any .dts file, the content of the macro is removed by CPP.
>>
>> Fix this by building a separate set of DTBs for the SPL, which are
>> preprocessed by CPP with -DCONFIG_SPL_BUILD set. Use the same way
>> for the other PLs.
>>
>> Signed-off-by: Marek Vasut <marex at denx.de>
>> Signed-off-by: Fabio Estevam <festevam at denx.de>
>> ---
>>   dts/Makefile         |  5 ++++-
>>   scripts/Makefile.lib | 11 +++++++++++
>>   scripts/Makefile.xpl |  7 ++++++-
>>   3 files changed, 21 insertions(+), 2 deletions(-)
> 
> There's already a thread here:
> https://lore.kernel.org/u-boot/20250305183544.40525-1-hd@os-cillation.de/
> saying that we shouldn't be doing what this patch adds.
> 

i was even asked to add a checkpatch.pl check for that:

https://lore.kernel.org/u-boot/20250306201540.127646-1-hd@os-cillation.de/

The original thread has been idle for a few weeks, i was about to ask
how to move forward with the initial problem.

Regards,
Hendrik


More information about the U-Boot mailing list