]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
sunxi: avoid double vendor prefix when CONFIG_OF_UPSTREAM is enabled
authorBohdan Chubuk <chbgdn@gmail.com>
Sun, 23 Nov 2025 20:43:46 +0000 (22:43 +0200)
committerAndre Przywara <andre.przywara@arm.com>
Sun, 25 Jan 2026 23:29:32 +0000 (23:29 +0000)
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>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
board/sunxi/board.c

index 2929bc17f0841d3ab5ff17e3d8b664d1f7ae4a3d..e9e3fb9a571ae52958682352006fb600a8c29668 100644 (file)
@@ -834,9 +834,12 @@ 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 = "";
                char str[64];
 
+               if (IS_ENABLED(CONFIG_ARM64) && !IS_ENABLED(CONFIG_OF_UPSTREAM))
+                       prefix = "allwinner/";
+
                snprintf(str, sizeof(str), "%s%s.dtb", prefix, spl_dt_name);
                env_set("fdtfile", str);
        }