blob: c5a78694be6f8217c45cb8cef8d2d081b2e433f0 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Andreas Bießmannd7a886b2013-04-18 22:48:50 +00002/*
3 * (C) Copyright 2013
Andreas Bießmann07dafdb2016-05-01 03:46:16 +02004 * Andreas Bießmann <andreas@biessmann.org>
Andreas Bießmannd7a886b2013-04-18 22:48:50 +00005 *
6 * This file consolidates all the different hang() functions implemented in
7 * u-boot.
Andreas Bießmannd7a886b2013-04-18 22:48:50 +00008 */
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 */
21void hang(void)
22{
Simon Glass60573922018-10-01 12:22:20 -060023#if !defined(CONFIG_SPL_BUILD) || \
24 (CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT) && \
25 CONFIG_IS_ENABLED(SERIAL_SUPPORT))
Andreas Bießmannd7a886b2013-04-18 22:48:50 +000026 puts("### ERROR ### Please RESET the board ###\n");
27#endif
28 bootstage_error(BOOTSTAGE_ID_NEED_RESET);
29 for (;;)
30 ;
31}