arm64: ls1046a: Support semihosting fallback
authorSean Anderson <sean.anderson@seco.com>
Tue, 22 Mar 2022 20:59:33 +0000 (16:59 -0400)
committerTom Rini <trini@konsulko.com>
Fri, 1 Apr 2022 20:56:54 +0000 (16:56 -0400)
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>
arch/arm/cpu/armv8/fsl-layerscape/spl.c
board/freescale/ls1046ardb/ls1046ardb.c

index 1a7dde3..5f09ef0 100644 (file)
@@ -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;
index 9af7cf7..f2949cf 100644 (file)
@@ -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;
 }