hang.c 818 B

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