All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anshul Dalal <anshuld@ti.com>
To: Eric Schikschneit <eric.schikschneit@novatechautomation.com>,
	<u-boot@lists.denx.de>, <trini@konsulko.com>
Subject: Re: [PATCH] dtc: Add Kconfig option to pad device tree blob
Date: Mon, 9 Jun 2025 13:56:26 +0530	[thread overview]
Message-ID: <DAHUYGE5YBJM.2DQMLH5VCAPKX@ti.com> (raw)
In-Reply-To: <20250603170624.93376-1-eric.schikschneit@novatechautomation.com>

On Tue Jun 3, 2025 at 10:36 PM IST, 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                    | 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 ++++-
>  dts/upstream/src/arm64/Makefile | 2 +-
>  dts/upstream/src/riscv/Makefile | 2 +-
>  scripts/Makefile.dts            | 4 ++++
>  13 files changed, 26 insertions(+), 14 deletions(-)
>
> diff --git a/arch/Kconfig b/arch/Kconfig
> index ea33d07c086..bf4c2c80891 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 || ARM64 || M68K || MICROBLAZE || NIOS2 \
> +		|| RISCV || SANDBOX || X86
> +	default 32768 if X86 && EFI_APP
> +	default 0
> +
>  config LINKER_LIST_ALIGN
>  	int
>  	default 32 if SANDBOX
> diff --git a/arch/arc/dts/Makefile b/arch/arc/dts/Makefile
> index fe6ad7b849a..87c627c01c8 100644
> --- a/arch/arc/dts/Makefile
> +++ b/arch/arc/dts/Makefile
> @@ -11,4 +11,4 @@ dtb-$(CONFIG_TARGET_IOT_DEVKIT) +=  iot_devkit.dtb
>  include $(srctree)/scripts/Makefile.dts
>  
>  # Add any required device tree compiler flags here
> -DTC_FLAGS += -R 4 -p 0x1000
> +DTC_FLAGS += -R 4

Thanks for the patch Eric, the changes to padding size look good to me
although I wonder if we should expose the -R flag for configuring the
number of /reserved-memory to user under Kconfig as well.

We have it hardcoded to 4 everywhere now, might be useful to expose it
as CONFIG_SYS_DTC_RSVD or similar for users looking to create compact
DTBs (-R 0) or where more reserved regions need to be added at runtime.

Regards,
Anshul

  reply	other threads:[~2025-06-09  8:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-03 17:06 [PATCH] dtc: Add Kconfig option to pad device tree blob Eric Schikschneit
2025-06-09  8:26 ` Anshul Dalal [this message]
2025-06-09 14:56   ` Tom Rini
2025-06-20 13:58 ` Tom Rini
  -- strict thread matches above, loose matches on Subject: below --
2025-05-20 18:23 Eric Schikschneit
2025-06-02 22:31 ` Tom Rini
2025-06-03 13:57   ` Eric Schikschneit
2025-06-03 16:01     ` 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=DAHUYGE5YBJM.2DQMLH5VCAPKX@ti.com \
    --to=anshuld@ti.com \
    --cc=eric.schikschneit@novatechautomation.com \
    --cc=trini@konsulko.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.