diff options
author | Sean Anderson <seanga2@gmail.com> | 2023-10-14 16:47:56 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-10-17 20:50:52 -0400 |
commit | a24be84df9d8e31de40de0d2270470e19c784bd4 (patch) | |
tree | 2c5f11e15c0285cef6780592c21609060b80d904 | |
parent | b02c4e941c7fed520f05cc956b9263bc934a9828 (diff) | |
download | u-boot-a24be84df9d8e31de40de0d2270470e19c784bd4.zip u-boot-a24be84df9d8e31de40de0d2270470e19c784bd4.tar.gz u-boot-a24be84df9d8e31de40de0d2270470e19c784bd4.tar.bz2 |
sandbox: Support -T in spl
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>
-rw-r--r-- | arch/sandbox/cpu/start.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c index 2c8a725..2589c2e 100644 --- a/arch/sandbox/cpu/start.c +++ b/arch/sandbox/cpu/start.c @@ -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; |