Hello Tom, I have made the changes as discussed and rebased on master. You can 
find the latest version of my commit here:

https://github.com/emz229/u-boot/commit/739fe94e1f8096a90241f5a9348f3dcce4eb97c1

With your approval I can issue a PR.


Eric Schikschneit

Senior Embedded Linux Engineer III  ​



NovaTech, LLC

13555 W. 107th Street | Lenexa, KS 66215​

O: 913.451.1880​

  ​

novatechautomation.com<http://www.novatechautomation.com/> | 
NovaTechLinkedIn<https://www.linkedin.com/company/565017>

Receipt of this email implies compliance with our terms and 
conditions<https://www.novatechautomation.com/email-terms-conditions>.


________________________________
From: Tom Rini
Sent: Friday, May 16, 2025 11:28 AM
To: Eric Schikschneit
Cc: u-boot@lists.denx.de
Subject: Re: [PATCH] [RFC]: dtc: Add Kconfig option to pad device tree blob

On Fri, May 02, 2025 at 01:38:26PM -0500, Eric Schikschneit wrote:

> This will allow arch(s) that use device tree blobs to pad the end of the
> device tree so they can be modified by board files at run time. This will
> help prevent errors such as FDT_ERR_NOSPACE from occuring.
>
> Signed-off-by: Eric Schikschneit <eric.schikschn...@novatechautomation.com>
> ---
>  arch/Kconfig                 | 11 +++++++++++
>  arch/arc/dts/Makefile        |  6 +++++-
>  arch/arm/dts/Makefile        |  4 ++++
>  arch/m68k/dts/Makefile       |  6 +++++-
>  arch/microblaze/dts/Makefile |  6 +++++-
>  arch/nios2/dts/Makefile      |  6 +++++-
>  arch/powerpc/dts/Makefile    |  4 ++++
>  arch/riscv/dts/Makefile      |  6 +++++-
>  arch/sandbox/dts/Makefile    |  6 +++++-
>  arch/x86/dts/Makefile        |  8 +++++++-
>  10 files changed, 56 insertions(+), 7 deletions(-)

I like the concept and the cleanup. However, I think we should:
- Put the line
DTC_FLAGS += -p $(CONFIG_SYS_DTC_PAD_BYTES)
in scripts/Makefile.dts with the rest of the DTC_LOGIC as:
ifneq $(CONFIG_SYS_DTC_PAD_BYTES,0)
DTC_FLAGS += -p $(CONFIG_SYS_DTC_PAD_BYTES)
endif

Then we can:
> diff --git a/arch/Kconfig b/arch/Kconfig
> index ea33d07c086..a85f751d1e6 100644
> --- a/arch/Kconfig
> +++ b/arch/Kconfig
> @@ -63,6 +63,17 @@ config SYS_CACHELINE_SIZE
>        default 64 if RISCV
>        default 32 if MIPS
>
> +config SYS_DTC_PAD
> +     bool "Enable DTC padding"
> +     help
> +       This will allow the final device tree of your specified arch to
> +       have pad space at the end. This enables the ability for the device
> +       tree to be modified in place by board files.

Drop this.

> +config SYS_DTC_PAD_BYTES
> +     int "Size in bytes to pad device tree blob"
> +     default 4096 if SYS_DTC_PAD

And change the defaults to match the existing users, roughly:
        default 32768 if X86 && EFI_APP
        default 4096 if ARC || M68K || MICROBLAZE || NIOS2 || RCAR_64 \
                || RISCV || SANDBOX || (X86 && !EFI_APP)
        default 0

And then we drop the -p lines from all of the other DTC_FLAGS.

Thanks!

--
Tom

Reply via email to