aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Hu <david.hu@arm.com>2019-06-28 13:16:33 +0800
committerDavid Hu <david.hu@arm.com>2019-07-11 05:57:32 +0000
commitcd653e44bf7f5d4caa6b022fd969e3db0bb89589 (patch)
tree668a1364a2023aea9ce2133d2a5d30ee2ca50a47
parent9d98f327b6c3425f077d265ce46c3f9338ebaffd (diff)
downloadtrusted-firmware-m-cd653e44bf7f5d4caa6b022fd969e3db0bb89589.tar.gz
Twincpu: Decouple multi-core booting from TF-M platform services
Since multi-core booting and TF-M platform services provide different funtionalities, change the return value of multi-core booting functions into general int type, from the dedicated enum type defined for TF-M platform services. Change-Id: Ib870a1dd59386f48c85336c17fb5f93f719740ae Signed-off-by: David Hu <david.hu@arm.com>
-rw-r--r--app/main_ns.c9
-rw-r--r--interface/include/tfm_multicore_api.h9
-rw-r--r--interface/src/tfm_multicore_api.c8
3 files changed, 11 insertions, 15 deletions
diff --git a/app/main_ns.c b/app/main_ns.c
index bcefe5232c..256ffda4bc 100644
--- a/app/main_ns.c
+++ b/app/main_ns.c
@@ -14,7 +14,6 @@
#include "tfm_integ_test.h"
#include "tfm_ns_svc.h"
#include "tfm_ns_lock.h"
-#include "tfm_platform_api.h"
#if TFM_MULTI_CORE_TOPOLOGY
#include "tfm_multicore_api.h"
#endif
@@ -139,10 +138,14 @@ int main(void)
LOG_MSG("NS code running on CM4\r\n");
#if TFM_MULTI_CORE_TOPOLOGY
- if (tfm_ns_wait_for_s_cpu_ready() != TFM_PLATFORM_ERR_SUCCESS)
- {
+ if (tfm_ns_wait_for_s_cpu_ready()) {
LOG_MSG("Error sync'ing with SPE core\r\n");
+
+ /* Avoid undefined behavior after multi-core sync-up failed */
+ for (;;) {
+ }
}
+
mailbox_init(&ns_mailbox_queue);
#endif
diff --git a/interface/include/tfm_multicore_api.h b/interface/include/tfm_multicore_api.h
index 0759d8def0..3ff4931175 100644
--- a/interface/include/tfm_multicore_api.h
+++ b/interface/include/tfm_multicore_api.h
@@ -8,10 +8,6 @@
#ifndef __TFM_MULTICORE_API__
#define __TFM_MULTICORE_API__
-#include <limits.h>
-#include <stdbool.h>
-#include "tfm_api.h"
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -21,9 +17,10 @@ extern "C" {
* Flags that the non-secure side has completed its initialization.
* Waits, if necessary, for the secure CPU to flag that it has completed
* its initialization.
+ *
+ * \return Return 0 if succeeds. Otherwise, return specific error code.
*/
-enum tfm_platform_err_t tfm_ns_wait_for_s_cpu_ready(void);
-
+int tfm_ns_wait_for_s_cpu_ready(void);
#ifdef __cplusplus
}
diff --git a/interface/src/tfm_multicore_api.c b/interface/src/tfm_multicore_api.c
index 11a2fbd032..2b27a4a340 100644
--- a/interface/src/tfm_multicore_api.c
+++ b/interface/src/tfm_multicore_api.c
@@ -1,18 +1,14 @@
/*
- * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2019, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
*/
-#include <stdbool.h>
-#include "tfm_platform_api.h"
#include "tfm_multicore_api.h"
-
#include "platform_multicore.h"
-
-enum tfm_platform_err_t tfm_ns_wait_for_s_cpu_ready(void)
+int tfm_ns_wait_for_s_cpu_ready(void)
{
return platform_ns_wait_for_s_cpu_ready();
}