From 2c826f50992d84e15752f98afd69767af93649c9 Mon Sep 17 00:00:00 2001 From: Nicola Mazzucato Date: Mon, 24 Jul 2023 10:25:03 +0100 Subject: [PATCH] core: scmi-server: Add support for conditional options for SCMI-Perf SCMI-Server is built upon the SCP-firmware source tree and a recent change [1] being proposed is moving functionalities into side source files. This patch adds support to fetch those additional files based on two options: CFG_SCPFW_SCMI_PERF_FAST_CHANNELS (existing) CFG_SCPFW_SCMI_PERF_PROTOCOL_OPS (new) [1] https://github.com/ARM-software/SCP-firmware/pull/812 Signed-off-by: Nicola Mazzucato Acked-by: Etienne Carriere --- core/lib/scmi-server/sub.mk | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/core/lib/scmi-server/sub.mk b/core/lib/scmi-server/sub.mk index b9ef74b8b96..d719a1c8d92 100644 --- a/core/lib/scmi-server/sub.mk +++ b/core/lib/scmi-server/sub.mk @@ -86,6 +86,9 @@ cppflags-lib-$(CFG_SCPFW_CLOCK_TREE_MGMT) += -DBUILD_HAS_CLOCK_TREE_MGMT cppflags-lib-$(CFG_SCPFW_SCMI_PERF_FAST_CHANNELS) += -DBUILD_HAS_SCMI_PERF_FAST_CHANNELS +cppflags-lib-$(CFG_SCPFW_SCMI_PERF_PROTOCOL_OPS) \ + += -DBUILD_HAS_SCMI_PERF_PROTOCOL_OPS + cppflags-lib-$(CFG_SCPFW_SCMI_SENSOR_EVENTS) += -DBUILD_HAS_SCMI_SENSOR_EVENTS cppflags-lib-$(CFG_SCPFW_SCMI_SENSOR_V2) += -DBUILD_HAS_SCMI_SENSOR_V2 \ -DBUILD_HAS_SENSOR_TIMESTAMP \ @@ -148,6 +151,21 @@ ifneq (,$$(wildcard $(scpfw-path)/$3/$2/include/*)) incdirs_ext-y += $(scpfw-path)/$3/$2/include endif srcs-$(CFG_SCPFW_MOD_$4) += $(scpfw-path)/$3/$2/src/mod_$1.c + +# SCMI_Perf in SCP-firmware has components that can be added conditionally at +# build time. +ifeq ($(1), scmi_perf) + +ifeq ($(CFG_SCPFW_SCMI_PERF_PROTOCOL_OPS),y) +srcs-$(CFG_SCPFW_MOD_SCMI_PERF) += $(scpfw-path)/$3/$2/src/scmi_perf_protocol_ops.c +endif + +ifeq ($(CFG_SCPFW_SCMI_PERF_FAST_CHANNELS),y) +srcs-$(CFG_SCPFW_MOD_SCMI_PERF) += $(scpfw-path)/$3/$2/src/scmi_perf_fastchannels.c +endif + +endif + cflags-lib-$(CFG_SCPFW_MOD_$4) += -DBUILD_HAS_MOD_$4 endef