feat: add a test command to request a Cactus SP to start wdog timer

cactus_send_twdog_cmd() API sends a direct request message to target
SP which (re)starts the Trusted Watchdog timer. The SP then sends back
a direct response message indicating successful command.

Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
Change-Id: If09ce76b46a6339f08f26be90e566550931fb3c7
diff --git a/spm/cactus/cactus_tests/cactus_test_interrupts.c b/spm/cactus/cactus_tests/cactus_test_interrupts.c
index aa39ef2..a79885c 100644
--- a/spm/cactus/cactus_tests/cactus_test_interrupts.c
+++ b/spm/cactus/cactus_tests/cactus_test_interrupts.c
@@ -5,6 +5,7 @@
  */
 
 #include <common/debug.h>
+#include <drivers/arm/sp805.h>
 #include <sp_helpers.h>
 #include <spm_helpers.h>
 
@@ -47,3 +48,17 @@
 			       ffa_dir_msg_source(*args),
 			       CACTUS_SUCCESS);
 }
+
+CACTUS_CMD_HANDLER(twdog_cmd, CACTUS_TWDOG_START_CMD)
+{
+	ffa_id_t vm_id = ffa_dir_msg_dest(*args);
+	ffa_id_t source = ffa_dir_msg_source(*args);
+
+	uint64_t time_ms = cactus_get_wdog_duration(*args);
+
+	VERBOSE("Starting TWDOG: %llums\n", time_ms);
+	sp805_twdog_refresh();
+	sp805_twdog_start((time_ms * ARM_SP805_TWDG_CLK_HZ) / 1000);
+
+	return cactus_success_resp(vm_id, source, time_ms);
+}