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 = hextoul(argv[1], NULL);
34 printf ("## Starting application at 0x%08lX ...\n", addr);
38 * pass address parameter as argv[0] (aka command name),
39 * and all remaining args
41 rc = do_go_exec ((void *)addr, argc - 1, argv + 1);
42 if (rc != 0) rcode = 1;
44 printf ("## Application terminated, rc = 0x%lX\n", rc);
48 /* -------------------------------------------------------------------- */
51 go, CONFIG_SYS_MAXARGS, 1, do_go,
52 "start application at address 'addr'",
53 "addr [arg ...]\n - start application at address 'addr'\n"
54 " passing 'arg' as arguments"
60 reset, 2, 0, do_reset,
61 "Perform RESET of the CPU",
62 "- cold boot without level specifier\n"
63 "reset -w - warm reset if implemented"
66 #ifdef CONFIG_CMD_POWEROFF
68 poweroff, 1, 0, do_poweroff,
69 "Perform POWEROFF of the device",