feat(ff-a): update FF-A version to v1.1

Bump the required FF-A version in framework and manifests to v1.1 as
upstream feature development goes.

Change-Id: I1262c0a83a69ab2c333c89da2db8106b1c1fcb04
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
diff --git a/inc/vmapi/hf/ffa.h b/inc/vmapi/hf/ffa.h
index 5c478dc..5a1077f 100644
--- a/inc/vmapi/hf/ffa.h
+++ b/inc/vmapi/hf/ffa.h
@@ -13,7 +13,7 @@
 #define FFA_VERSION_MAJOR 0x1
 #define FFA_VERSION_MAJOR_OFFSET 16
 #define FFA_VERSION_MAJOR_MASK 0x7FFF
-#define FFA_VERSION_MINOR 0x0
+#define FFA_VERSION_MINOR 0x1
 #define FFA_VERSION_MINOR_OFFSET 0
 #define FFA_VERSION_MINOR_MASK 0xFFFF
 
@@ -31,39 +31,52 @@
 #define FFA_HIGH_64_ID 0xC400007F
 
 /* FF-A function identifiers. */
-#define FFA_ERROR_32                 0x84000060
-#define FFA_SUCCESS_32               0x84000061
-#define FFA_SUCCESS_64               0xC4000061
-#define FFA_INTERRUPT_32             0x84000062
-#define FFA_VERSION_32               0x84000063
-#define FFA_FEATURES_32              0x84000064
-#define FFA_RX_RELEASE_32            0x84000065
-#define FFA_RXTX_MAP_32              0x84000066
-#define FFA_RXTX_MAP_64              0xC4000066
-#define FFA_RXTX_UNMAP_32            0x84000067
-#define FFA_PARTITION_INFO_GET_32    0x84000068
-#define FFA_ID_GET_32                0x84000069
-#define FFA_MSG_POLL_32              0x8400006A
-#define FFA_MSG_WAIT_32              0x8400006B
-#define FFA_YIELD_32                 0x8400006C
-#define FFA_RUN_32                   0x8400006D
-#define FFA_MSG_SEND_32              0x8400006E
-#define FFA_MSG_SEND_DIRECT_REQ_32   0x8400006F
-#define FFA_MSG_SEND_DIRECT_REQ_64   0xC400006F
-#define FFA_MSG_SEND_DIRECT_RESP_64  0xC4000070
-#define FFA_MSG_SEND_DIRECT_RESP_32  0x84000070
-#define FFA_MEM_DONATE_32            0x84000071
-#define FFA_MEM_LEND_32              0x84000072
-#define FFA_MEM_SHARE_32             0x84000073
-#define FFA_MEM_RETRIEVE_REQ_32      0x84000074
-#define FFA_MEM_RETRIEVE_RESP_32     0x84000075
-#define FFA_MEM_RELINQUISH_32        0x84000076
-#define FFA_MEM_RECLAIM_32           0x84000077
-#define FFA_MEM_FRAG_RX_32           0x8400007A
-#define FFA_MEM_FRAG_TX_32           0x8400007B
-#define FFA_SECONDARY_EP_REGISTER_32 0x84000084
-#define FFA_SECONDARY_EP_REGISTER_64 0xC4000084
-#define FFA_SPM_ID_GET_32	     0x84000085
+#define FFA_ERROR_32                        0x84000060
+#define FFA_SUCCESS_32                      0x84000061
+#define FFA_SUCCESS_64                      0xC4000061
+#define FFA_INTERRUPT_32                    0x84000062
+#define FFA_VERSION_32                      0x84000063
+#define FFA_FEATURES_32                     0x84000064
+#define FFA_RX_RELEASE_32                   0x84000065
+#define FFA_RXTX_MAP_32                     0x84000066
+#define FFA_RXTX_MAP_64                     0xC4000066
+#define FFA_RXTX_UNMAP_32                   0x84000067
+#define FFA_PARTITION_INFO_GET_32           0x84000068
+#define FFA_ID_GET_32                       0x84000069
+#define FFA_MSG_POLL_32                     0x8400006A /* Legacy FF-A v1.0 */
+#define FFA_MSG_WAIT_32                     0x8400006B
+#define FFA_YIELD_32                        0x8400006C
+#define FFA_RUN_32                          0x8400006D
+#define FFA_MSG_SEND_32                     0x8400006E /* Legacy FF-A v1.0 */
+#define FFA_MSG_SEND_DIRECT_REQ_32          0x8400006F
+#define FFA_MSG_SEND_DIRECT_REQ_64          0xC400006F
+#define FFA_MSG_SEND_DIRECT_RESP_32         0x84000070
+#define FFA_MSG_SEND_DIRECT_RESP_64         0xC4000070
+#define FFA_MEM_DONATE_32                   0x84000071
+#define FFA_MEM_LEND_32                     0x84000072
+#define FFA_MEM_SHARE_32                    0x84000073
+#define FFA_MEM_RETRIEVE_REQ_32             0x84000074
+#define FFA_MEM_RETRIEVE_RESP_32            0x84000075
+#define FFA_MEM_RELINQUISH_32               0x84000076
+#define FFA_MEM_RECLAIM_32                  0x84000077
+#define FFA_MEM_FRAG_RX_32                  0x8400007A
+#define FFA_MEM_FRAG_TX_32                  0x8400007B
+#define FFA_NORMAL_WORLD_RESUME             0x8400007C
+
+/* FF-A v1.1 */
+#define FFA_NOTIFICATION_BITMAP_CREATE_32   0x8400007D
+#define FFA_NOTIFICATION_BITMAP_DESTROY_32  0x8400007E
+#define FFA_NOTIFICATION_BIND_32            0x8400007F
+#define FFA_NOTIFICATION_UNBIND_32          0x84000080
+#define FFA_NOTIFICATION_SET_32             0x84000081
+#define FFA_NOTIFICATION_GET_32             0x84000082
+#define FFA_NOTIFICATION_INFO_GET_64        0xC4000083
+#define FFA_RX_ACQUIRE_32                   0x84000084
+#define FFA_SPM_ID_GET_32                   0x84000085
+#define FFA_MSG_SEND2_32                    0x84000086
+#define FFA_SECONDARY_EP_REGISTER_64        0xC4000087
+#define FFA_MEM_PERM_GET_32                 0x84000088
+#define FFA_MEM_PERM_SET_32                 0x84000089
 
 /* FF-A error codes. */
 #define FFA_NOT_SUPPORTED      INT32_C(-1)
