juno_err.c 587 B

123456789101112131415161718192021222324252627
  1. /*
  2. * Copyright (c) 2015-2021, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <errno.h>
  7. #include <arch_helpers.h>
  8. #include <drivers/arm/sp805.h>
  9. #include <plat/arm/common/plat_arm.h>
  10. #include <platform_def.h>
  11. /*
  12. * Juno error handler
  13. */
  14. void __dead2 plat_arm_error_handler(int err)
  15. {
  16. /* Propagate the err code in the NV-flags register */
  17. mmio_write_32(V2M_SYS_NVFLAGS_ADDR, (uint32_t)err);
  18. /* Setup the watchdog to reset the system as soon as possible */
  19. sp805_refresh(ARM_SP805_TWDG_BASE, 1U);
  20. for (;;)
  21. wfi();
  22. }