[U-Boot] [PATCH 13/17] board_f: sandbox: Move sandbox_early_getopt_check() into misc_init_f()

Simon Glass sjg at chromium.org
Tue Mar 28 16:27:28 UTC 2017


We don't need a special hook for sandbox as one of the later ones will do
just as well. We can print error messages about bad options after we
print the banner. In fact, it seems better.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 arch/sandbox/cpu/start.c  | 5 +++++
 common/board_f.c          | 3 ---
 include/configs/sandbox.h | 2 ++
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
index dc58fef90c..f605d4d61e 100644
--- a/arch/sandbox/cpu/start.c
+++ b/arch/sandbox/cpu/start.c
@@ -66,6 +66,11 @@ int sandbox_early_getopt_check(void)
 	os_exit(0);
 }
 
+int misc_init_f(void)
+{
+	return sandbox_early_getopt_check();
+}
+
 static int sandbox_cmdline_cb_help(struct sandbox_state *state, const char *arg)
 {
 	/* just flag to sandbox_early_getopt_check to show usage */
diff --git a/common/board_f.c b/common/board_f.c
index 74cdef0ddb..9d17ae0100 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -855,9 +855,6 @@ static const init_fnc_t init_sequence_f[] = {
 	init_baud_rate,		/* initialze baudrate settings */
 	serial_init,		/* serial communications setup */
 	console_init_f,		/* stage 1 init of console */
-#ifdef CONFIG_SANDBOX
-	sandbox_early_getopt_check,
-#endif
 	display_options,	/* say that we are here */
 	display_text_info,	/* show debugging info if required */
 #if defined(CONFIG_MPC8260)
diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index 6b3cd18046..7de8765dc8 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -199,4 +199,6 @@
 #define CONFIG_SYS_SYSTEMACE_WIDTH	16
 #define CONFIG_SYS_SYSTEMACE_BASE	0
 
+#define CONFIG_MISC_INIT_F
+
 #endif
-- 
2.12.2.564.g063fe858b8-goog



More information about the U-Boot mailing list