From 19a22ae956106af50bab9ab85efe9d488bbaff87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=85strand?= Date: Fri, 27 Nov 2020 19:47:58 +0100 Subject: Adapt cmsis build for secure/nonsecure worlds Add external include path to get the device specific partion header file to setup SAU as needed by cmsis startup and make sure system isn't build if we are targeting nonsecure world. Change-Id: Ic9a9e380aa2bc41e6d1cd7f71c6713d033065c7a --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 564d4d0..537e9a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,6 +38,15 @@ set_property(CACHE CORE_SOFTWARE_ACCELERATOR PROPERTY STRINGS CPU CMSIS-NN NPU) set(CORE_SOFTWARE_RTOS "None" CACHE STRING "Select RTOS to include. (None, MbedOS, FreeRTOS, Zephyr)") string(TOLOWER ${CORE_SOFTWARE_RTOS} CORE_SOFTWARE_RTOS_LOWER) +# Set trustzone options +set(TRUSTZONE_BUILD OFF CACHE BOOL "Enable TrustZone build") +if (TRUSTZONE_BUILD) + set(TRUSTZONE_SIDE "secure" CACHE STRING "Select secure or nonsecure") + set_property(CACHE TRUSTZONE_SIDE PROPERTY STRINGS secure nonsecure) + set(TRUSTZONE_PARTITION_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" CACHE + FILEPATH "Path to CMSIS partion header for device") +endif() + # # Build # @@ -45,6 +54,7 @@ add_library(ethosu_core INTERFACE) # Build CMSIS include(cmsis.cmake) +target_link_libraries(ethosu_core INTERFACE cmsis_core cmsis_device) # Build core driver if (CORE_SOFTWARE_ACCELERATOR STREQUAL "NPU") -- cgit v1.2.1