Blame view
cmd/boot.c
1.39 KB
fe8c2806c Initial revision |
1 |
/* |
8bde7f776 * Code cleanup: |
2 |
* (C) Copyright 2000-2003 |
fe8c2806c Initial revision |
3 4 |
* Wolfgang Denk, DENX Software Engineering, wd@denx.de. * |
1a4596601 Add GPL-2.0+ SPDX... |
5 |
* SPDX-License-Identifier: GPL-2.0+ |
fe8c2806c Initial revision |
6 7 8 |
*/ /* |
8bde7f776 * Code cleanup: |
9 |
* Misc boot support |
fe8c2806c Initial revision |
10 11 12 |
*/ #include <common.h> #include <command.h> |
fe8c2806c Initial revision |
13 |
#include <net.h> |
fe8c2806c Initial revision |
14 |
|
a641b9794 make `go` optional |
15 |
#ifdef CONFIG_CMD_GO |
a49864593 allow ports to ov... |
16 17 |
/* Allow ports to override the default behavior */ __attribute__((weak)) |
088f1b199 common/cmd_*.c: s... |
18 19 |
unsigned long do_go_exec(ulong (*entry)(int, char * const []), int argc, char * const argv[]) |
1f1d88dd4 disable caches be... |
20 |
{ |
a49864593 allow ports to ov... |
21 |
return entry (argc, argv); |
1f1d88dd4 disable caches be... |
22 |
} |
088f1b199 common/cmd_*.c: s... |
23 |
static int do_go(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
fe8c2806c Initial revision |
24 25 26 |
{ ulong addr, rc; int rcode = 0; |
47e26b1bf cmd_usage(): simp... |
27 |
if (argc < 2) |
4c12eeb8b Convert cmd_usage... |
28 |
return CMD_RET_USAGE; |
fe8c2806c Initial revision |
29 30 |
addr = simple_strtoul(argv[1], NULL, 16); |
dc7c9a1a5 * Patch by Rick B... |
31 32 |
printf ("## Starting application at 0x%08lX ... ", addr); |
fe8c2806c Initial revision |
33 |
|
4a5517094 * Patch by Scott ... |
34 |
/* |
1f1d88dd4 disable caches be... |
35 36 |
* pass address parameter as argv[0] (aka command name), * and all remaining args |
4a5517094 * Patch by Scott ... |
37 |
*/ |
a49864593 allow ports to ov... |
38 |
rc = do_go_exec ((void *)addr, argc - 1, argv + 1); |
fe8c2806c Initial revision |
39 |
if (rc != 0) rcode = 1; |
dc7c9a1a5 * Patch by Rick B... |
40 41 |
printf ("## Application terminated, rc = 0x%lX ", rc); |
fe8c2806c Initial revision |
42 43 |
return rcode; } |
8bde7f776 * Code cleanup: |
44 |
/* -------------------------------------------------------------------- */ |
fe8c2806c Initial revision |
45 |
|
0d4983930 Patch by Kenneth ... |
46 |
U_BOOT_CMD( |
6d0f6bcf3 rename CFG_ macro... |
47 |
go, CONFIG_SYS_MAXARGS, 1, do_go, |
2fb2604d5 Command usage cle... |
48 |
"start application at address 'addr'", |
8bde7f776 * Code cleanup: |
49 50 51 |
"addr [arg ...] - start application at address 'addr' " |
a89c33db9 General help mess... |
52 |
" passing 'arg' as arguments" |
8bde7f776 * Code cleanup: |
53 |
); |
fe8c2806c Initial revision |
54 |
|
a641b9794 make `go` optional |
55 |
#endif |
0d4983930 Patch by Kenneth ... |
56 |
U_BOOT_CMD( |
0bba54528 Undo commit 3033e... |
57 |
reset, 1, 0, do_reset, |
2fb2604d5 Command usage cle... |
58 |
"Perform RESET of the CPU", |
a89c33db9 General help mess... |
59 |
"" |
8bde7f776 * Code cleanup: |
60 |
); |
4e42e29fd cmd_boot: Add a p... |
61 62 63 64 65 66 67 68 |
#ifdef CONFIG_CMD_POWEROFF U_BOOT_CMD( poweroff, 1, 0, do_poweroff, "Perform POWEROFF of the device", "" ); #endif |