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);