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