Skip to contentSkip to conversation

Make the sandbox board_run_command the default

PATCH New Sean Anderson 4 participants 6 messages Dec 18, 2019 – Feb 5, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make the sandbox board_run_command the default

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.

---
 arch/sandbox/cpu/start.c | 7 -------
 common/cli.c             | 7 +++++++
 2 files changed, 7 insertions(+), 7 deletions(-)
arch/sandbox/cpu/start.c +0 -0
index fff9cbdd79..5b7d54869d 100644
@@ -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 */

common/cli.c +7 -0
index 67ceb635a6..59551ef40b 100644
@@ -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)
Signature · 1 line
2.23.0
#1 lore raw

PATCH 1/1 Make the sandbox board_run_command the default

Hi Sean,

Quoted 10 lines · Sean Anderson

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.

---
 arch/sandbox/cpu/start.c | 7 -------
 common/cli.c             | 7 +++++++
 2 files changed, 7 insertions(+), 7 deletions(-)

Somehow this patch is showing as corrupted. Did you create it with patman?

Regards,
Simon

#2 lore raw

PATCH 1/1 Make the sandbox board_run_command the default

Quoted 1 line

Somehow this patch is showing as corrupted. Did you create it with patman?

I created it with git format-patch. Perhaps it got mangled by my email client.

#3 lore raw

PATCH v2 1/1 cli: Make the sandbox board_run_command the default

In reply to Simon Glass

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.

---
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(-)
arch/sandbox/cpu/start.c +0 -7
index fff9cbdd79..5b7d54869d 100644
@@ -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 */
common/cli.c +7 -0
index 67ceb635a6..59551ef40b 100644
@@ -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)
Signature · 1 line
2.24.1
#4 lore raw

PATCH v2 1/1 cli: Make the sandbox board_run_command the default

Quoted 6 lines · Sean Anderson

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.

Quoted 9 lines

---
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(-)
#5 lore raw

PATCH v2 1/1 cli: Make the sandbox board_run_command the default

Quoted 6 lines · Sean Anderson

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.

Quoted 9 lines

---
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(-)

Applied to u-boot-dm, thanks!