aboutsummaryrefslogtreecommitdiff
path: root/targets/corstone-300
diff options
context:
space:
mode:
authorKristofer Jonsson <kristofer.jonsson@arm.com>2021-12-16 14:02:56 +0100
committerKristofer Jonsson <kristofer.jonsson@arm.com>2021-12-22 15:14:49 +0100
commit7b8fa5e739e91671c926e9e7c887579d82728513 (patch)
tree13bd12f55e7d8cf265034b31dc44a38729113ee9 /targets/corstone-300
parente9cdc6374dc730dc61d2a8a81beabe563ad7fe88 (diff)
downloadethos-u-core-platform-7b8fa5e739e91671c926e9e7c887579d82728513.tar.gz
Timing adapter fix, init constructor priority
The timing adapters are attached to the Ethos-U AXI ports and should only be initialized if the platform has been built with NPU support. Add priority to init the constructor, insuring it will run before any other constructor. This is important because the init constructor sets up UART. Change-Id: I189687437b95b11f6503c7631720e7883c24ada6
Diffstat (limited to 'targets/corstone-300')
-rw-r--r--targets/corstone-300/CMakeLists.txt3
-rw-r--r--targets/corstone-300/target.cpp9
2 files changed, 7 insertions, 5 deletions
diff --git a/targets/corstone-300/CMakeLists.txt b/targets/corstone-300/CMakeLists.txt
index 5dc3804..7c8db4e 100644
--- a/targets/corstone-300/CMakeLists.txt
+++ b/targets/corstone-300/CMakeLists.txt
@@ -124,9 +124,8 @@ target_sources(ethosu_target_startup INTERFACE
target.cpp)
target_link_libraries(ethosu_target_startup INTERFACE
- $<$<TARGET_EXISTS:ethosu_core_driver>:ethosu_core_driver>
+ $<$<TARGET_EXISTS:ethosu_core_driver>:ethosu_core_driver;timing_adapter>
mpu
- timing_adapter
ethosu_mhu_dummy
ethosu_uart_cmsdk_apb)
diff --git a/targets/corstone-300/target.cpp b/targets/corstone-300/target.cpp
index 87ba0c4..8f8db83 100644
--- a/targets/corstone-300/target.cpp
+++ b/targets/corstone-300/target.cpp
@@ -24,11 +24,10 @@
#ifdef ETHOSU
#include <ethosu_driver.h>
+#include <timing_adapter.h>
#endif
#include "mpu.hpp"
-#include <timing_adapter.h>
-
#include "uart_stdout.h"
#include <inttypes.h>
@@ -67,6 +66,8 @@ struct ethosu_driver ethosu0_driver;
* Timing Adapters
****************************************************************************/
+#ifdef ETHOSU
+
#ifndef ETHOSU_TA_MAXR_0
#define ETHOSU_TA_MAXR_0 0
#endif
@@ -203,6 +204,8 @@ struct timing_adapter_settings ethosu_ta_settings[ETHOSU_NPU_TA_COUNT] = {{ETHOS
ETHOSU_TA_HISTBIN_1,
ETHOSU_TA_HISTCNT_1}};
+#endif
+
/****************************************************************************
* Cache maintenance
****************************************************************************/
@@ -283,6 +286,7 @@ void targetSetup() {
// Initialize UART driver
UartStdOutInit();
+#ifdef ETHOSU
// Initialize timing adapter(s)
for (int i = 0; i < ETHOSU_NPU_COUNT; i++) {
for (int j = 0; j < ETHOSU_NPU_TA_COUNT; j++) {
@@ -295,7 +299,6 @@ void targetSetup() {
}
}
-#ifdef ETHOSU
// Initialize Ethos-U NPU driver
if (ethosu_init(&ethosu0_driver,
reinterpret_cast<void *>(ETHOSU_BASE_ADDRESS),