diff --git a/src/api.c b/src/api.c
index 41fadc7..8a90a27 100644
--- a/src/api.c
+++ b/src/api.c
@@ -442,17 +442,16 @@
  */
 struct ffa_value api_ffa_spm_id_get(void)
 {
-	struct ffa_value ret = ffa_error(FFA_NOT_SUPPORTED);
-
-	if (MAKE_FFA_VERSION(1, 1) <= FFA_VERSION_COMPILED) {
-		/*
-		 * Return the SPMC ID that was fetched during FF-A
-		 * initialization.
-		 */
-		ret = (struct ffa_value){.func = FFA_SUCCESS_32,
-					 .arg2 = arch_ffa_spmc_id_get()};
-	}
-	return ret;
+#if (MAKE_FFA_VERSION(1, 1) <= FFA_VERSION_COMPILED)
+	/*
+	 * Return the SPMC ID that was fetched during FF-A
+	 * initialization.
+	 */
+	return (struct ffa_value){.func = FFA_SUCCESS_32,
+				  .arg2 = arch_ffa_spmc_id_get()};
+#else
+	return ffa_error(FFA_NOT_SUPPORTED);
+#endif
 }
 
 /**
@@ -1788,12 +1787,11 @@
 	case FFA_MSG_SEND_DIRECT_RESP_32:
 	case FFA_MSG_SEND_DIRECT_REQ_64:
 	case FFA_MSG_SEND_DIRECT_REQ_32:
-		return (struct ffa_value){.func = FFA_SUCCESS_32};
+#if (MAKE_FFA_VERSION(1, 1) <= FFA_VERSION_COMPILED)
 	/* FF-A v1.1 features. */
 	case FFA_SPM_ID_GET_32:
-		if (MAKE_FFA_VERSION(1, 1) <= FFA_VERSION_COMPILED) {
-			return (struct ffa_value){.func = FFA_SUCCESS_32};
-		}
+#endif
+		return (struct ffa_value){.func = FFA_SUCCESS_32};
 	default:
 		return ffa_error(FFA_NOT_SUPPORTED);
 	}
diff --git a/test/vmapi/ffa_secure_partition_only/partition-manifest.dts b/test/vmapi/ffa_secure_partition_only/partition-manifest.dts
index 1f47dff..ab4fe89 100644
--- a/test/vmapi/ffa_secure_partition_only/partition-manifest.dts
+++ b/test/vmapi/ffa_secure_partition_only/partition-manifest.dts
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020 The Hafnium Authors.
+ * Copyright 2021 The Hafnium Authors.
  *
  * Use of this source code is governed by a BSD-style
  * license that can be found in the LICENSE file or at
@@ -13,7 +13,7 @@
 	debug_name = "partition-manifest";
 
 	/* Properties */
-	ffa-version = <0x00010000>; /* 31:16 - Major, 15:0 - Minor */
+	ffa-version = <0x00010001>; /* 31:16 - Major, 15:0 - Minor */
 	uuid = <0xb4b5671e 0x4a904fe1 0xb81ffb13 0xdae1dacb>;
 	execution-ctx-count = <1>;
 	exception-level = <2>; /* S-EL1 */
