err.c 574 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (c) 2016 - 2020, Broadcom
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <stdint.h>
  7. #include <arch_helpers.h>
  8. #include <common/debug.h>
  9. #include <drivers/console.h>
  10. #include <lib/mmio.h>
  11. #include <platform_def.h>
  12. #define L0_RESET 0x2
  13. /*
  14. * Brcm error handler
  15. */
  16. void plat_error_handler(int err)
  17. {
  18. INFO("L0 reset...\n");
  19. /* Ensure the characters are flushed out */
  20. console_flush();
  21. mmio_write_32(CRMU_SOFT_RESET_CTRL, L0_RESET);
  22. /*
  23. * In case we get here:
  24. * Loop until the watchdog resets the system
  25. */
  26. while (1) {
  27. wfi();
  28. }
  29. }