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

Marek Vasut marex at denx.de
Tue Nov 26 01:40:15 CET 2024


On 11/26/24 1:32 AM, Simon Glass wrote:
> Hi Marek,
> 
> On Thu, 21 Nov 2024 at 18:59, Marek Vasut <marex at denx.de> wrote:
>>
>> 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>
>> ---
>> Cc: "NXP i.MX U-Boot Team" <uboot-imx at nxp.com>
>> Cc: Bryan Brattlof <bb at ti.com>
>> Cc: Fabio Estevam <festevam at gmail.com>
>> Cc: Greg Malysa <greg.malysa at timesys.com>
>> Cc: Ian Roberts <ian.roberts at timesys.com>
>> Cc: Ilias Apalodimas <ilias.apalodimas at linaro.org>
>> Cc: Jonathan Humphreys <j-humphreys at ti.com>
>> Cc: Masahisa Kojima <kojima.masahisa at socionext.com>
>> Cc: Nathan Barrett-Morrison <nathan.morrison at timesys.com>
>> Cc: Rasmus Villemoes <rasmus.villemoes at prevas.dk>
>> Cc: Simon Glass <sjg at chromium.org>
>> Cc: Stefano Babic <sbabic at denx.de>
>> Cc: Sumit Garg <sumit.garg at linaro.org>
>> Cc: Tim Harvey <tharvey at gateworks.com>
>> Cc: Tom Rini <trini at konsulko.com>
>> Cc: u-boot at lists.denx.de
>> ---
>> NOTE: For v2025.04
>> ---
>>   dts/Makefile         |  5 ++++-
>>   scripts/Makefile.lib | 11 +++++++++++
>>   scripts/Makefile.xpl |  7 ++++++-
>>   3 files changed, 21 insertions(+), 2 deletions(-)
> 
> As mentioned on the other patch, this should be handled in fdtgrep
Adam already replied to you regarding this part in 3/4 , please continue 
the discussion there.


More information about the U-Boot mailing list