Ken Liu | 91d44da | 2018-09-20 22:42:31 +0800 | [diff] [blame] | 1 | /* |
David Hu | 9804b6a | 2021-02-15 21:23:06 +0800 | [diff] [blame^] | 2 | * Copyright (c) 2018-2021, Arm Limited. All rights reserved. |
Ken Liu | 91d44da | 2018-09-20 22:42:31 +0800 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | #include <inttypes.h> |
David Hu | 9804b6a | 2021-02-15 21:23:06 +0800 | [diff] [blame^] | 8 | #include "fih.h" |
Summer Qin | 5fdcf63 | 2020-06-22 16:49:24 +0800 | [diff] [blame] | 9 | #include "utilities.h" |
Summer Qin | bce2113 | 2020-08-19 14:28:10 +0800 | [diff] [blame] | 10 | #include "tfm_hal_platform.h" |
Ken Liu | 91d44da | 2018-09-20 22:42:31 +0800 | [diff] [blame] | 11 | |
Edison Ai | 9059ea0 | 2019-11-28 13:46:14 +0800 | [diff] [blame] | 12 | void tfm_core_panic(void) |
Ken Liu | 91d44da | 2018-09-20 22:42:31 +0800 | [diff] [blame] | 13 | { |
David Hu | 9804b6a | 2021-02-15 21:23:06 +0800 | [diff] [blame^] | 14 | fih_delay(); |
| 15 | |
Edison Ai | 93dabfd | 2019-12-03 13:44:45 +0800 | [diff] [blame] | 16 | /* |
| 17 | * FixMe: In the first stage, the SPM will restart the entire system when a |
| 18 | * programmer error is detected in either the SPE or NSPE. |
| 19 | * In the next stage, the specified error codes are also sent to any NSPE |
| 20 | * management firmware. The NSPE management firmware can then decide to pass |
| 21 | * those error codes back to the calling task or to use its own |
| 22 | * functionality for terminating an execution context. |
| 23 | */ |
Summer Qin | bce2113 | 2020-08-19 14:28:10 +0800 | [diff] [blame] | 24 | tfm_hal_system_reset(); |
David Hu | 9804b6a | 2021-02-15 21:23:06 +0800 | [diff] [blame^] | 25 | |
| 26 | #ifdef TFM_FIH_PROFILE_ON |
| 27 | fih_delay(); |
| 28 | |
| 29 | tfm_hal_system_reset(); |
| 30 | #endif |
Ken Liu | 91d44da | 2018-09-20 22:42:31 +0800 | [diff] [blame] | 31 | } |