feat: route secure interrupts to any physical PE

This patch makes changes necessary to allow a physical interrupt to be
routed to a particular PE (by mpidr). Until now, all interrupts were
routed to the boot core by default. To maintain compatiblity with
existing behavior and manifests, the patch adds a new manifest field
'interrupts-target' through which the interrupt id and corresponding
MPIDR are supplied. This is then used to configure the gic
appropriately, to route interrupts to the desired PE.

Change-Id: I3ed8f51e7679bb65c0aca030b21395598553e6ec
Signed-off-by: Raghu Krishnamurthy <raghu.ncstate@gmail.com>
diff --git a/inc/hf/interrupt_desc.h b/inc/hf/interrupt_desc.h
index 958777c..6fcb938 100644
--- a/inc/hf/interrupt_desc.h
+++ b/inc/hf/interrupt_desc.h
@@ -102,6 +102,8 @@
 	uint8_t type_config_sec_state;
 	uint8_t priority;
 	bool valid;
+	bool mpidr_valid;
+	uint64_t mpidr;
 };
 
 /**
@@ -137,6 +139,18 @@
 	return int_desc.priority;
 }
 
+static inline uint64_t interrupt_desc_get_mpidr(
+	struct interrupt_descriptor int_desc)
+{
+	return int_desc.mpidr;
+}
+
+static inline bool interrupt_desc_get_mpidr_valid(
+	struct interrupt_descriptor int_desc)
+{
+	return int_desc.mpidr_valid;
+}
+
 static inline bool interrupt_desc_get_valid(
 	struct interrupt_descriptor int_desc)
 {
@@ -149,6 +163,20 @@
 	int_desc->interrupt_id = interrupt_id;
 }
 
+static inline void interrupt_desc_set_mpidr(
+	struct interrupt_descriptor *int_desc, uint64_t mpidr)
+{
+	int_desc->mpidr_valid = true;
+	int_desc->mpidr = mpidr;
+}
+
+static inline void interrupt_desc_set_mpidr_invalid(
+	struct interrupt_descriptor *int_desc)
+{
+	int_desc->mpidr_valid = false;
+	int_desc->mpidr = 0;
+}
+
 static inline void interrupt_desc_set_type_config_sec_state(
 	struct interrupt_descriptor *int_desc, uint8_t value)
 {
diff --git a/inc/hf/manifest.h b/inc/hf/manifest.h
index d2f9428..3f4cd3e 100644
--- a/inc/hf/manifest.h
+++ b/inc/hf/manifest.h
@@ -67,6 +67,8 @@
 struct interrupt_info {
 	uint32_t id;
 	uint32_t attributes;
+	bool mpidr_valid;
+	uint64_t mpidr;
 };
 
 /**
@@ -231,6 +233,7 @@
 	MANIFEST_ERROR_INVALID_MEM_PERM,
 	MANIFEST_ERROR_INTERRUPT_ID_REPEATED,
 	MANIFEST_ILLEGAL_NS_ACTION,
+	MANIFEST_ERROR_INTERRUPT_ID_NOT_IN_LIST,
 };
 
 enum manifest_return_code manifest_init(struct mm_stage1_locked stage1_locked,