PSA FF-A: add device-region parsing support

This patch implements support for parsing device-regions described in
Section 3.1, Table 11 of PSA FFA EAC specification.
A maximum of 8 device-regions can be defined for a given partition.

Change-Id: I671b727a771aaa348b2fbb140059c7f7bedc1c60
Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
diff --git a/inc/hf/manifest.h b/inc/hf/manifest.h
index fc3307b..3d8dfb2 100644
--- a/inc/hf/manifest.h
+++ b/inc/hf/manifest.h
@@ -22,6 +22,9 @@
 #define SP_RTX_BUF_NAME_SIZE 10
 
 #define SP_MAX_MEMORY_REGIONS 8
+#define SP_MAX_DEVICE_REGIONS 8
+#define SP_MAX_INTERRUPTS_PER_DEVICE 4
+#define SP_MAX_STREAMS_PER_DEVICE 4
 
 /** Mask for getting read/write/execute permission */
 #define MM_PERM_MASK 0x7
@@ -62,6 +65,33 @@
 	struct string name;
 };
 
+struct interrupt {
+	uint32_t id;
+	uint32_t attributes;
+};
+
+/**
+ * Partition Device region as described in PSA FFA v1.0 spec, Table 11
+ */
+struct device_region {
+	/** Device base PA - mandatory */
+	uintptr_t base_address;
+	/** Page count - mandatory */
+	uint32_t page_count;
+	/** Memory attributes - mandatory */
+	uint32_t attributes;
+	/** List of physical interrupt ID's and their attributes - optional */
+	struct interrupt interrupts[SP_MAX_INTERRUPTS_PER_DEVICE];
+	/** SMMU ID - optional */
+	uint32_t smmu_id;
+	/** List of Stream IDs assigned to device - optional */
+	uint32_t stream_ids[SP_MAX_STREAMS_PER_DEVICE];
+	/** Exclusive access to an endpoint - optional */
+	bool exclusive_access;
+	/** Name of Device region - optional */
+	struct string name;
+};
+
 /**
  * Partition manifest as described in PSA FF-A v1.0 spec section 3.1
  */
@@ -118,6 +148,8 @@
 
 	/** Memory regions */
 	struct memory_region mem_regions[SP_MAX_MEMORY_REGIONS];
+	/** Device regions */
+	struct device_region dev_regions[SP_MAX_DEVICE_REGIONS];
 };
 
 /**
@@ -191,6 +223,7 @@
 	MANIFEST_ERROR_MALFORMED_INTEGER_LIST,
 	MANIFEST_ERROR_MALFORMED_BOOLEAN,
 	MANIFEST_ERROR_MEMORY_REGION_NODE_EMPTY,
+	MANIFEST_ERROR_DEVICE_REGION_NODE_EMPTY,
 };
 
 enum manifest_return_code manifest_init(struct mm_stage1_locked stage1_locked,