feat: add build flag to control support for CPU_OFF psci msg
Please check the inline comments for detailed description of the
new build flag. This flag will help us to create a negative test
scenario where we can exercise sending DENIED response to SPMC,
ultimately leading to a panic by SPMD.
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
Change-Id: I30d2ea7f3fbf09e4e4febceb85f045e25f3e6035
diff --git a/spm/cactus/cactus.mk b/spm/cactus/cactus.mk
index 7d39221..34565f0 100644
--- a/spm/cactus/cactus.mk
+++ b/spm/cactus/cactus.mk
@@ -100,6 +100,7 @@
$(eval $(call add_define,CACTUS_DEFINES,PLAT_${PLAT}))
$(eval $(call add_define,CACTUS_DEFINES,PLAT_XLAT_TABLES_DYNAMIC))
$(eval $(call add_define,CACTUS_DEFINES,SPMC_AT_EL3))
+$(eval $(call add_define,CACTUS_DEFINES,CACTUS_PWR_MGMT_SUPPORT))
$(CACTUS_DTB) : $(BUILD_PLAT)/cactus $(BUILD_PLAT)/cactus/cactus.elf
$(CACTUS_DTB) : $(CACTUS_DTS)
diff --git a/spm/cactus/cactus_tests/cactus_message_loop.c b/spm/cactus/cactus_tests/cactus_message_loop.c
index 9a8e9a1..8dc37b9 100644
--- a/spm/cactus/cactus_tests/cactus_message_loop.c
+++ b/spm/cactus/cactus_tests/cactus_message_loop.c
@@ -106,6 +106,8 @@
ffa_id_t source_id = ffa_dir_msg_source(args);
ffa_id_t destination_id = ffa_dir_msg_dest(args);
uint32_t status_code;
+
+#if CACTUS_PWR_MGMT_SUPPORT == 1
uint32_t framework_msg = ffa_get_framework_msg(args);
uint32_t psci_function = args.arg3;
@@ -143,6 +145,9 @@
VERBOSE("PSCI power management request handled successfully by SP:%x\n",
destination_id);
out:
+#else
+ status_code = PSCI_E_DENIED;
+#endif
return ffa_framework_msg_send_direct_resp(destination_id, source_id,
FFA_FRAMEWORK_MSG_PSCI_RESP, status_code);
}