]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
sandbox: Support -T in spl
authorSean Anderson <seanga2@gmail.com>
Sat, 14 Oct 2023 20:47:56 +0000 (16:47 -0400)
committerTom Rini <trini@konsulko.com>
Wed, 18 Oct 2023 00:50:52 +0000 (20:50 -0400)
The test devicetree is only compiled for U-Boot proper. When accessing it in
SPL we need to go up one directory.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
arch/sandbox/cpu/start.c

index 2c8a72590b551e8ee60fc1c72a4a81532b916038..2589c2eba73875809382480f988a9076a013245b 100644 (file)
@@ -13,6 +13,7 @@
 #include <log.h>
 #include <os.h>
 #include <sort.h>
+#include <spl.h>
 #include <asm/getopt.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
@@ -202,10 +203,14 @@ static int sandbox_cmdline_cb_test_fdt(struct sandbox_state *state,
 {
        char buf[256];
        char *fname;
+       char *relname;
        int len;
 
-       len = state_get_rel_filename("arch/sandbox/dts/test.dtb", buf,
-                                    sizeof(buf));
+       if (spl_phase() <= PHASE_SPL)
+               relname = "../arch/sandbox/dts/test.dtb";
+       else
+               relname = "arch/sandbox/dts/test.dtb";
+       len = state_get_rel_filename(relname, buf, sizeof(buf));
        if (len < 0)
                return len;