From f828bf25fe02f0d7148a9180988ab4d5681b8195 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 20 Apr 2013 08:42:41 +0000 Subject: 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 --- arch/sandbox/cpu/start.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'arch/sandbox/cpu/start.c') diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c index 5287fd5ee..2fcec8b36 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; -- cgit v1.2.3-70-g09d2 From 39042d821ed882d448f1bcd6505df7fb6700b8f0 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 20 Apr 2013 08:42:48 +0000 Subject: sandbox: Allow -c argument to provide a command list This allows passing of entire scripts to sandbox with the -c argument, which is useful for testing. Commands can be delimited with a newline or semicolon. Signed-off-by: Simon Glass --- arch/sandbox/cpu/start.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/sandbox/cpu/start.c') diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c index 2fcec8b36..ae6e16cab 100644 --- a/arch/sandbox/cpu/start.c +++ b/arch/sandbox/cpu/start.c @@ -90,7 +90,7 @@ int sandbox_main_loop_init(void) /* Execute command if required */ if (state->cmd) { - run_command(state->cmd, 0); + run_command_list(state->cmd, -1, 0); os_exit(state->exit_type); } -- cgit v1.2.3-70-g09d2