Andrei Narkevitch | 5bba54c | 2019-09-23 14:09:13 -0700 | [diff] [blame] | 1 | /* |
Mingyang Sun | c9bdcd7 | 2020-06-04 11:44:49 +0800 | [diff] [blame] | 2 | * Copyright (c) 2019-2020, Arm Limited. All rights reserved. |
Andrei Narkevitch | 5bba54c | 2019-09-23 14:09:13 -0700 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #include "target_cfg.h" |
Mingyang Sun | c9bdcd7 | 2020-06-04 11:44:49 +0800 | [diff] [blame] | 9 | #include "tfm_spm_hal.h" |
Jamie Fox | c99d0d6 | 2019-11-22 16:15:32 +0000 | [diff] [blame] | 10 | #include "uart_stdout.h" |
Andrei Narkevitch | 5bba54c | 2019-09-23 14:09:13 -0700 | [diff] [blame] | 11 | |
| 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 | |
| 18 | enum 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 Ai | 5525ef3 | 2019-12-23 10:17:22 +0800 | [diff] [blame] | 29 | |
Summer Qin | bce2113 | 2020-08-19 14:28:10 +0800 | [diff] [blame^] | 30 | __WEAK void tfm_hal_system_reset(void) |
Edison Ai | 5525ef3 | 2019-12-23 10:17:22 +0800 | [diff] [blame] | 31 | { |
| 32 | NVIC_SystemReset(); |
| 33 | } |