summaryrefslogtreecommitdiff
path: root/arch/sandbox
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2013-04-20 08:42:41 +0000
committerTom Rini <trini@ti.com>2013-05-01 11:17:21 -0400
commitf828bf25fe02f0d7148a9180988ab4d5681b8195 (patch)
tree99c43aaf2246ec97b15ebb2f0603bfd7d2474d08 /arch/sandbox
parenta733b06b69d2cb058c4363952bc0793b1f514305 (diff)
downloadu-boot-imx-f828bf25fe02f0d7148a9180988ab4d5681b8195.zip
u-boot-imx-f828bf25fe02f0d7148a9180988ab4d5681b8195.tar.gz
u-boot-imx-f828bf25fe02f0d7148a9180988ab4d5681b8195.tar.bz2
sandbox: Add CONFIG_OF_HOSTFILE to read FDT from host file
With sandbox it is tricky to add an FDT to the image at build time (or later) since we build an ELF file, not a plain binary, and the address space of the whole U-Boot is not accessible in the emulated memory map of sandbox. Sandbox can read files directly from the host, though, so add an option to read an FDT from a host file on start-up. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/sandbox')
-rw-r--r--arch/sandbox/cpu/start.c7
-rw-r--r--arch/sandbox/include/asm/state.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
index 5287fd5..2fcec8b 100644
--- a/arch/sandbox/cpu/start.c
+++ b/arch/sandbox/cpu/start.c
@@ -104,6 +104,13 @@ static int sb_cmdline_cb_command(struct sandbox_state *state, const char *arg)
}
SB_CMDLINE_OPT_SHORT(command, 'c', 1, "Execute U-Boot command");
+static int sb_cmdline_cb_fdt(struct sandbox_state *state, const char *arg)
+{
+ state->fdt_fname = arg;
+ return 0;
+}
+SB_CMDLINE_OPT_SHORT(fdt, 'd', 1, "Specify U-Boot's control FDT");
+
int main(int argc, char *argv[])
{
struct sandbox_state *state;
diff --git a/arch/sandbox/include/asm/state.h b/arch/sandbox/include/asm/state.h
index 2b62b46..9552708 100644
--- a/arch/sandbox/include/asm/state.h
+++ b/arch/sandbox/include/asm/state.h
@@ -34,6 +34,7 @@ enum exit_type_id {
/* The complete state of the test system */
struct sandbox_state {
const char *cmd; /* Command to execute */
+ const char *fdt_fname; /* Filename of FDT binary */
enum exit_type_id exit_type; /* How we exited U-Boot */
const char *parse_err; /* Error to report from parsing */
int argc; /* Program arguments */