modules: hal_ethos_u: add support for log level NONE

Add support for log level NONE by disabling Ethos-U driver logging.

Signed-off-by: Ledion Daja <ledion.daja@arm.com>
This commit is contained in:
Ledion Daja 2024-02-01 08:32:04 +01:00 committed by Carles Cufí
parent 2fff293cc7
commit 93af8754ec
2 changed files with 10 additions and 3 deletions

View File

@ -10,7 +10,10 @@ if(CONFIG_ARM_ETHOS_U AND CONFIG_MULTITHREADING)
set(ETHOSU_LOG_SEVERITY_MAP err err warning info debug)
list(LENGTH ETHOSU_LOG_SEVERITY_MAP ETHOSU_LOG_SEVERITY_MAP_LENGTH)
if (${CONFIG_ARM_ETHOS_U_LOG_LEVEL} LESS "${ETHOSU_LOG_SEVERITY_MAP_LENGTH}")
if (${CONFIG_ARM_ETHOS_U_LOG_LEVEL} EQUAL 0)
# The Ethos-U driver does not have a corresponding "none" log level. Disable logging instead.
set(ETHOSU_LOG_ENABLE OFF CACHE BOOL "")
elseif (${CONFIG_ARM_ETHOS_U_LOG_LEVEL} LESS "${ETHOSU_LOG_SEVERITY_MAP_LENGTH}")
list(GET ETHOSU_LOG_SEVERITY_MAP ${CONFIG_ARM_ETHOS_U_LOG_LEVEL} ETHOSU_LOG_SEVERITY)
set(ETHOSU_LOG_SEVERITY ${ETHOSU_LOG_SEVERITY} CACHE STRING "")
else()

View File

@ -1,5 +1,5 @@
# Copyright 2021-2022 Arm Limited and/or its affiliates <open-source-office@arm.com>
#
# SPDX-FileCopyrightText: <text>Copyright 2021-2022, 2024 Arm Limited and/or its
# affiliates <open-source-office@arm.com></text>
# SPDX-License-Identifier: Apache-2.0
config ARM_ETHOS_U
@ -45,6 +45,9 @@ choice "ARM_ETHOS_U_LOG_LEVEL_CHOICE"
default ARM_ETHOS_U_LOG_LEVEL_WRN
depends on STDOUT_CONSOLE
config ARM_ETHOS_U_LOG_LEVEL_NONE
bool "None"
config ARM_ETHOS_U_LOG_LEVEL_ERR
bool "Error"
@ -65,6 +68,7 @@ endchoice
config ARM_ETHOS_U_LOG_LEVEL
int
depends on STDOUT_CONSOLE
default 0 if ARM_ETHOS_U_LOG_LEVEL_NONE
default 1 if ARM_ETHOS_U_LOG_LEVEL_ERR
default 2 if ARM_ETHOS_U_LOG_LEVEL_WRN
default 3 if ARM_ETHOS_U_LOG_LEVEL_INF