feat(ff-a): report RXTX buffer size in FFA_FEATURES

FF-A v1.2 ALP1 requires that FFA_FEATURES with function id=FFA_RXTX_MAP
must report the minimum and maximum buffer sizes required for the RXTX
buffers. The patch does this when the ffa version is at least 1.2.

Change-Id: I7e765fdec4bcad3a09c4a04af57c690474a21a5a
Signed-off-by: Karl Meakin <karl.meakin@arm.com>
diff --git a/inc/hf/ffa_memory_internal.h b/inc/hf/ffa_memory_internal.h
index dac131d..f240ca2 100644
--- a/inc/hf/ffa_memory_internal.h
+++ b/inc/hf/ffa_memory_internal.h
@@ -49,6 +49,10 @@
 static_assert(sizeof(((struct ffa_memory_region){0}).receiver_count == 4),
 	      "struct ffa_memory_region::receiver_count must be 4 bytes long");
 
+static_assert(sizeof(struct ffa_features_rxtx_map_params) == 4,
+	      "struct ffa_features_rxtx_map_params must be 4 "
+	      "bytes long");
+
 struct ffa_memory_share_state {
 	/**
 	 * The memory region being shared, or NULL if this share state is
diff --git a/inc/vmapi/hf/ffa.h b/inc/vmapi/hf/ffa.h
index acaff6d..6a1324a 100644
--- a/inc/vmapi/hf/ffa.h
+++ b/inc/vmapi/hf/ffa.h
@@ -1288,6 +1288,32 @@
 	struct ffa_memory_region_constituent *dest,
 	const struct ffa_memory_region_constituent *src);
 
+struct ffa_features_rxtx_map_params {
+	/*
+	 * Bit[0:1]:
+	 * Minimum buffer size and alignment boundary:
+	 * 0b00: 4K
+	 * 0b01: 64K
+	 * 0b10: 16K
+	 * 0b11: Reserved
+	 */
+	uint8_t min_buf_size : 2;
+	/*
+	 * Bit[2:15]:
+	 * Reserved (MBZ)
+	 */
+	uint16_t mbz : 14;
+	/*
+	 * Bit[16:32]:
+	 * Maximum buffer size in number of pages
+	 * Only present on version 1.2 or later
+	 */
+	uint16_t max_buf_size : 16;
+};
+
+#define FFA_RXTX_MAP_MIN_BUF_4K 0
+#define FFA_RXTX_MAP_MAX_BUF_PAGE_COUNT 1
+
 /**
  * Endpoint RX/TX descriptor, as defined by Table 13.27 in FF-A v1.1 EAC0.
  * It's used by the Hypervisor to describe the RX/TX buffers mapped by a VM