refactor: SP manifest defines

This patch makes the partition manifest defines related to number of
memory regions, device regions, interrupts and streams pre device region
into platform build options, as opposed to being defined in header
files.
Large SoCs tend to have many memory regions and device regions that need
to be covered in SPs. An example SP is a RAS SP which requires access to
large number of memory regions and device regions to triage RAS issues.
Moreover, such SPs need to handle a large number of interrupts as well
and the current limits of 8 memory regions, 8 device regions and 4
interrupts per device regions are inadequate.
By making this a platform specific build option, it allows freedom for
platforms to choose the right number of regions and interrupts per
device.
This patch extends the allowed limit of memory and device regions to 64K
and have up to 256 interrupts and streams per device region.
Also note that the new defines are in platform.gni as opposed to in
architecture specific build/args gni files since SP specific details
have leaked into manifest.h, which is included in many architecture
agnostic files. Adding it into args.gni in the aarch64 folder yielded
compile errors which require further modification to many other
unrelated BUILD.gn files.

Change-Id: If71e154319e66f2864b18c33936a049d8cde4db4
Signed-off-by: Raghu Krishnamurthy <raghu.ncstate@gmail.com>
diff --git a/src/manifest.c b/src/manifest.c
index 80f5b40..d8350fc 100644
--- a/src/manifest.c
+++ b/src/manifest.c
@@ -357,10 +357,10 @@
 
 static enum manifest_return_code parse_ffa_memory_region_node(
 	struct fdt_node *mem_node, struct memory_region *mem_regions,
-	uint8_t *count, struct rx_tx *rxtx)
+	uint16_t *count, struct rx_tx *rxtx)
 {
 	uint32_t phandle;
-	uint8_t i = 0;
+	uint16_t i = 0;
 
 	dlog_verbose("  Partition memory regions\n");
 
@@ -430,7 +430,8 @@
 		}
 
 		i++;
-	} while (fdt_next_sibling(mem_node) && (i < SP_MAX_MEMORY_REGIONS));
+	} while (fdt_next_sibling(mem_node) &&
+		 (i < PARTITION_MAX_MEMORY_REGIONS));
 
 	if (rxtx->available &&
 	    (rxtx->rx_buffer->page_count != rxtx->tx_buffer->page_count)) {
@@ -444,10 +445,10 @@
 
 static enum manifest_return_code parse_ffa_device_region_node(
 	struct fdt_node *dev_node, struct device_region *dev_regions,
-	uint8_t *count)
+	uint16_t *count)
 {
 	struct uint32list_iter list;
-	uint8_t i = 0;
+	uint16_t i = 0;
 	uint32_t j = 0;
 
 	dlog_verbose("  Partition Device Regions\n");
@@ -507,7 +508,7 @@
 		dlog_verbose("      Interrupt List:\n");
 		j = 0;
 		while (uint32list_has_next(&list) &&
-		       j < SP_MAX_INTERRUPTS_PER_DEVICE) {
+		       j < PARTITION_MAX_INTERRUPTS_PER_DEVICE) {
 			TRY(uint32list_get_next(
 				&list, &dev_regions[i].interrupts[j].id));
 			if (uint32list_has_next(&list)) {
@@ -543,7 +544,7 @@
 
 		j = 0;
 		while (uint32list_has_next(&list) &&
-		       j < SP_MAX_STREAMS_PER_DEVICE) {
+		       j < PARTITION_MAX_STREAMS_PER_DEVICE) {
 			TRY(uint32list_get_next(&list,
 						&dev_regions[i].stream_ids[j]));
 			dlog_verbose("        %u\n",
@@ -561,7 +562,8 @@
 			     dev_regions[i].exclusive_access);
 
 		i++;
-	} while (fdt_next_sibling(dev_node) && (i < SP_MAX_DEVICE_REGIONS));
+	} while (fdt_next_sibling(dev_node) &&
+		 (i < PARTITION_MAX_DEVICE_REGIONS));
 
 	*count = i;
 
@@ -627,12 +629,13 @@
 		ret_code = MANIFEST_ERROR_NOT_COMPATIBLE;
 	}
 
-	for (uint8_t i = 0; i < vm->partition.dev_region_count; i++) {
+	for (uint16_t i = 0; i < vm->partition.dev_region_count; i++) {
 		struct device_region dev_region;
 
 		dev_region = vm->partition.dev_regions[i];
 
-		if (dev_region.interrupt_count > SP_MAX_INTERRUPTS_PER_DEVICE) {
+		if (dev_region.interrupt_count >
+		    PARTITION_MAX_INTERRUPTS_PER_DEVICE) {
 			dlog_error(
 				"Interrupt count for device region exceeds "
 				"limit.\n");