blob: 60699cc7325e91a02e38cb57abe40381058a26eb [file] [log] [blame]
Sathees Balya22576072018-09-03 17:41:13 +01001/*
Zelalem87675d42020-02-03 14:56:42 -06002 * Copyright (c) 2015-2020, 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 Diaza320ecd2019-01-15 14:19:50 +000012#include <platform_def.h>
Sathees Balya22576072018-09-03 17:41:13 +010013
14/*
15 * Juno error handler
16 */
17void __dead2 plat_arm_error_handler(int err)
18{
19 uint32_t *flags_ptr = (uint32_t *)V2M_SYS_NVFLAGS_ADDR;
20
21 /* Propagate the err code in the NV-flags register */
22 *flags_ptr = err;
23
Ambroise Vincentfa42c9e2019-07-04 14:58:45 +010024 /* Setup the watchdog to reset the system as soon as possible */
25 sp805_refresh(ARM_SP805_TWDG_BASE, 1U);
26
Sathees Balya22576072018-09-03 17:41:13 +010027 for (;;)
28 wfi();
29}