board: sama5d3_xplained: Fix SPL DTB read from NAND
[oweals/u-boot.git] / lib / hang.c
index 8db268ef95f0f7021b1d10deb7fcf4687dc710ef..578ac78d45306f949d9ee237c27b17e164c5d317 100644 (file)
@@ -1,15 +1,16 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2013
- * Andreas Bießmann <andreas.devel@googlemail.com>
+ * Andreas Bießmann <andreas@biessmann.org>
  *
  * This file consolidates all the different hang() functions implemented in
  * u-boot.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 #include <bootstage.h>
+#include <hang.h>
+#include <os.h>
 
 /**
  * hang - stop processing by staying in an endless loop
  */
 void hang(void)
 {
-#if !defined(CONFIG_SPL_BUILD) || (defined(CONFIG_SPL_LIBCOMMON_SUPPORT) && \
-               defined(CONFIG_SPL_SERIAL_SUPPORT))
+#if !defined(CONFIG_SPL_BUILD) || \
+               (CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT) && \
+                CONFIG_IS_ENABLED(SERIAL_SUPPORT))
        puts("### ERROR ### Please RESET the board ###\n");
 #endif
        bootstage_error(BOOTSTAGE_ID_NEED_RESET);
+       if (IS_ENABLED(CONFIG_SANDBOX))
+               os_exit(1);
        for (;;)
                ;
 }