blob: e3f3697e7132bd43681ae3a0232e840a902df932 [file] [log] [blame]
Ken Liu91d44da2018-09-20 22:42:31 +08001/*
David Hu9804b6a2021-02-15 21:23:06 +08002 * Copyright (c) 2018-2021, Arm Limited. All rights reserved.
Ken Liu91d44da2018-09-20 22:42:31 +08003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7#include <inttypes.h>
David Hu9804b6a2021-02-15 21:23:06 +08008#include "fih.h"
Summer Qin5fdcf632020-06-22 16:49:24 +08009#include "utilities.h"
Summer Qinbce21132020-08-19 14:28:10 +080010#include "tfm_hal_platform.h"
Ken Liu91d44da2018-09-20 22:42:31 +080011
Edison Ai9059ea02019-11-28 13:46:14 +080012void tfm_core_panic(void)
Ken Liu91d44da2018-09-20 22:42:31 +080013{
David Hu9804b6a2021-02-15 21:23:06 +080014 fih_delay();
15
Edison Ai93dabfd2019-12-03 13:44:45 +080016 /*
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 Qinbce21132020-08-19 14:28:10 +080024 tfm_hal_system_reset();
David Hu9804b6a2021-02-15 21:23:06 +080025
26#ifdef TFM_FIH_PROFILE_ON
27 fih_delay();
28
29 tfm_hal_system_reset();
30#endif
Ken Liu91d44da2018-09-20 22:42:31 +080031}