From 7ceab0b5c15cea4167db5d791236a47ee5fff797 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Tue, 28 Oct 2025 14:49:16 +0200 Subject: [PATCH] platform: simplify setting CORE_COUNT and MAX_CORE_COUNT All normal SOF builds use Zephyr build system, so common settings like system core count can be simply set based on Zephyr build options. There are a few speciality builds left to build SOF without Zephyr. Testbench, cmocka and the SOF ALSA plugin are a few such examples. To keep these builds functional, add a simple definition of key Zephyr definitions (like in this case MP_MAX_NUM_CPUS) to allow these builds to use common build rules even when Zephyr definitions are not available. The old arch/host/Kconfig is removed. It is no longer needed and caused confusion as it added a unconditional default to CORE_COUNT that was used (more or less unintentionally) by some of the speciality build targets. Signed-off-by: Kai Vehmanen --- src/arch/host/Kconfig | 9 --------- src/platform/Kconfig | 25 +++++++++++++++++-------- 2 files changed, 17 insertions(+), 17 deletions(-) delete mode 100644 src/arch/host/Kconfig diff --git a/src/arch/host/Kconfig b/src/arch/host/Kconfig deleted file mode 100644 index de92f43a868c..000000000000 --- a/src/arch/host/Kconfig +++ /dev/null @@ -1,9 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause - -# Host architecture configs - -config CORE_COUNT - int - default 1 - help - Number of used cores diff --git a/src/platform/Kconfig b/src/platform/Kconfig index ebbe0540b7d4..a8e0addc3b98 100644 --- a/src/platform/Kconfig +++ b/src/platform/Kconfig @@ -332,21 +332,30 @@ config MT8196 endchoice -config MAX_CORE_COUNT +# +# For non-Zephyr builds like testbench, cmocka and SOF ALSA plugin, +# set core count separately. +# +if !ZEPHYR_SOF_MODULE + +config MP_MAX_NUM_CPUS int - default 5 if LUNARLAKE || PANTHERLAKE - default 4 if TIGERLAKE || NOVALAKE - default 3 if METEORLAKE - default 3 if WILDCATLAKE default 1 help Maximum number of cores per configuration +endif # !ZEPHYR_SOF_MODULE + +config MAX_CORE_COUNT + int + default MP_MAX_NUM_CPUS + help + Maximum number of cores per configuration + config CORE_COUNT int "Number of cores" - default MP_MAX_NUM_CPUS if KERNEL_BIN_NAME = "zephyr" - default MAX_CORE_COUNT - range 1 MAX_CORE_COUNT + default MP_MAX_NUM_CPUS + range 1 MP_MAX_NUM_CPUS help Number of used cores Lowering available core count could result in lower power consumption