1 /*
2  * Copyright (c) 2015-2016, ARM Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #include <arch_helpers.h>
8 #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  */
plat_error_handler(int err)16 void 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 (;;)
25 		wfi();
26 }
27