14da6f6cdSSathees Balya /* 2*aa79421cSManish V Badarkhe * Copyright (c) 2015-2021, 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> 1037b70031SAmbroise Vincent #include <drivers/arm/sp805.h> 11609e053cSAmbroise Vincent #include <plat/arm/common/plat_arm.h> 12234bc7f8SAntonio Nino Diaz #include <platform_def.h> 134da6f6cdSSathees Balya 144da6f6cdSSathees Balya /* 154da6f6cdSSathees Balya * Juno error handler 164da6f6cdSSathees Balya */ 174da6f6cdSSathees Balya void __dead2 plat_arm_error_handler(int err) 184da6f6cdSSathees Balya { 194da6f6cdSSathees Balya /* Propagate the err code in the NV-flags register */ 20*aa79421cSManish V Badarkhe mmio_write_32(V2M_SYS_NVFLAGS_ADDR, (uint32_t)err); 214da6f6cdSSathees Balya 2237b70031SAmbroise Vincent /* Setup the watchdog to reset the system as soon as possible */ 2337b70031SAmbroise Vincent sp805_refresh(ARM_SP805_TWDG_BASE, 1U); 2437b70031SAmbroise Vincent 254da6f6cdSSathees Balya for (;;) 264da6f6cdSSathees Balya wfi(); 274da6f6cdSSathees Balya } 28