diff mbox series

[1/1] sandbox: move sandbox specifics to booti_setup()

Message ID 20240111080344.112746-1-heinrich.schuchardt@canonical.com
State Accepted
Commit 04fc470cf826cc2fc9a589ce68870b39415f9d12
Delegated to: Tom Rini
Headers show
Series [1/1] sandbox: move sandbox specifics to booti_setup() | expand

Commit Message

Heinrich Schuchardt Jan. 11, 2024, 8:03 a.m. UTC
Instead of checking a configuration setting in booti_start() adjust the
sandbox implementation of booti_setup().

Write a console message when trying to run the booti command on the sandbox
indicating that it is not supported.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
 arch/sandbox/lib/bootm.c | 4 +++-
 cmd/booti.c              | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

Comments

Tom Rini April 12, 2024, 6:51 p.m. UTC | #1
On Thu, Jan 11, 2024 at 09:03:43AM +0100, Heinrich Schuchardt wrote:

> Instead of checking a configuration setting in booti_start() adjust the
> sandbox implementation of booti_setup().
> 
> Write a console message when trying to run the booti command on the sandbox
> indicating that it is not supported.
> 
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/arch/sandbox/lib/bootm.c b/arch/sandbox/lib/bootm.c
index 8dbcd9ff7d..44ba8b52e1 100644
--- a/arch/sandbox/lib/bootm.c
+++ b/arch/sandbox/lib/bootm.c
@@ -85,5 +85,7 @@  int do_bootm_linux(int flag, struct bootm_info *bmi)
 int booti_setup(ulong image, ulong *relocated_addr, ulong *size,
 		bool force_reloc)
 {
-	return 0;
+	log_err("Booting is not supported on the sandbox.\n");
+
+	return 1;
 }
diff --git a/cmd/booti.c b/cmd/booti.c
index 898df0f889..b9637b3ec3 100644
--- a/cmd/booti.c
+++ b/cmd/booti.c
@@ -74,7 +74,7 @@  static int booti_start(struct bootm_info *bmi)
 	unmap_sysmem((void *)ld);
 
 	ret = booti_setup(ld, &relocated_addr, &image_size, false);
-	if (ret || IS_ENABLED(CONFIG_SANDBOX))
+	if (ret)
 		return 1;
 
 	/* Handle BOOTM_STATE_LOADOS */