public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] sunxi: avoid double vendor prefix when CONFIG_OF_UPSTREAM is enabled
@ 2025-11-23 20:43 Bohdan Chubuk
  2026-01-19 23:09 ` Andre Przywara
  0 siblings, 1 reply; 2+ messages in thread
From: Bohdan Chubuk @ 2025-11-23 20:43 UTC (permalink / raw)
  To: Andre Przywara, Jagan Teki
  Cc: Hans de Goede, Jernej Skrabec, u-boot, Bohdan Chubuk

When CONFIG_OF_UPSTREAM is enabled, the device tree name provided by SPL
already includes the vendor directory (e.g., "allwinner/board-name").

The existing logic in misc_init_r() unconditionally prepends "allwinner/"
for ARM64 builds, resulting in an incorrect path like
"allwinner/allwinner/board-name.dtb".

This patch modifies the logic to only prepend the vendor prefix if
CONFIG_OF_UPSTREAM is NOT enabled. This ensures compatibility with both
legacy builds and the new upstream devicetree structure.

Signed-off-by: Bohdan Chubuk <chbgdn@gmail.com>
---
 board/sunxi/board.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 2929bc17f08..c68b51d370d 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -834,7 +834,10 @@ int misc_init_r(void)
 	/* Set fdtfile to match the FIT configuration chosen in SPL. */
 	spl_dt_name = get_spl_dt_name();
 	if (spl_dt_name) {
-		char *prefix = IS_ENABLED(CONFIG_ARM64) ? "allwinner/" : "";
+		const char *prefix = "";
+
+		if (IS_ENABLED(CONFIG_ARM64) && !IS_ENABLED(CONFIG_OF_UPSTREAM))
+			prefix = "allwinner/";
 		char str[64];
 
 		snprintf(str, sizeof(str), "%s%s.dtb", prefix, spl_dt_name);
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] sunxi: avoid double vendor prefix when CONFIG_OF_UPSTREAM is enabled
  2025-11-23 20:43 [PATCH] sunxi: avoid double vendor prefix when CONFIG_OF_UPSTREAM is enabled Bohdan Chubuk
@ 2026-01-19 23:09 ` Andre Przywara
  0 siblings, 0 replies; 2+ messages in thread
From: Andre Przywara @ 2026-01-19 23:09 UTC (permalink / raw)
  To: Bohdan Chubuk; +Cc: Jagan Teki, Hans de Goede, Jernej Skrabec, u-boot

On Sun, 23 Nov 2025 22:43:46 +0200
Bohdan Chubuk <chbgdn@gmail.com> wrote:

Hi Bohdan,

thanks for the patch!

> When CONFIG_OF_UPSTREAM is enabled, the device tree name provided by SPL
> already includes the vendor directory (e.g., "allwinner/board-name").
> 
> The existing logic in misc_init_r() unconditionally prepends "allwinner/"
> for ARM64 builds, resulting in an incorrect path like
> "allwinner/allwinner/board-name.dtb".
> 
> This patch modifies the logic to only prepend the vendor prefix if
> CONFIG_OF_UPSTREAM is NOT enabled. This ensures compatibility with both
> legacy builds and the new upstream devicetree structure.

Weird, I thought we already fixed that.
Anyway, looks good to me, will take it. Just fixing up the one nit
below.

> 
> Signed-off-by: Bohdan Chubuk <chbgdn@gmail.com>
> ---
>  board/sunxi/board.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/board/sunxi/board.c b/board/sunxi/board.c
> index 2929bc17f08..c68b51d370d 100644
> --- a/board/sunxi/board.c
> +++ b/board/sunxi/board.c
> @@ -834,7 +834,10 @@ int misc_init_r(void)
>  	/* Set fdtfile to match the FIT configuration chosen in SPL. */
>  	spl_dt_name = get_spl_dt_name();
>  	if (spl_dt_name) {
> -		char *prefix = IS_ENABLED(CONFIG_ARM64) ? "allwinner/" : "";
> +		const char *prefix = "";
> +
> +		if (IS_ENABLED(CONFIG_ARM64) && !IS_ENABLED(CONFIG_OF_UPSTREAM))
> +			prefix = "allwinner/";
>  		char str[64];

We should keep variable declarations together, so moving this.
Will fix this while committing.

Cheers,
Andre

>  
>  		snprintf(str, sizeof(str), "%s%s.dtb", prefix, spl_dt_name);


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-01-19 23:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-23 20:43 [PATCH] sunxi: avoid double vendor prefix when CONFIG_OF_UPSTREAM is enabled Bohdan Chubuk
2026-01-19 23:09 ` Andre Przywara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox