From daa0d20f69a7aa382eef78ca2e8110c11ee11893 Mon Sep 17 00:00:00 2001 From: Kristofer Jonsson Date: Tue, 12 May 2020 12:23:16 +0200 Subject: Log updates Rename CMake log variable. Make logging default off. Remove CMake setting compile features. Remove FPGA flag around soft reset. Change-Id: Ia1f1c314ad19e9e05c59efe1a16d5670f6ec0f69 --- CMakeLists.txt | 14 +++++--------- src/ethosu_driver.c | 3 +-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e9d80e..2a5b813 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ project(ethosu_core_driver VERSION 0.0.1) # option(DRIVER_PMU_AUTOINIT "Enable PMU boot auto-initialization" OFF) -option(LOG_SUPPORT "Enable logging." ON) +option(DRIVER_LOG_SUPPORT "Enable logging." OFF) set(CMSIS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cmsis" CACHE PATH "Path to CMSIS.") @@ -39,13 +39,10 @@ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "cortex-m3") add_compile_definitions(CPU_CORTEX_M3) elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "cortex-m33") add_compile_definitions(CPU_CORTEX_M33) - add_compile_definitions(__DSP_PRESENT=1) elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "cortex-m4") add_compile_definitions(CPU_CORTEX_M4) elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "cortex-m55") add_compile_definitions(CPU_CORTEX_M55) - add_compile_definitions(__DSP_PRESENT=1) - add_compile_definitions(__FPU_PRESENT=1) elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "cortex-m7") add_compile_definitions(CPU_CORTEX_M7) else() @@ -53,7 +50,7 @@ else() endif() # Enable logging support -if (LOG_SUPPORT) +if(DRIVER_LOG_SUPPORT) add_compile_definitions(LOG_ENABLED) endif() @@ -71,7 +68,7 @@ target_include_directories(ethosu_core_driver PUBLIC include) target_sources(ethosu_core_driver PRIVATE src/ethosu_driver.c src/ethosu_device.c src/ethosu_pmu.c) # Build PMU -if (DRIVER_PMU_AUTOINIT) +if(DRIVER_PMU_AUTOINIT) set(NPU_PMCR "0x0" CACHE STRING "Register control b0 = CNT_EN = Enable counters (RW), b1 = EVENT_CNT_RST = Reset event counters (WO), b2 = CYCLE_CNT_RST = Reset cycle counter (WO), b[15:11] = Number of event counters (RO)") set(NPU_PMCNTENSET "0x0" CACHE STRING "Bit k enables event counter k. k=31 enables the cycle counter. Read value is current status.") set(NPU_PMCNTENCLR "0x0" CACHE STRING "Bit k disables event counter k. k=31 disables the cycle counter. Reda value is current status.") @@ -92,8 +89,7 @@ if (DRIVER_PMU_AUTOINIT) INIT_PMINTSET=${NPU_PMINTSET} INIT_PMINTCLR=${NPU_PMINTCLR} INIT_PMCCNTR=${NPU_PMCCNTR} - INIT_PMCCNTR_CFG=${NPU_PMCCNTR_CFG} - ) + INIT_PMCCNTR_CFG=${NPU_PMCCNTR_CFG}) endif() # @@ -103,6 +99,6 @@ endif() message(STATUS "*******************************************************") message(STATUS "PROJECT_NAME : ${PROJECT_NAME}") message(STATUS "CMAKE_SYSTEM_PROCESSOR : ${CMAKE_SYSTEM_PROCESSOR}") -message(STATUS "LOG_SUPPORT : ${LOG_SUPPORT}") message(STATUS "CMSIS_PATH : ${CMSIS_PATH}") +message(STATUS "DRIVER_LOG_SUPPORT : ${DRIVER_LOG_SUPPORT}") message(STATUS "*******************************************************") diff --git a/src/ethosu_driver.c b/src/ethosu_driver.c index 3bad2ac..01ec389 100644 --- a/src/ethosu_driver.c +++ b/src/ethosu_driver.c @@ -189,9 +189,8 @@ int ethosu_init(void) int return_code = 0; LOG_INFO("ethosu_init calling NPU embed driver ethosu_dev_init\n"); -#ifdef FPGA ethosu_soft_reset(); -#endif + if (ETHOSU_SUCCESS != ethosu_wait_for_reset()) { LOG_ERR("Failed reset of Ethos-U\n"); -- cgit v1.2.1