refactor(cactus): use FFA_CONSOLE_LOG for debug logs

With the introduction of ffa_console_log abi, implementation-
defined debug logging is deprecated. Remove support for
SPM_DEBUG_LOG and use FFA_CONSOLE_LOG instead.

Also remove test for FFA_CONSOLE_LOG as it is now used as default
logger. Removing it cleans up test prints.

Signed-off-by: Kathleen Capella <kathleen.capella@arm.com>
Change-Id: Ibe02e14105aaa1658153ba35a5fc8e852ae3f955
diff --git a/spm/common/sp_debug.c b/spm/common/sp_debug.c
index 2e67be3..9c91c56 100644
--- a/spm/common/sp_debug.c
+++ b/spm/common/sp_debug.c
@@ -7,6 +7,7 @@
 #include <drivers/arm/pl011.h>
 #include <drivers/console.h>
 #include <ffa_helpers.h>
+#include <ffa_svc.h>
 #include <sp_debug.h>
 #include <spm_helpers.h>
 
@@ -14,18 +15,24 @@
 
 static int putc_hypcall(int c)
 {
-	spm_debug_log((char)c);
+	hvc_args args = {
+		.fid = FFA_CONSOLE_LOG_SMC32,
+		.arg1 = 1,
+		.arg2 = c
+	};
 
+	(void)tftf_hvc(&args);
 	return c;
 }
-
-static int putc_svccall(int c)
+static int putc_ffacall(int c)
 {
 	struct ffa_value args = {
-		.fid = SPM_DEBUG_LOG,
-		.arg1 = c
+		.fid = FFA_CONSOLE_LOG_SMC32,
+		.arg1 = 1,
+		.arg2 = c
 	};
-	ffa_svc(&args);
+
+	ffa_service_call(&args);
 
 	return c;
 }
@@ -41,14 +48,12 @@
 {
 	switch (route) {
 
-	case HVC_CALL_AS_STDOUT:
+	case FFA_HVC_CALL_AS_STDOUT:
 		putc_impl = putc_hypcall;
 		return;
-
-	case SVC_CALL_AS_STDOUT:
-		putc_impl = putc_svccall;
+	case FFA_SVC_SMC_CALL_AS_STDOUT:
+		putc_impl = putc_ffacall;
 		return;
-
 	case PL011_AS_STDOUT:
 	default:
 		break;
diff --git a/spm/common/sp_debug.h b/spm/common/sp_debug.h
index e35c602..49bf5e7 100644
--- a/spm/common/sp_debug.h
+++ b/spm/common/sp_debug.h
@@ -6,8 +6,8 @@
 
 enum stdout_route {
 	PL011_AS_STDOUT = 0,
-	HVC_CALL_AS_STDOUT,
-	SVC_CALL_AS_STDOUT,
+	FFA_HVC_CALL_AS_STDOUT,
+	FFA_SVC_SMC_CALL_AS_STDOUT,
 };
 
 void set_putc_impl(enum stdout_route);
diff --git a/spm/common/sp_tests/sp_test_ffa.c b/spm/common/sp_tests/sp_test_ffa.c
index b130451..d992468 100644
--- a/spm/common/sp_tests/sp_test_ffa.c
+++ b/spm/common/sp_tests/sp_test_ffa.c
@@ -193,19 +193,6 @@
 	announce_test_end(test_spm_id_get);
 }
 
-void ffa_console_log_test(void)
-{
-	const char *test_name = "FFA_CONSOLE_LOG SMC Function";
-	announce_test_start(test_name);
-
-	const char test_string[] = "[FFA_CONSOLE_LOG]: Hello World!\n";
-	struct ffa_value ret = ffa_console_log(test_string, sizeof(test_string));
-
-	expect(ffa_func_id(ret), FFA_SUCCESS_SMC32);
-
-	announce_test_end(test_name);
-}
-
 void ffa_tests(struct mailbox_buffers *mb)
 {
 	const char *test_ffa = "FFA Interfaces";
@@ -215,7 +202,6 @@
 	ffa_features_test();
 	ffa_version_test();
 	ffa_spm_id_get_test();
-	ffa_console_log_test();
 	ffa_partition_info_get_test(mb);
 
 	announce_test_section_end(test_ffa);
diff --git a/spm/common/spm_helpers.c b/spm/common/spm_helpers.c
index 82fdae5..1cb5f4d 100644
--- a/spm/common/spm_helpers.c
+++ b/spm/common/spm_helpers.c
@@ -21,16 +21,6 @@
 	return ret.ret0;
 }
 
-void spm_debug_log(char c)
-{
-	hvc_args args = {
-		.fid = SPM_DEBUG_LOG,
-		.arg1 = c
-	};
-
-	(void)tftf_hvc(&args);
-}
-
 /**
  * Hypervisor call to enable/disable SP delivery of a virtual interrupt of
  * int_id value through the IRQ or FIQ vector (pin).
diff --git a/spm/common/spm_helpers.h b/spm/common/spm_helpers.h
index 25c6493..1d3ddc2 100644
--- a/spm/common/spm_helpers.h
+++ b/spm/common/spm_helpers.h
@@ -14,7 +14,6 @@
 #define SPM_INTERRUPT_ENABLE            (0xFF03)
 #define SPM_INTERRUPT_GET               (0xFF04)
 #define SPM_INTERRUPT_DEACTIVATE	(0xFF08)
-#define SPM_DEBUG_LOG                   (0xBD000000)
 
 /*
  * Hypervisor Calls Wrappers
@@ -23,6 +22,5 @@
 uint32_t spm_interrupt_get(void);
 int64_t spm_interrupt_enable(uint32_t int_id, bool enable, enum interrupt_pin pin);
 int64_t spm_interrupt_deactivate(uint32_t vint_id);
-void spm_debug_log(char c);
 
 #endif /* SPMC_H */