From: Tom Rini <trini@konsulko.com>
To: Eric Schikschneit <eric.schikschneit@novatechautomation.com>
Cc: u-boot@lists.denx.de
Subject: Re: [PATCH] [RFC]: dtc: Add Kconfig option to pad device tree blob
Date: Fri, 16 May 2025 10:28:25 -0600 [thread overview]
Message-ID: <20250516162825.GA2939351@bill-the-cat> (raw)
In-Reply-To: <20250502183826.859174-1-eric.schikschneit@novatechautomation.com>
[-- Attachment #1: Type: text/plain, Size: 2105 bytes --]
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@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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
next prev parent reply other threads:[~2025-05-16 16:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-02 18:38 [PATCH] [RFC]: dtc: Add Kconfig option to pad device tree blob Eric Schikschneit
2025-05-03 2:10 ` Simon Glass
2025-05-05 18:09 ` Tom Rini
2025-05-06 12:49 ` Eric Schikschneit
2025-05-06 13:24 ` Simon Glass
2025-05-06 16:58 ` Tom Rini
2025-05-16 16:28 ` Tom Rini [this message]
2025-05-19 14:58 ` Eric Schikschneit
2025-05-19 15:00 ` Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250516162825.GA2939351@bill-the-cat \
--to=trini@konsulko.com \
--cc=eric.schikschneit@novatechautomation.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.