1
2
3
4
5
6
7
8
9
10
11#include <common.h>
12#include <command.h>
13#include <net.h>
14
15#ifdef CONFIG_CMD_GO
16
17
18__attribute__((weak))
19unsigned long do_go_exec(ulong (*entry)(int, char * const []), int argc,
20 char * const argv[])
21{
22 return entry (argc, argv);
23}
24
25static int do_go(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
26{
27 ulong addr, rc;
28 int rcode = 0;
29
30 if (argc < 2)
31 return CMD_RET_USAGE;
32
33 addr = simple_strtoul(argv[1], NULL, 16);
34
35 printf ("## Starting application at 0x%08lX ...\n", addr);
36
37
38
39
40
41 rc = do_go_exec ((void *)addr, argc - 1, argv + 1);
42 if (rc != 0) rcode = 1;
43
44 printf ("## Application terminated, rc = 0x%lX\n", rc);
45 return rcode;
46}
47
48
49
50U_BOOT_CMD(
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"
55);
56
57#endif
58
59U_BOOT_CMD(
60 reset, 1, 0, do_reset,
61 "Perform RESET of the CPU",
62 ""
63);
64
65#ifdef CONFIG_CMD_POWEROFF
66U_BOOT_CMD(
67 poweroff, 1, 0, do_poweroff,
68 "Perform POWEROFF of the device",
69 ""
70);
71#endif
72