Juan Castillo | 7b4c140 | 2015-10-06 14:01:35 +0100 | [diff] [blame] | 1 | /* |
Roberto Vargas | fd116b9 | 2018-02-12 12:36:17 +0000 | [diff] [blame] | 2 | * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved. |
Juan Castillo | 7b4c140 | 2015-10-06 14:01:35 +0100 | [diff] [blame] | 3 | * |
dp-arm | 82cb2c1 | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
Juan Castillo | 7b4c140 | 2015-10-06 14:01:35 +0100 | [diff] [blame] | 5 | */ |
| 6 | |
Sandrine Bailleux | 8c9e1af | 2016-08-18 09:24:40 +0100 | [diff] [blame] | 7 | #include <arch_helpers.h> |
Juan Castillo | 7b4c140 | 2015-10-06 14:01:35 +0100 | [diff] [blame] | 8 | #include <errno.h> |
Roberto Vargas | fd116b9 | 2018-02-12 12:36:17 +0000 | [diff] [blame] | 9 | #include <platform.h> |
Juan Castillo | 7b4c140 | 2015-10-06 14:01:35 +0100 | [diff] [blame] | 10 | #include <v2m_def.h> |
| 11 | |
| 12 | #define V2M_SYS_NVFLAGS_ADDR (V2M_SYSREGS_BASE + V2M_SYS_NVFLAGS) |
| 13 | |
| 14 | /* |
| 15 | * Juno error handler |
| 16 | */ |
| 17 | void plat_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 | |
| 24 | /* Loop until the watchdog resets the system */ |
| 25 | for (;;) |
Sandrine Bailleux | 8c9e1af | 2016-08-18 09:24:40 +0100 | [diff] [blame] | 26 | wfi(); |
Juan Castillo | 7b4c140 | 2015-10-06 14:01:35 +0100 | [diff] [blame] | 27 | } |