1#-------------------------------------------------------------------------------
2# Copyright (c) 2021, Arm Limited. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
8set(TFM_SPM_LOG_LEVEL           TFM_SPM_LOG_LEVEL_SILENCE       CACHE STRING    "Set default SPM log level as INFO level")
9set(TFM_PARTITION_LOG_LEVEL     TFM_PARTITION_LOG_LEVEL_SILENCE   CACHE STRING    "Set default Secure Partition log level as INFO level")
10
11# Secure regression tests also require SP log function
12# Enable SP log raw dump when SP log level is higher than silence or TF-M
13# regression test is enabled.
14if ((NOT ${TFM_PARTITION_LOG_LEVEL} STREQUAL TFM_PARTITION_LOG_LEVEL_SILENCE)
15    OR TFM_S_REG_TEST OR TFM_NS_REG_TEST)
16    set(TFM_SP_LOG_RAW_ENABLED ON)
17endif()
18
19# SP log relies on SPM log.
20# Enable SPM log when SPM log level is higher than silence or SP log is active.
21if ((NOT ${TFM_SPM_LOG_LEVEL} STREQUAL TFM_SPM_LOG_LEVEL_SILENCE)
22    OR TFM_SP_LOG_RAW_ENABLED)
23    set(TFM_SPM_LOG_RAW_ENABLED ON)
24endif()
25