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