blob: 961bfda17a830f55ed902495b0573b1f98bdc1d1 [file] [log] [blame]
Sathees Balya22576072018-09-03 17:41:13 +01001/*
Ambroise Vincentb237bca2019-02-13 15:58:00 +00002 * Copyright (c) 2015-2019, ARM Limited and Contributors. All rights reserved.
Sathees Balya22576072018-09-03 17:41:13 +01003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
Sathees Balya22576072018-09-03 17:41:13 +01007#include <errno.h>
Antonio Nino Diaze0f90632018-12-14 00:18:21 +00008
9#include <arch_helpers.h>
Ambroise Vincentfa42c9e2019-07-04 14:58:45 +010010#include <drivers/arm/sp805.h>
Ambroise Vincentb237bca2019-02-13 15:58:00 +000011#include <plat/arm/common/plat_arm.h>
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000012#include <plat/common/platform.h>
Antonio Nino Diaza320ecd2019-01-15 14:19:50 +000013#include <platform_def.h>
Sathees Balya22576072018-09-03 17:41:13 +010014
15/*
16 * Juno error handler
17 */
18void __dead2 plat_arm_error_handler(int err)
19{
20 uint32_t *flags_ptr = (uint32_t *)V2M_SYS_NVFLAGS_ADDR;
21
22 /* Propagate the err code in the NV-flags register */
23 *flags_ptr = err;
24
Ambroise Vincentfa42c9e2019-07-04 14:58:45 +010025 /* Setup the watchdog to reset the system as soon as possible */
26 sp805_refresh(ARM_SP805_TWDG_BASE, 1U);
27
Sathees Balya22576072018-09-03 17:41:13 +010028 for (;;)
29 wfi();
30}