public inbox for devicetree-compiler@vger.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
Cc: devicetree-compiler@vger.kernel.org
Subject: Re: [PATCH 2/6] Set DTSF_PLUGIN if needed when compiling from dtb
Date: Thu, 21 Aug 2025 14:24:35 +1000	[thread overview]
Message-ID: <aKafg3Y4fzQ210JY@zatzit> (raw)
In-Reply-To: <03075deef27a7474914093282be9bb4e27dbce81.1755692822.git.u.kleine-koenig@baylibre.com>

[-- Attachment #1: Type: text/plain, Size: 1541 bytes --]

On Wed, Aug 20, 2025 at 03:11:28PM +0200, Uwe Kleine-König wrote:
> The need for the plugin flag is determined by the existence of __fixups__
> or __local_fixups__.
> 
> This is a bit simplifying because if __fixups__ or __local_fixups__
> exist but don't have properties, the plugin flag isn't needed. But in
> practise the test should be good enough such that this corner case
> doesn't matter.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>


> ---
>  flattree.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/flattree.c b/flattree.c
> index 30e6de2044b2..f3b698c17e89 100644
> --- a/flattree.c
> +++ b/flattree.c
> @@ -807,6 +807,7 @@ struct dt_info *dt_from_blob(const char *fname)
>  	struct node *tree;
>  	uint32_t val;
>  	int flags = 0;
> +	unsigned int dtsflags = DTSF_V1;
>  
>  	f = srcfile_relative_open(fname, NULL);
>  
> @@ -919,5 +920,8 @@ struct dt_info *dt_from_blob(const char *fname)
>  
>  	fclose(f);
>  
> -	return build_dt_info(DTSF_V1, reservelist, tree, boot_cpuid_phys);
> +	if (get_subnode(tree, "__fixups__") || get_subnode(tree, "__local_fixups__"))
> +		dtsflags |= DTSF_PLUGIN;
> +
> +	return build_dt_info(dtsflags, reservelist, tree, boot_cpuid_phys);
>  }

-- 
David Gibson (he or they)	| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you, not the other way
				| around.
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2025-08-21  4:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-20 13:11 [PATCH 0/6] Restore phandles from binary representations Uwe Kleine-König
2025-08-20 13:11 ` [PATCH 1/6] Emit /plugin/ when compiling to .dts with DTSF_PLUGIN set Uwe Kleine-König
2025-08-21  4:24   ` David Gibson
2025-08-20 13:11 ` [PATCH 2/6] Set DTSF_PLUGIN if needed when compiling from dtb Uwe Kleine-König
2025-08-21  4:24   ` David Gibson [this message]
2025-08-20 13:11 ` [PATCH 3/6] Improve type guessing when compiling to dts format Uwe Kleine-König
2025-08-21  4:24   ` David Gibson
2025-08-20 13:11 ` [PATCH 4/6] Restore labels from __symbols__ node Uwe Kleine-König
2025-08-21  4:25   ` David Gibson
2025-08-20 13:11 ` [PATCH 5/6] Restore phandle references from __local_fixups__ node Uwe Kleine-König
2025-08-21  4:23   ` David Gibson
2025-08-20 13:11 ` [PATCH 6/6] Restore phandle references from __fixups__ node Uwe Kleine-König
2025-08-21  4:31   ` David Gibson

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=aKafg3Y4fzQ210JY@zatzit \
    --to=david@gibson.dropbear.id.au \
    --cc=devicetree-compiler@vger.kernel.org \
    --cc=u.kleine-koenig@baylibre.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox