]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | // SPDX-License-Identifier: GPL-2.0+ |
d2eae43b AB |
2 | /* |
3 | * (C) Copyright 2013 | |
09c2b8f3 | 4 | * Andreas Bießmann <[email protected]> |
d2eae43b AB |
5 | * |
6 | * This file consolidates all the different hang() functions implemented in | |
7 | * u-boot. | |
d2eae43b AB |
8 | */ |
9 | ||
10 | #include <common.h> | |
11 | #include <bootstage.h> | |
db41d65a | 12 | #include <hang.h> |
f2980ece | 13 | #include <os.h> |
d2eae43b AB |
14 | |
15 | /** | |
16 | * hang - stop processing by staying in an endless loop | |
17 | * | |
18 | * The purpose of this function is to stop further execution of code cause | |
19 | * something went completely wrong. To catch this and give some feedback to | |
20 | * the user one needs to catch the bootstage_error (see show_boot_progress()) | |
21 | * in the board code. | |
22 | */ | |
23 | void hang(void) | |
24 | { | |
aa0ffe8e SG |
25 | #if !defined(CONFIG_SPL_BUILD) || \ |
26 | (CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT) && \ | |
27 | CONFIG_IS_ENABLED(SERIAL_SUPPORT)) | |
d2eae43b AB |
28 | puts("### ERROR ### Please RESET the board ###\n"); |
29 | #endif | |
30 | bootstage_error(BOOTSTAGE_ID_NEED_RESET); | |
f2980ece SG |
31 | if (IS_ENABLED(CONFIG_SANDBOX)) |
32 | os_exit(1); | |
d2eae43b AB |
33 | for (;;) |
34 | ; | |
35 | } |