hang.c 828 B

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