diff mbox series

[v3,25/29] arm64: ls1046a: Support semihosting fallback

Message ID 20220322205938.1721846-26-sean.anderson@seco.com
State Accepted
Commit 53b953f2ebad6263352cb1247618dc5b965863cc
Delegated to: Tom Rini
Headers show
Series arm: semihosting: Cleanups and new features | expand

Commit Message

Sean Anderson March 22, 2022, 8:59 p.m. UTC
Use the semihosting_enabled function to determine whether or not to
enable semihosting devices. This allows for graceful fallback in the
event a debugger is not attached.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
---

(no changes since v2)

Changes in v2:
- New

 arch/arm/cpu/armv8/fsl-layerscape/spl.c | 3 ++-
 board/freescale/ls1046ardb/ls1046ardb.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

Comments

Tom Rini April 3, 2022, 12:16 a.m. UTC | #1
On Tue, Mar 22, 2022 at 04:59:33PM -0400, Sean Anderson wrote:

> Use the semihosting_enabled function to determine whether or not to
> enable semihosting devices. This allows for graceful fallback in the
> event a debugger is not attached.
> 
> Signed-off-by: Sean Anderson <sean.anderson@seco.com>

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

Patch

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/spl.c b/arch/arm/cpu/armv8/fsl-layerscape/spl.c
index 1a7dde30a5..5f09ef0a4a 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/spl.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/spl.c
@@ -12,6 +12,7 @@ 
 #include <image.h>
 #include <init.h>
 #include <log.h>
+#include <semihosting.h>
 #include <spl.h>
 #include <asm/cache.h>
 #include <asm/global_data.h>
@@ -27,7 +28,7 @@  DECLARE_GLOBAL_DATA_PTR;
 
 u32 spl_boot_device(void)
 {
-	if (IS_ENABLED(CONFIG_SPL_SEMIHOSTING))
+	if (semihosting_enabled())
 		return BOOT_DEVICE_SMH;
 #ifdef CONFIG_SPL_MMC
 	return BOOT_DEVICE_MMC1;
diff --git a/board/freescale/ls1046ardb/ls1046ardb.c b/board/freescale/ls1046ardb/ls1046ardb.c
index 9af7cf763b..f2949cf8b6 100644
--- a/board/freescale/ls1046ardb/ls1046ardb.c
+++ b/board/freescale/ls1046ardb/ls1046ardb.c
@@ -32,7 +32,8 @@  DECLARE_GLOBAL_DATA_PTR;
 struct serial_device *default_serial_console(void)
 {
 #if IS_ENABLED(CONFIG_SEMIHOSTING_SERIAL)
-	return &serial_smh_device;
+	if (semihosting_enabled())
+		return &serial_smh_device;
 #endif
 	return &eserial1_device;
 }