[PATCH] [RFC]: dtc: Add Kconfig option to pad device tree blob
Tom Rini
trini at konsulko.com
Fri May 16 18:28:25 CEST 2025
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.schikschneit at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20250516/0bc0565c/attachment.sig>
More information about the U-Boot
mailing list