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>
#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>
{
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;