fix(ff-a): ivy doesn't support NPI

Don't expect the NPI ID to be reported over the
FFA_FEATURES interface for calls from EL0.

Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: I59227cc5c144478d053e2bfc33f4ceb3cfa0ca08
diff --git a/spm/cactus/cactus_main.c b/spm/cactus/cactus_main.c
index 1d5cd97..047566e 100644
--- a/spm/cactus/cactus_main.c
+++ b/spm/cactus/cactus_main.c
@@ -328,7 +328,7 @@
 	register_maintenance_interrupt_handlers();
 
 	/* Invoking self tests */
-	ffa_tests(&mb);
+	ffa_tests(&mb, true);
 	cpu_feature_tests();
 
 msg_loop:
diff --git a/spm/common/sp_tests/sp_test_ffa.c b/spm/common/sp_tests/sp_test_ffa.c
index ba63a0e..6e7fe1a 100644
--- a/spm/common/sp_tests/sp_test_ffa.c
+++ b/spm/common/sp_tests/sp_test_ffa.c
@@ -78,13 +78,13 @@
 /*
  * Test FFA_FEATURES interface.
  */
-static void ffa_features_test(void)
+static void ffa_features_test(bool el1_partition)
 {
 	const struct ffa_features_test *func_id_targets;
 	/* Get common features between tftf and cactus. */
 	unsigned int test_target_size =
 		get_ffa_feature_test_target(&func_id_targets);
-	const struct ffa_features_test feature_id_targets[] = {
+	struct ffa_features_test feature_id_targets[3] = {
 		{"FFA_FEATURE_MEI", FFA_FEATURE_MEI, FFA_SUCCESS_SMC32, 0,
 			FFA_VERSION_1_1},
 		{"FFA_FEATURE_SRI", FFA_FEATURE_SRI, FFA_ERROR, 0,
@@ -97,6 +97,12 @@
 	ffa_features_test_targets(func_id_targets, test_target_size);
 
 	/* Features are expected to be different to tftf. */
+
+	/* EL0 partitions don't support NPI. */
+	if (!el1_partition) {
+		feature_id_targets[2].expected_ret = FFA_ERROR;
+	}
+
 	ffa_features_test_targets(feature_id_targets,
 			ARRAY_SIZE(feature_id_targets));
 }
@@ -234,13 +240,13 @@
 	}
 }
 
-void ffa_tests(struct mailbox_buffers *mb)
+void ffa_tests(struct mailbox_buffers *mb, bool el1_partition)
 {
 	const char *test_ffa_str = "FF-A setup and discovery";
 
 	announce_test_section_start(test_ffa_str);
 
-	ffa_features_test();
+	ffa_features_test(el1_partition);
 	ffa_version_test();
 	ffa_spm_id_get_test();
 	ffa_partition_info_get_test(mb);
diff --git a/spm/common/sp_tests/sp_tests.h b/spm/common/sp_tests/sp_tests.h
index 007c2ca..f56d7e8 100644
--- a/spm/common/sp_tests/sp_tests.h
+++ b/spm/common/sp_tests/sp_tests.h
@@ -13,7 +13,7 @@
  * Self test functions
  */
 
-void ffa_tests(struct mailbox_buffers *mb);
+void ffa_tests(struct mailbox_buffers *mb, bool el1_partition);
 void cpu_feature_tests(void);
 
 #endif /* CACTUS_TESTS_H */
diff --git a/spm/ivy/app/ivy_main.c b/spm/ivy/app/ivy_main.c
index 861ef30..53dbf73 100644
--- a/spm/ivy/app/ivy_main.c
+++ b/spm/ivy/app/ivy_main.c
@@ -47,7 +47,7 @@
 		panic();
 	}
 
-	ffa_tests(&mb);
+	ffa_tests(&mb, false);
 
 	ret = ffa_msg_wait();