From: Piotr Dymacz Date: Mon, 13 Jan 2014 23:43:15 +0000 (+0100) Subject: Restore go command for all supported devices X-Git-Tag: 2014-11-19~44 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d5cd8136ef3bce467cbee184cbade0a7cde9c5ec;p=oweals%2Fu-boot_mod.git Restore go command for all supported devices --- 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);