feat(manifest): support FF-A v1.2 direct messages

Add additional messaging method parsing to indicate whether a partition
can send/receive messages via FFA_MSG_SEND_DIRECT_REQ2.

Also enforce that a manifest declaring an FF-A version < FF-A v1.2
cannot declare usage of FFA_MSG_SEND_DIRECT_REQ2.

Signed-off-by: Kathleen Capella <kathleen.capella@arm.com>
Change-Id: I56f8e15dd00f16932ab7059dc585e12a9ca28f09
diff --git a/src/manifest_test.cc b/src/manifest_test.cc
index 3554e47..1adaa0e 100644
--- a/src/manifest_test.cc
+++ b/src/manifest_test.cc
@@ -243,7 +243,7 @@
 		Property("entrypoint-offset", "<0x00002000>");
 		Property("xlat-granule", "<0>");
 		Property("boot-order", "<0>");
-		Property("messaging-method", "<4>");
+		Property("messaging-method", "<0x4>");
 		Property("ns-interrupts-action", "<1>");
 		return *this;
 	}
@@ -911,7 +911,29 @@
 		  MANIFEST_ERROR_NOT_COMPATIBLE);
 	manifest_dealloc();
 
-	/* Incompatible messaging method */
+	/* Incompatible messaging method - unrecognized messaging-method. */
+	/* clang-format off */
+	dtb = ManifestDtBuilder()
+		.Compatible({ "arm,ffa-manifest-1.0" })
+		.Property("ffa-version", "<0x10002>")
+		.Property("uuid", "<0xb4b5671e 0x4a904fe1 0xb81ffb13 0xdae1dacb>")
+		.Property("execution-ctx-count", "<1>")
+		.Property("exception-level", "<2>")
+		.Property("execution-state", "<0>")
+		.Property("entrypoint-offset", "<0x00002000>")
+		.Property("xlat-granule", "<0>")
+		.Property("boot-order", "<0>")
+		.Property("messaging-method", "<0x272>")
+		.Property("ns-interrupts-action", "<0>")
+		.Build();
+	/* clang-format on */
+	ASSERT_EQ(ffa_manifest_from_vec(&m, dtb),
+		  MANIFEST_ERROR_NOT_COMPATIBLE);
+	manifest_dealloc();
+
+	/* Incompatible messaging method - only endpoints using FF-A version >=
+	 * FF-A v1.2 are allowed to set FFA_PARTITION_DIRECT_REQ2_RECV and
+	 * FFA_PARTITION_DIRECT_REQ2_SEND. */
 	/* clang-format off */
 	dtb = ManifestDtBuilder()
 		.Compatible({ "arm,ffa-manifest-1.0" })
@@ -923,7 +945,7 @@
 		.Property("entrypoint-offset", "<0x00002000>")
 		.Property("xlat-granule", "<0>")
 		.Property("boot-order", "<0>")
-		.Property("messaging-method", "<16>")
+		.Property("messaging-method", "<0x204>")
 		.Property("ns-interrupts-action", "<0>")
 		.Build();
 	/* clang-format on */