From d5cd8136ef3bce467cbee184cbade0a7cde9c5ec Mon Sep 17 00:00:00 2001 From: Piotr Dymacz Date: Tue, 14 Jan 2014 00:43:15 +0100 Subject: [PATCH] Restore go command for all supported devices --- u-boot/common/cmd_boot.c | 43 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/u-boot/common/cmd_boot.c b/u-boot/common/cmd_boot.c index ff1e64a..e2937e1 100755 --- a/u-boot/common/cmd_boot.c +++ b/u-boot/common/cmd_boot.c @@ -32,6 +32,47 @@ DECLARE_GLOBAL_DATA_PTR; #endif +int do_go(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){ + ulong addr, rc; + int rcode = 0; + + if(argc < 2){ +#ifdef CFG_LONGHELP + if(cmdtp->help != NULL){ + printf("Usage:\n%s %s\n", cmdtp->name, cmdtp->help); + } else { + printf("Usage:\n%s %s\n", cmdtp->name, cmdtp->usage); + } +#else + printf("Usage:\n%s %s\n", cmdtp->name, cmdtp->usage); +#endif + return(1); + } + + addr = simple_strtoul(argv[1], NULL, 16); + + printf("## Starting application at 0x%08lX...\n", addr); + + /* + * Pass address parameter as argv[0] (aka command name), + * and all remaining args + */ + rc = ((ulong (*)(int, char *[]))addr)(--argc, &argv[1]); + + if(rc != 0){ + rcode = 1; + } + + printf("## Application terminated, rc = 0x%lX\n", rc); + + return(rcode); +} + +U_BOOT_CMD(go, CFG_MAXARGS, 1, do_go, "start application at address 'addr'\n", + "addr [arg ...]\n" + "\t- start application at address 'addr'\n" + "\t passing 'arg' as arguments\n"); + extern int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); -U_BOOT_CMD(reset, 1, 0, do_reset, "perform RESET of the CPU\n", NULL); +U_BOOT_CMD(reset, 1, 0, do_reset, "perform RESET of the CPU\n", NULL); -- 2.25.1