feat(FF-A): implement FFA_SPM_ID_GET interface

If FFA_SPM_ID_GET is invoked at the secure virtual FF-A instance
(a secure partition) return the SPMC id. The SPMC id is queried by
the SPMC to the SPMD by calling FFA_ID_GET or by the Hypervisor to
the SPMD by calling FFA_SPM_ID_GET. Introduce plat_ffa module to
allow for the SPMC and hypervisor specific code.

Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
Change-Id: I892fa034ac00a1c0ada7ac13e9384a8c5ccfc507
diff --git a/inc/hf/api.h b/inc/hf/api.h
index 8af07ee..2714735 100644
--- a/inc/hf/api.h
+++ b/inc/hf/api.h
@@ -56,6 +56,7 @@
 struct ffa_value api_ffa_partition_info_get(struct vcpu *current,
 					    const struct ffa_uuid *uuid);
 struct ffa_value api_ffa_id_get(const struct vcpu *current);
+struct ffa_value api_ffa_spm_id_get(void);
 struct ffa_value api_ffa_features(uint32_t function_id);
 struct ffa_value api_ffa_run(ffa_vm_id_t vm_id, ffa_vcpu_index_t vcpu_idx,
 			     const struct vcpu *current, struct vcpu **next);
diff --git a/inc/hf/arch/ffa.h b/inc/hf/arch/ffa.h
new file mode 100644
index 0000000..1a6ae22
--- /dev/null
+++ b/inc/hf/arch/ffa.h
@@ -0,0 +1,14 @@
+/*
+ * Copyright 2021 The Hafnium Authors.
+ *
+ * Use of this source code is governed by a BSD-style
+ * license that can be found in the LICENSE file or at
+ * https://opensource.org/licenses/BSD-3-Clause.
+ */
+
+#pragma once
+
+#include "hf/ffa.h"
+
+/** Returns the SPMC ID. */
+ffa_vm_id_t arch_ffa_spmc_id_get(void);
diff --git a/inc/hf/arch/plat/ffa.h b/inc/hf/arch/plat/ffa.h
new file mode 100644
index 0000000..19c8e45
--- /dev/null
+++ b/inc/hf/arch/plat/ffa.h
@@ -0,0 +1,14 @@
+/*
+ * Copyright 2021 The Hafnium Authors.
+ *
+ * Use of this source code is governed by a BSD-style
+ * license that can be found in the LICENSE file or at
+ * https://opensource.org/licenses/BSD-3-Clause.
+ */
+
+#pragma once
+
+#include "hf/ffa.h"
+
+/** Returns the SPMC ID. */
+struct ffa_value plat_ffa_spmc_id_get(void);
diff --git a/inc/vmapi/hf/ffa.h b/inc/vmapi/hf/ffa.h
index 17c3ab6..25b1bf9 100644
--- a/inc/vmapi/hf/ffa.h
+++ b/inc/vmapi/hf/ffa.h
@@ -63,6 +63,7 @@
 #define FFA_MEM_FRAG_TX_32           0x8400007B
 #define FFA_SECONDARY_EP_REGISTER_32 0x84000084
 #define FFA_SECONDARY_EP_REGISTER_64 0xC4000084
+#define FFA_SPM_ID_GET_32	     0x84000085
 
 /* FF-A error codes. */
 #define FFA_NOT_SUPPORTED      INT32_C(-1)