[PATCH] dtc: Add Kconfig option to pad device tree blob
Eric Schikschneit
eric.schikschneit at novatechautomation.com
Tue Jun 3 15:57:14 CEST 2025
Tom,
I think I understand the problems you stated. Obviously, we do not want to cause any regressions,
and I am happy to modify my patch as you suggest. I am unsure what to do about your dts/upstream
Issue though being that portion gets synced from the linux kernel source tree, correct? As far as the
ARM / ARM64 issue I could change the default lines to something similar to:
default 4096 if ARC || ARM64 || M68K.....
default 32768 if X86 && EFI_APP
default 0
That should allow 64-bit ARM platforms to be 4096, but 32-bit ARM platforms to still default to 0.
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: Monday, June 2, 2025 5:31 PM
To: Eric Schikschneit
Cc: u-boot at lists.denx.de
Subject: Re: [PATCH] dtc: Add Kconfig option to pad device tree blob
On Tue, May 20, 2025 at 01:23:05PM -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>
I was testing merging this and I found a few problems, sorry.
> ---
> arch/Kconfig | 7 +++++++
> arch/arc/dts/Makefile | 2 +-
> arch/m68k/dts/Makefile | 2 +-
> arch/microblaze/dts/Makefile | 2 +-
> arch/nios2/dts/Makefile | 2 +-
> arch/riscv/dts/Makefile | 2 +-
> arch/sandbox/dts/Makefile | 2 +-
> arch/x86/dts/Makefile | 2 +-
> doc/board/broadcom/bcm7xxx.rst | 6 ++----
> doc/develop/makefiles.rst | 5 ++++-
> scripts/Makefile.dts | 4 ++++
> 11 files changed, 24 insertions(+), 12 deletions(-)
>
> diff --git a/arch/Kconfig b/arch/Kconfig
> index ea33d07c086..a683af3d591 100644
> --- a/arch/Kconfig
> +++ b/arch/Kconfig
> @@ -63,6 +63,13 @@ config SYS_CACHELINE_SIZE
> default 64 if RISCV
> default 32 if MIPS
>
> +config SYS_DTC_PAD_BYTES
> + int "Size in bytes to pad device tree blob"
> + default 4096 if ARC || ARM || M68K || MICROBLAZE || NIOS2 \
> + || RISCV || SANDBOX || X86
> + default 32768 if X86 && EFI_APP
> + default 0
I believe this is the logic I suggested and so the problem is on me. For
ARM && ARM64, this is right. But for 32bit ARM, we should be 0 and let
individual boards set this as needed (none today but your board does
need it). This leads to size growth and then failure on a few platforms
is how I noticed this.
The second problem is that the Makefiles in dts/upstream are confusingly
not 100% upstream things and so also need to have -p 0x1000 taken out of
them as they'll get the value this way instead.
--
Tom
More information about the U-Boot
mailing list