[U-Boot] [PATCH v3 2/8] sandbox: Split bootm code out into lib/bootm

Sjoerd Simons sjoerd.simons at collabora.co.uk
Sun Apr 12 23:04:43 CEST 2015


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 at collabora.co.uk>
Acked-by: Simon Glass <sjg at chromium.org>
---

Changes in v3: None
Changes in v2: None

 arch/sandbox/cpu/cpu.c    | 12 ------------
 arch/sandbox/lib/Makefile |  1 +
 arch/sandbox/lib/bootm.c  | 21 +++++++++++++++++++++
 3 files changed, 22 insertions(+), 12 deletions(-)
 create mode 100644 arch/sandbox/lib/bootm.c

diff --git a/arch/sandbox/cpu/cpu.c b/arch/sandbox/cpu/cpu.c
index 1aa397c..a0c8106 100644
--- a/arch/sandbox/cpu/cpu.c
+++ b/arch/sandbox/cpu/cpu.c
@@ -40,18 +40,6 @@ unsigned long __attribute__((no_instrument_function)) timer_get_us(void)
 	return os_get_nsec() / 1000;
 }
 
-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;
-}
-
 int cleanup_before_linux(void)
 {
 	return 0;
diff --git a/arch/sandbox/lib/Makefile b/arch/sandbox/lib/Makefile
index 4c1a38d..3c86cc2 100644
--- a/arch/sandbox/lib/Makefile
+++ b/arch/sandbox/lib/Makefile
@@ -9,3 +9,4 @@
 
 
 obj-y	+= interrupts.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 0000000..8ddf4ef
--- /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;
+}
-- 
2.1.4



More information about the U-Boot mailing list