2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2013-04-18 22:48:50 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2013
|
2016-05-01 01:46:16 +00:00
|
|
|
* Andreas Bießmann <andreas@biessmann.org>
|
2013-04-18 22:48:50 +00:00
|
|
|
*
|
|
|
|
* This file consolidates all the different hang() functions implemented in
|
|
|
|
* u-boot.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <bootstage.h>
|
2019-12-28 17:45:07 +00:00
|
|
|
#include <hang.h>
|
2023-12-14 18:16:58 +00:00
|
|
|
#include <stdio.h>
|
2019-05-18 17:59:44 +00:00
|
|
|
#include <os.h>
|
2013-04-18 22:48:50 +00: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-01 18:22:20 +00:00
|
|
|
#if !defined(CONFIG_SPL_BUILD) || \
|
|
|
|
(CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT) && \
|
2021-08-08 18:20:12 +00:00
|
|
|
CONFIG_IS_ENABLED(SERIAL))
|
2013-04-18 22:48:50 +00:00
|
|
|
puts("### ERROR ### Please RESET the board ###\n");
|
|
|
|
#endif
|
|
|
|
bootstage_error(BOOTSTAGE_ID_NEED_RESET);
|
2019-05-18 17:59:44 +00:00
|
|
|
if (IS_ENABLED(CONFIG_SANDBOX))
|
|
|
|
os_exit(1);
|
2013-04-18 22:48:50 +00:00
|
|
|
for (;;)
|
|
|
|
;
|
|
|
|
}
|