2018-05-07 05:58:06 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2013-04-19 06:48:50 +08:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2013
|
2016-05-01 09:46:16 +08:00
|
|
|
* Andreas Bießmann <andreas@biessmann.org>
|
2013-04-19 06:48:50 +08:00
|
|
|
*
|
|
|
|
* This file consolidates all the different hang() functions implemented in
|
|
|
|
* u-boot.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <bootstage.h>
|
2019-12-29 01:45:07 +08:00
|
|
|
#include <hang.h>
|
2019-05-19 01:59:44 +08:00
|
|
|
#include <os.h>
|
2013-04-19 06:48:50 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* hang - stop processing by staying in an endless loop
|
|
|
|
*
|
|
|
|
* The purpose of this function is to stop further execution of code cause
|
|
|
|
* something went completely wrong. To catch this and give some feedback to
|
|
|
|
* the user one needs to catch the bootstage_error (see show_boot_progress())
|
|
|
|
* in the board code.
|
|
|
|
*/
|
|
|
|
void hang(void)
|
|
|
|
{
|
2018-10-02 02:22:20 +08:00
|
|
|
#if !defined(CONFIG_SPL_BUILD) || \
|
|
|
|
(CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT) && \
|
2021-08-09 02:20:12 +08:00
|
|
|
CONFIG_IS_ENABLED(SERIAL))
|
2013-04-19 06:48:50 +08:00
|
|
|
puts("### ERROR ### Please RESET the board ###\n");
|
|
|
|
#endif
|
|
|
|
bootstage_error(BOOTSTAGE_ID_NEED_RESET);
|
2019-05-19 01:59:44 +08:00
|
|
|
if (IS_ENABLED(CONFIG_SANDBOX))
|
|
|
|
os_exit(1);
|
2013-04-19 06:48:50 +08:00
|
|
|
for (;;)
|
|
|
|
;
|
|
|
|
}
|