diff options
author | Tom Rini <trini@ti.com> | 2015-01-31 12:40:48 -0500 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2015-01-31 12:40:48 -0500 |
commit | 358b8bc204f365be28fed94f23e53e04183a8c7f (patch) | |
tree | cbfbd51db0081424ad7f09c2fb47571c615bc35f /arch/sandbox/cpu/start.c | |
parent | 6a608f20b987122a658e26978d76d2753654f5f2 (diff) | |
parent | 3d4de98696d2d906c968008219bb9a65960e7c10 (diff) |
Merge branch 'patman' of git://git.denx.de/u-boot-x86
Diffstat (limited to 'arch/sandbox/cpu/start.c')
-rw-r--r-- | arch/sandbox/cpu/start.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c index 42353d80a84..097f29a2901 100644 --- a/arch/sandbox/cpu/start.c +++ b/arch/sandbox/cpu/start.c @@ -6,6 +6,7 @@ #include <common.h> #include <os.h> #include <cli.h> +#include <malloc.h> #include <asm/getopt.h> #include <asm/io.h> #include <asm/sections.h> @@ -102,6 +103,25 @@ static int sandbox_cmdline_cb_fdt(struct sandbox_state *state, const char *arg) } SANDBOX_CMDLINE_OPT_SHORT(fdt, 'd', 1, "Specify U-Boot's control FDT"); +static int sandbox_cmdline_cb_default_fdt(struct sandbox_state *state, + const char *arg) +{ + const char *fmt = "%s.dtb"; + char *fname; + int len; + + len = strlen(state->argv[0]) + strlen(fmt) + 1; + fname = os_malloc(len); + if (!fname) + return -ENOMEM; + snprintf(fname, len, fmt, state->argv[0]); + state->fdt_fname = fname; + + return 0; +} +SANDBOX_CMDLINE_OPT_SHORT(default_fdt, 'D', 0, + "Use the default u-boot.dtb control FDT in U-Boot directory"); + static int sandbox_cmdline_cb_interactive(struct sandbox_state *state, const char *arg) { |