blob: fc9ecb70f6378732cc0ea3df3730d451051196df [file] [log] [blame]
Andrei Narkevitch5bba54c2019-09-23 14:09:13 -07001/*
Mingyang Sunc9bdcd72020-06-04 11:44:49 +08002 * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
Andrei Narkevitch5bba54c2019-09-23 14:09:13 -07003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8#include "target_cfg.h"
Mingyang Sunc9bdcd72020-06-04 11:44:49 +08009#include "tfm_spm_hal.h"
Jamie Foxc99d0d62019-11-22 16:15:32 +000010#include "uart_stdout.h"
Andrei Narkevitch5bba54c2019-09-23 14:09:13 -070011
12/* platform-specific hw initialization */
13__WEAK enum tfm_plat_err_t tfm_spm_hal_post_init_platform(void)
14{
15 return TFM_PLAT_ERR_SUCCESS;
16}
17
18enum tfm_plat_err_t tfm_spm_hal_post_init(void)
19{
20 if (tfm_spm_hal_post_init_platform() != TFM_PLAT_ERR_SUCCESS) {
21 return TFM_PLAT_ERR_SYSTEM_ERR;
22 }
23
24 __enable_irq();
25 stdio_init();
26
27 return TFM_PLAT_ERR_SUCCESS;
28}
Edison Ai5525ef32019-12-23 10:17:22 +080029
Summer Qinbce21132020-08-19 14:28:10 +080030__WEAK void tfm_hal_system_reset(void)
Edison Ai5525ef32019-12-23 10:17:22 +080031{
32 NVIC_SystemReset();
33}