1
2
3
4
5
6
7
8
9
10
11
12#include <common.h>
13#include <command.h>
14#include <env.h>
15#include <irq_func.h>
16#include <asm/io.h>
17#include <asm/zimage.h>
18
19int do_sh_zimageboot(struct cmd_tbl *cmdtp, int flag, int argc,
20 char *const argv[])
21{
22 ulong (*zboot_entry)(int, char * const []) = NULL;
23 char *s0, *s1;
24 unsigned char *param = NULL;
25 char *cmdline;
26 char *bootargs;
27
28 disable_interrupts();
29
30 if (argc >= 3) {
31
32 s0 = argv[1];
33
34 s1 = argv[2];
35 } else {
36 goto exit;
37 }
38
39 if (s0)
40 zboot_entry = (ulong (*)(int, char * const []))hextoul(s0,
41 NULL);
42
43
44 if (s1)
45 param = (unsigned char *)hextoul(s1, NULL);
46
47
48 cmdline = (char *)param + COMMAND_LINE;
49 bootargs = env_get("bootargs");
50
51
52
53 memset(param, 0, 0x1000);
54
55
56 strcpy(cmdline, bootargs);
57
58
59 zboot_entry(0, NULL);
60
61exit:
62 return -1;
63}
64
65U_BOOT_CMD(
66 zimageboot, 3, 0, do_sh_zimageboot,
67 "Boot zImage for Renesas SH",
68 ""
69);
70