summaryrefslogtreecommitdiff
path: root/arch/sandbox/lib
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2015-04-13 22:54:20 +0200
committerSimon Glass <sjg@chromium.org>2015-04-19 14:45:57 -0600
commitdd2d29a1e1edb37fbaf2905ec6c1db50f6e661c0 (patch)
tree51c9f390847f379c13e7b6c5ca794aac08903ec7 /arch/sandbox/lib
parent85300a9a9dfb364ab1a5f94e6d3f9e558a193be1 (diff)
downloadu-boot-dd2d29a1e1edb37fbaf2905ec6c1db50f6e661c0.tar.gz
sandbox: Split bootm code out into lib/bootm
Follow the convention of other architectures and move the platform specific linux bootm code into sandbox/lib/bootm.c. Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/sandbox/lib')
-rw-r--r--arch/sandbox/lib/Makefile1
-rw-r--r--arch/sandbox/lib/bootm.c21
2 files changed, 22 insertions, 0 deletions
diff --git a/arch/sandbox/lib/Makefile b/arch/sandbox/lib/Makefile
index 75b135cfc0..96761e27f7 100644
--- a/arch/sandbox/lib/Makefile
+++ b/arch/sandbox/lib/Makefile
@@ -9,3 +9,4 @@
obj-y += interrupts.o
obj-$(CONFIG_PCI) += pci_io.o
+obj-$(CONFIG_CMD_BOOTM) += bootm.o
diff --git a/arch/sandbox/lib/bootm.c b/arch/sandbox/lib/bootm.c
new file mode 100644
index 0000000000..8ddf4ef30d
--- /dev/null
+++ b/arch/sandbox/lib/bootm.c
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2011 The Chromium OS Authors.
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
+{
+ if (flag & (BOOTM_STATE_OS_GO | BOOTM_STATE_OS_FAKE_GO)) {
+ bootstage_mark(BOOTSTAGE_ID_RUN_OS);
+ printf("## Transferring control to Linux (at address %08lx)...\n",
+ images->ep);
+ reset_cpu(0);
+ }
+
+ return 0;
+}