From patchwork Fri Jan 10 17:32:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 239434 List-Id: U-Boot discussion From: seanga2 at gmail.com (Sean Anderson) Date: Fri, 10 Jan 2020 12:32:19 -0500 Subject: [PATCH v2] cli: Make the sandbox board_run_command the default In-Reply-To: References: Message-ID: <1f9a7ed5-dee6-e9de-3419-a8f50b0cf789@gmail.com> 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 --- Changes for v2: - Sent without any word wrap afaik - Rebased onto v2020.01 arch/sandbox/cpu/start.c | 7 ------- common/cli.c | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c index fff9cbdd79..5b7d54869d 100644 --- a/arch/sandbox/cpu/start.c +++ b/arch/sandbox/cpu/start.c @@ -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 */ diff --git a/common/cli.c b/common/cli.c index 67ceb635a6..59551ef40b 100644 --- a/common/cli.c +++ b/common/cli.c @@ -70,6 +70,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)