Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Andreas Bießmann | d7a886b | 2013-04-18 22:48:50 +0000 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2013 |
Andreas Bießmann | 07dafdb | 2016-05-01 03:46:16 +0200 | [diff] [blame] | 4 | * Andreas Bießmann <andreas@biessmann.org> |
Andreas Bießmann | d7a886b | 2013-04-18 22:48:50 +0000 | [diff] [blame] | 5 | * |
| 6 | * This file consolidates all the different hang() functions implemented in |
| 7 | * u-boot. |
Andreas Bießmann | d7a886b | 2013-04-18 22:48:50 +0000 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | #include <common.h> |
| 11 | #include <bootstage.h> |
| 12 | |
| 13 | /** |
| 14 | * hang - stop processing by staying in an endless loop |
| 15 | * |
| 16 | * The purpose of this function is to stop further execution of code cause |
| 17 | * something went completely wrong. To catch this and give some feedback to |
| 18 | * the user one needs to catch the bootstage_error (see show_boot_progress()) |
| 19 | * in the board code. |
| 20 | */ |
| 21 | void hang(void) |
| 22 | { |
| 23 | #if !defined(CONFIG_SPL_BUILD) || (defined(CONFIG_SPL_LIBCOMMON_SUPPORT) && \ |
| 24 | defined(CONFIG_SPL_SERIAL_SUPPORT)) |
| 25 | puts("### ERROR ### Please RESET the board ###\n"); |
| 26 | #endif |
| 27 | bootstage_error(BOOTSTAGE_ID_NEED_RESET); |
| 28 | for (;;) |
| 29 | ; |
| 30 | } |