cli: Make the sandbox board_run_command the default
authorSean Anderson <seanga2@gmail.com>
Fri, 10 Jan 2020 17:32:19 +0000 (12:32 -0500)
committerSimon Glass <sjg@chromium.org>
Thu, 6 Feb 2020 02:33:46 +0000 (19:33 -0700)
If CONFIG_CMDLINE=n, common/cli.c calls board_run_command. This fails to
link on most architectures. However, the sandbox architecture has an
implementation which we can use.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
arch/sandbox/cpu/start.c
common/cli.c

index fff9cbdd79dbb2b5399a898ed2d6a0a091353002..5b7d54869d9510a0dfc98f30f38178d6a59ac1d6 100644 (file)
@@ -319,13 +319,6 @@ static int sandbox_cmdline_cb_show_of_platdata(struct sandbox_state *state,
 }
 SANDBOX_CMDLINE_OPT(show_of_platdata, 0, "Show of-platdata in SPL");
 
-int board_run_command(const char *cmdline)
-{
-       printf("## Commands are disabled. Please enable CONFIG_CMDLINE.\n");
-
-       return 1;
-}
-
 static void setup_ram_buf(struct sandbox_state *state)
 {
        /* Zero the RAM buffer if we didn't read it, to keep valgrind happy */
index 7ffe902b88dd13c06d67035a3eac91047a9aeee5..38bba17585ca5a56970ad61317d12408833cd657 100644 (file)
@@ -71,6 +71,13 @@ int run_command_repeatable(const char *cmd, int flag)
        return 0;
 #endif
 }
+#else
+__weak int board_run_command(const char *cmdline)
+{
+       printf("## Commands are disabled. Please enable CONFIG_CMDLINE.\n");
+
+       return 1;
+}
 #endif /* CONFIG_CMDLINE */
 
 int run_command_list(const char *cmd, int len, int flag)