14da6f6cdSSathees Balya /* 2609e053cSAmbroise Vincent * Copyright (c) 2015-2019, ARM Limited and Contributors. All rights reserved. 34da6f6cdSSathees Balya * 44da6f6cdSSathees Balya * SPDX-License-Identifier: BSD-3-Clause 54da6f6cdSSathees Balya */ 64da6f6cdSSathees Balya 74da6f6cdSSathees Balya #include <errno.h> 809d40e0eSAntonio Nino Diaz 909d40e0eSAntonio Nino Diaz #include <arch_helpers.h> 10*37b70031SAmbroise Vincent #include <drivers/arm/sp805.h> 11609e053cSAmbroise Vincent #include <plat/arm/common/plat_arm.h> 1209d40e0eSAntonio Nino Diaz #include <plat/common/platform.h> 13234bc7f8SAntonio Nino Diaz #include <platform_def.h> 144da6f6cdSSathees Balya 154da6f6cdSSathees Balya /* 164da6f6cdSSathees Balya * Juno error handler 174da6f6cdSSathees Balya */ 184da6f6cdSSathees Balya void __dead2 plat_arm_error_handler(int err) 194da6f6cdSSathees Balya { 204da6f6cdSSathees Balya uint32_t *flags_ptr = (uint32_t *)V2M_SYS_NVFLAGS_ADDR; 214da6f6cdSSathees Balya 224da6f6cdSSathees Balya /* Propagate the err code in the NV-flags register */ 234da6f6cdSSathees Balya *flags_ptr = err; 244da6f6cdSSathees Balya 25*37b70031SAmbroise Vincent /* Setup the watchdog to reset the system as soon as possible */ 26*37b70031SAmbroise Vincent sp805_refresh(ARM_SP805_TWDG_BASE, 1U); 27*37b70031SAmbroise Vincent 284da6f6cdSSathees Balya for (;;) 294da6f6cdSSathees Balya wfi(); 304da6f6cdSSathees Balya } 31