Juan Castillo | b6132f1 | 2015-10-06 14:01:35 +0100 | [diff] [blame] | 1 | /* |
Sandrine Bailleux | 628198b | 2016-08-18 09:24:40 +0100 | [diff] [blame] | 2 | * Copyright (c) 2015-2016, ARM Limited and Contributors. All rights reserved. |
Juan Castillo | b6132f1 | 2015-10-06 14:01:35 +0100 | [diff] [blame] | 3 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame^] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
Juan Castillo | b6132f1 | 2015-10-06 14:01:35 +0100 | [diff] [blame] | 5 | */ |
| 6 | |
Sandrine Bailleux | 628198b | 2016-08-18 09:24:40 +0100 | [diff] [blame] | 7 | #include <arch_helpers.h> |
Juan Castillo | b6132f1 | 2015-10-06 14:01:35 +0100 | [diff] [blame] | 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 | */ |
| 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 (;;) |
Sandrine Bailleux | 628198b | 2016-08-18 09:24:40 +0100 | [diff] [blame] | 25 | wfi(); |
Juan Castillo | b6132f1 | 2015-10-06 14:01:35 +0100 | [diff] [blame] | 26 | } |