diff --git a/test/vmapi/ffa_secure_partitions/partition_manifest_control_sp.dts b/test/vmapi/ffa_secure_partitions/partition_manifest_control_sp.dts
index ede9757..193db06 100644
--- a/test/vmapi/ffa_secure_partitions/partition_manifest_control_sp.dts
+++ b/test/vmapi/ffa_secure_partitions/partition_manifest_control_sp.dts
@@ -13,7 +13,7 @@
 	debug_name = "partition-manifest";
 
 	/* Properties */
-	ffa-version = <0x00010000>; /* 31:16 - Major, 15:0 - Minor */
+	ffa-version = <0x00010001>; /* 31:16 - Major, 15:0 - Minor */
 	uuid = <0xb4b5671e 0x4a904fe1 0xb81ffb13 0xdae1dacb>;
 	execution-ctx-count = <8>;
 	exception-level = <2>; /* S-EL1 */
diff --git a/test/vmapi/ffa_secure_partitions/partition_manifest_nwd_primary.dts b/test/vmapi/ffa_secure_partitions/partition_manifest_nwd_primary.dts
index 7bea56d..4f7159a 100644
--- a/test/vmapi/ffa_secure_partitions/partition_manifest_nwd_primary.dts
+++ b/test/vmapi/ffa_secure_partitions/partition_manifest_nwd_primary.dts
@@ -13,7 +13,7 @@
 	debug_name = "partition-manifest";
 
 	/* Properties */
-	ffa-version = <0x00010000>; /* 31:16 - Major, 15:0 - Minor */
+	ffa-version = <0x00010001>; /* 31:16 - Major, 15:0 - Minor */
 	uuid = <0xb4b5671e 0x4a904fe1 0xb81ffb13 0xdae1dacb>;
 	execution-ctx-count = <8>;
 	exception-level = <0>; /* EL1 */
diff --git a/test/vmapi/ffa_secure_partitions/partition_manifest_services_sp.dts b/test/vmapi/ffa_secure_partitions/partition_manifest_services_sp.dts
index eb33468..ed375de 100644
--- a/test/vmapi/ffa_secure_partitions/partition_manifest_services_sp.dts
+++ b/test/vmapi/ffa_secure_partitions/partition_manifest_services_sp.dts
@@ -13,7 +13,7 @@
 	debug_name = "partition-manifest";
 
 	/* Properties */
-	ffa-version = <0x00010000>; /* 31:16 - Major, 15:0 - Minor */
+	ffa-version = <0x00010001>; /* 31:16 - Major, 15:0 - Minor */
 	uuid = <0xa609f132 0x6b4f 0x4c14 0x9489 0x798457>;
 	execution-ctx-count = <8>;
 	exception-level = <2>; /* S-EL1 */
diff --git a/test/vmapi/primary_only/primary_only.c b/test/vmapi/primary_only/primary_only.c
index 9276295..cd5baea 100644
--- a/test/vmapi/primary_only/primary_only.c
+++ b/test/vmapi/primary_only/primary_only.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2018 The Hafnium Authors.
+ * Copyright 2021 The Hafnium Authors.
  *
  * Use of this source code is governed by a BSD-style
  * license that can be found in the LICENSE file or at
@@ -152,11 +152,10 @@
 /** Ensures that the Hafnium FF-A version is reported as expected. */
 TEST(ffa, ffa_version)
 {
-	const int32_t major_revision = 1;
-	const int32_t major_revision_offset = 16;
-	const int32_t minor_revision = 0;
+	const uint16_t major_revision = 1;
+	const uint16_t minor_revision = 1;
 	const int32_t current_version =
-		(major_revision << major_revision_offset) | minor_revision;
+		(int32_t)MAKE_FFA_VERSION(major_revision, minor_revision);
 
 	EXPECT_EQ(ffa_version(current_version), current_version);
 	EXPECT_EQ(ffa_version(0x0), current_version);
diff --git a/test/vmapi/primary_only_ffa/partition-manifest.dts b/test/vmapi/primary_only_ffa/partition-manifest.dts
index 2b99352..4be4ec0 100644
--- a/test/vmapi/primary_only_ffa/partition-manifest.dts
+++ b/test/vmapi/primary_only_ffa/partition-manifest.dts
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020 The Hafnium Authors.
+ * Copyright 2021 The Hafnium Authors.
  *
  * Use of this source code is governed by a BSD-style
  * license that can be found in the LICENSE file or at
@@ -13,7 +13,7 @@
 	debug_name = "partition-manifest";
 
 	/* Properties */
-	ffa-version = <0x00010000>; /* 31:16 - Major, 15:0 - Minor */
+	ffa-version = <0x00010001>; /* 31:16 - Major, 15:0 - Minor */
 	uuid = <0xb4b5671e 0x4a904fe1 0xb81ffb13 0xdae1dacb>;
 	execution-ctx-count = <1>;
 	exception-level = <2>; /* S-EL1 */