1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2000-2003
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
16 /* Allow ports to override the default behavior */
18 unsigned long do_go_exec(ulong (*entry)(int, char * const []), int argc,
21 return entry (argc, argv);
24 static int do_go(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
32 addr = simple_strtoul(argv[1], NULL, 16);
34 printf ("## Starting application at 0x%08lX ...\n", addr);
37 * pass address parameter as argv[0] (aka command name),
38 * and all remaining args
40 rc = do_go_exec ((void *)addr, argc - 1, argv + 1);
41 if (rc != 0) rcode = 1;
43 printf ("## Application terminated, rc = 0x%lX\n", rc);
47 /* -------------------------------------------------------------------- */
50 go, CONFIG_SYS_MAXARGS, 1, do_go,
51 "start application at address 'addr'",
52 "addr [arg ...]\n - start application at address 'addr'\n"
53 " passing 'arg' as arguments"
59 reset, 1, 0, do_reset,
60 "Perform RESET of the CPU",
64 #ifdef CONFIG_CMD_POWEROFF
66 poweroff, 1, 0, do_poweroff,
67 "Perform POWEROFF of the device",