feat(smcc): introduce a new vendor_el3 service for ACS SMC handler
In preparation to add support for the Architecture Compliance Suite
SMC services, reserve a SMC ID and introduce a handler function.
Currently, an empty placeholder function is added and future support
will be introduced for the handler support.
More info on System ACS, please refer below link,
https://developer.arm.com/Architectures/Architectural%20Compliance%20Suite
Signed-off-by: Nandan J <Nandan.J@arm.com>
Change-Id: Ib13ccae9d3829e3dcd1cd33c4a7f27efe1436d03
diff --git a/plat/arm/common/arm_common.mk b/plat/arm/common/arm_common.mk
index 418a9d8..0532ba2 100644
--- a/plat/arm/common/arm_common.mk
+++ b/plat/arm/common/arm_common.mk
@@ -79,6 +79,15 @@
$(eval $(call assert_boolean,ARM_BL31_IN_DRAM))
$(eval $(call add_define,ARM_BL31_IN_DRAM))
+# Macro to enable ACS SMC handler
+PLAT_ARM_ACS_SMC_HANDLER := 0
+ifeq (${ENABLE_ACS_SMC}, 1)
+PLAT_ARM_ACS_SMC_HANDLER := 1
+endif
+
+# Build macro necessary for branching to ACS tests
+$(eval $(call add_define,PLAT_ARM_ACS_SMC_HANDLER))
+
# As per CCA security model, all root firmware must execute from on-chip secure
# memory. This means we must not run BL31 from TZC-protected DRAM.
ifeq (${ARM_BL31_IN_DRAM},1)
@@ -305,6 +314,11 @@
plat/arm/common/arm_topology.c \
plat/common/plat_psci_common.c
+ifeq (${PLAT_ARM_ACS_SMC_HANDLER},1)
+BL31_SOURCES += plat/arm/common/plat_acs_smc_handler.c \
+ ${VENDOR_EL3_SRCS}
+endif
+
ifeq (${TRANSFER_LIST}, 1)
include lib/transfer_list/transfer_list.mk
TRANSFER_LIST_SOURCES += plat/arm/common/arm_transfer_list.c
diff --git a/plat/arm/common/plat_acs_smc_handler.c b/plat/arm/common/plat_acs_smc_handler.c
new file mode 100644
index 0000000..6f96874
--- /dev/null
+++ b/plat/arm/common/plat_acs_smc_handler.c
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2025, ARM Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+#include <stdint.h>
+#include <plat/arm/common/plat_acs_smc_handler.h>
+
+/*
+ * Placeholder function for handling ACS SMC calls.
+ * return 0 till the handling is done.
+ */
+uintptr_t plat_arm_acs_smc_handler(unsigned int smc_fid, uint64_t services,
+ uint64_t arg0, uint64_t arg1, uint64_t arg2, void *handle)
+{
+ WARN("Unimplemented ACS Call: 0x%x\n", smc_fid);
+ SMC_RET1(handle, SMC_UNK);
+}