blob: 4682895948f10ddd2688c94011e88639eff2a987 [file] [log] [blame]
Juan Castillob6132f12015-10-06 14:01:35 +01001/*
Sandrine Bailleux628198b2016-08-18 09:24:40 +01002 * Copyright (c) 2015-2016, ARM Limited and Contributors. All rights reserved.
Juan Castillob6132f12015-10-06 14:01:35 +01003 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Juan Castillob6132f12015-10-06 14:01:35 +01005 */
6
Sandrine Bailleux628198b2016-08-18 09:24:40 +01007#include <arch_helpers.h>
Juan Castillob6132f12015-10-06 14:01:35 +01008#include <errno.h>
9#include <v2m_def.h>
10
11#define V2M_SYS_NVFLAGS_ADDR (V2M_SYSREGS_BASE + V2M_SYS_NVFLAGS)
12
13/*
14 * Juno error handler
15 */
16void plat_error_handler(int err)
17{
18 uint32_t *flags_ptr = (uint32_t *)V2M_SYS_NVFLAGS_ADDR;
19
20 /* Propagate the err code in the NV-flags register */
21 *flags_ptr = err;
22
23 /* Loop until the watchdog resets the system */
24 for (;;)
Sandrine Bailleux628198b2016-08-18 09:24:40 +010025 wfi();
Juan Castillob6132f12015-10-06 14:01:35 +010026}