summaryrefslogtreecommitdiffstats
path: root/qemu/roms/u-boot/arch/sh/lib/zimageboot.c
diff options
context:
space:
mode:
authorYang Zhang <yang.z.zhang@intel.com>2015-08-28 09:58:54 +0800
committerYang Zhang <yang.z.zhang@intel.com>2015-09-01 12:44:00 +0800
commite44e3482bdb4d0ebde2d8b41830ac2cdb07948fb (patch)
tree66b09f592c55df2878107a468a91d21506104d3f /qemu/roms/u-boot/arch/sh/lib/zimageboot.c
parent9ca8dbcc65cfc63d6f5ef3312a33184e1d726e00 (diff)
Add qemu 2.4.0
Change-Id: Ic99cbad4b61f8b127b7dc74d04576c0bcbaaf4f5 Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>
Diffstat (limited to 'qemu/roms/u-boot/arch/sh/lib/zimageboot.c')
-rw-r--r--qemu/roms/u-boot/arch/sh/lib/zimageboot.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/qemu/roms/u-boot/arch/sh/lib/zimageboot.c b/qemu/roms/u-boot/arch/sh/lib/zimageboot.c
new file mode 100644
index 000000000..86d39983c
--- /dev/null
+++ b/qemu/roms/u-boot/arch/sh/lib/zimageboot.c
@@ -0,0 +1,64 @@
+/*
+ * (C) Copyright 2010
+ * Renesas Solutions Corp.
+ * Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+/*
+ * Linux SuperH zImage loading and boot
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/zimage.h>
+
+int do_sh_zimageboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+ ulong (*zboot_entry)(int, char * const []) = NULL;
+ char *s0, *s1;
+ unsigned char *param = NULL;
+ char *cmdline;
+ char *bootargs;
+
+ disable_interrupts();
+
+ if (argc >= 3) {
+ /* argv[1] holds the address of the zImage */
+ s0 = argv[1];
+ /* argv[2] holds the address of zero page */
+ s1 = argv[2];
+ } else {
+ goto exit;
+ }
+
+ if (s0)
+ zboot_entry = (ulong (*)(int, char * const []))simple_strtoul(s0, NULL, 16);
+
+ /* empty_zero_page */
+ if (s1)
+ param = (unsigned char*)simple_strtoul(s1, NULL, 16);
+
+ /* Linux kernel command line */
+ cmdline = (char *)param + COMMAND_LINE;
+ bootargs = getenv("bootargs");
+
+ /* Clear zero page */
+ memset(param, 0, 0x1000);
+
+ /* Set commandline */
+ strcpy(cmdline, bootargs);
+
+ /* Boot */
+ zboot_entry(0, NULL);
+
+exit:
+ return -1;
+}
+
+U_BOOT_CMD(
+ zimageboot, 3, 0, do_sh_zimageboot,
+ "Boot zImage for Renesas SH",
+ ""
+);