SPM: Deprecate boot info struct

This information is defined by the Secure Partition in the resource
description.

Change-Id: Ia7db90c5de8360a596106880d3f6a632a88d3ea8
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
diff --git a/include/services/secure_partition.h b/include/services/secure_partition.h
index d565e0c..0ae6cf9 100644
--- a/include/services/secure_partition.h
+++ b/include/services/secure_partition.h
@@ -7,6 +7,8 @@
 #ifndef SECURE_PARTITION_H
 #define SECURE_PARTITION_H
 
+#if SPM_DEPRECATED
+
 #include <stdint.h>
 #include <utils_def.h>
 
@@ -46,4 +48,6 @@
 	secure_partition_mp_info_t	*mp_info;
 } secure_partition_boot_info_t;
 
+#endif /* SPM_DEPRECATED */
+
 #endif /* SECURE_PARTITION_H */
diff --git a/plat/arm/board/fvp/fvp_common.c b/plat/arm/board/fvp/fvp_common.c
index 0edf6ba..4ef8667 100644
--- a/plat/arm/board/fvp/fvp_common.c
+++ b/plat/arm/board/fvp/fvp_common.c
@@ -184,7 +184,7 @@
 }
 #endif
 
-#if ENABLE_SPM && defined(IMAGE_BL31)
+#if ENABLE_SPM && defined(IMAGE_BL31) && SPM_DEPRECATED
 /*
  * Boot information passed to a secure partition during initialisation. Linear
  * indices in MP information will be filled at runtime.
diff --git a/services/std_svc/spm/sp_setup.c b/services/std_svc/spm/sp_setup.c
index 0d61306..04eedff 100644
--- a/services/std_svc/spm/sp_setup.c
+++ b/services/std_svc/spm/sp_setup.c
@@ -176,72 +176,4 @@
 	 */
 	write_ctx_reg(get_sysregs_ctx(ctx), CTX_CPACR_EL1,
 			CPACR_EL1_FPEN(CPACR_EL1_FP_TRAP_NONE));
-
-	/*
-	 * Prepare information in buffer shared between EL3 and S-EL0
-	 * ----------------------------------------------------------
-	 */
-
-	void *shared_buf_ptr = (void *) PLAT_SPM_BUF_BASE;
-
-	/* Copy the boot information into the shared buffer with the SP. */
-	assert((uintptr_t)shared_buf_ptr + sizeof(secure_partition_boot_info_t)
-	       <= (PLAT_SPM_BUF_BASE + PLAT_SPM_BUF_SIZE));
-
-	assert(PLAT_SPM_BUF_BASE <= (UINTPTR_MAX - PLAT_SPM_BUF_SIZE + 1));
-
-	const secure_partition_boot_info_t *sp_boot_info =
-			plat_get_secure_partition_boot_info(NULL);
-
-	assert(sp_boot_info != NULL);
-
-	memcpy((void *) shared_buf_ptr, (const void *) sp_boot_info,
-	       sizeof(secure_partition_boot_info_t));
-
-	/* Pointer to the MP information from the platform port. */
-	secure_partition_mp_info_t *sp_mp_info =
-		((secure_partition_boot_info_t *) shared_buf_ptr)->mp_info;
-
-	assert(sp_mp_info != NULL);
-
-	/*
-	 * Point the shared buffer MP information pointer to where the info will
-	 * be populated, just after the boot info.
-	 */
-	((secure_partition_boot_info_t *) shared_buf_ptr)->mp_info =
-		(secure_partition_mp_info_t *) ((uintptr_t)shared_buf_ptr
-				+ sizeof(secure_partition_boot_info_t));
-
-	/*
-	 * Update the shared buffer pointer to where the MP information for the
-	 * payload will be populated
-	 */
-	shared_buf_ptr = ((secure_partition_boot_info_t *) shared_buf_ptr)->mp_info;
-
-	/*
-	 * Copy the cpu information into the shared buffer area after the boot
-	 * information.
-	 */
-	assert(sp_boot_info->num_cpus <= PLATFORM_CORE_COUNT);
-
-	assert((uintptr_t)shared_buf_ptr
-	       <= (PLAT_SPM_BUF_BASE + PLAT_SPM_BUF_SIZE -
-		       (sp_boot_info->num_cpus * sizeof(*sp_mp_info))));
-
-	memcpy(shared_buf_ptr, (const void *) sp_mp_info,
-		sp_boot_info->num_cpus * sizeof(*sp_mp_info));
-
-	/*
-	 * Calculate the linear indices of cores in boot information for the
-	 * secure partition and flag the primary CPU
-	 */
-	sp_mp_info = (secure_partition_mp_info_t *) shared_buf_ptr;
-
-	for (unsigned int index = 0; index < sp_boot_info->num_cpus; index++) {
-		u_register_t mpidr = sp_mp_info[index].mpidr;
-
-		sp_mp_info[index].linear_id = plat_core_pos_by_mpidr(mpidr);
-		if (plat_my_core_pos() == sp_mp_info[index].linear_id)
-			sp_mp_info[index].flags |= MP_INFO_FLAG_PRIMARY_CPU;
-	}
 }