poplar: Migrate to new interfaces

- Remove support for LOAD_IMAGE_V2=0.
- Replace deprecated bl1_init_bl2_mem_layout().
- Migrate to bl2_early_platform_setup2().
- Migrate to bl31_early_platform_setup2().
- Use PLAT_VIRT_ADDR_SPACE_SIZE and PLAT_PHY_ADDR_SPACE_SIZE.
- Remove references to removed build options.
- Update Makefile paths.

Change-Id: I52e02633365b3db4244f7ff0f99a6446eae619f0
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
diff --git a/plat/hisilicon/poplar/bl31_plat_setup.c b/plat/hisilicon/poplar/bl31_plat_setup.c
index ec72acd..b45693f 100644
--- a/plat/hisilicon/poplar/bl31_plat_setup.c
+++ b/plat/hisilicon/poplar/bl31_plat_setup.c
@@ -6,7 +6,6 @@
 
 #include <arch.h>
 #include <arch_helpers.h>
-#include <arm_gic.h>
 #include <assert.h>
 #include <bl31.h>
 #include <bl_common.h>
@@ -67,65 +66,45 @@
  * while creating page tables. BL2 has flushed this information to memory, so
  * we are guaranteed to pick up good data.
  ******************************************************************************/
-#if LOAD_IMAGE_V2
-void bl31_early_platform_setup(void *from_bl2,
-			       void *plat_params_from_bl2)
-#else
-void bl31_early_platform_setup(bl31_params_t *from_bl2,
-			       void *plat_params_from_bl2)
-#endif
+void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
+				u_register_t arg2, u_register_t arg3)
 {
+	void *from_bl2;
+
+	from_bl2 = (void *) arg0;
+
 	console_init(PL011_UART0_BASE, PL011_UART0_CLK_IN_HZ, PL011_BAUDRATE);
 
 	/* Init console for crash report */
 	plat_crash_console_init();
 
-#if LOAD_IMAGE_V2
-		/*
-		 * Check params passed from BL2 should not be NULL,
-		 */
-		bl_params_t *params_from_bl2 = (bl_params_t *)from_bl2;
-
-		assert(params_from_bl2 != NULL);
-		assert(params_from_bl2->h.type == PARAM_BL_PARAMS);
-		assert(params_from_bl2->h.version >= VERSION_2);
-
-		bl_params_node_t *bl_params = params_from_bl2->head;
-
-		/*
-		 * Copy BL33 and BL32 (if present), entry point information.
-		 * They are stored in Secure RAM, in BL2's address space.
-		 */
-		while (bl_params) {
-			if (bl_params->image_id == BL32_IMAGE_ID)
-				bl32_image_ep_info = *bl_params->ep_info;
-
-			if (bl_params->image_id == BL33_IMAGE_ID)
-				bl33_image_ep_info = *bl_params->ep_info;
-
-			bl_params = bl_params->next_params_info;
-		}
-
-		if (bl33_image_ep_info.pc == 0)
-			panic();
-
-#else /* LOAD_IMAGE_V2 */
-
 	/*
 	 * Check params passed from BL2 should not be NULL,
 	 */
+	bl_params_t *params_from_bl2 = (bl_params_t *)from_bl2;
+
 	assert(params_from_bl2 != NULL);
-	assert(params_from_bl2->h.type == PARAM_BL31);
-	assert(params_from_bl2->h.version >= VERSION_1);
+	assert(params_from_bl2->h.type == PARAM_BL_PARAMS);
+	assert(params_from_bl2->h.version >= VERSION_2);
+
+	bl_params_node_t *bl_params = params_from_bl2->head;
 
 	/*
-	 * Copy BL32 (if populated by BL2) and BL33 entry point information.
+	 * Copy BL33 and BL32 (if present), entry point information.
 	 * They are stored in Secure RAM, in BL2's address space.
 	 */
-	if (from_bl2->bl32_ep_info)
-		bl32_image_ep_info = *from_bl2->bl32_ep_info;
-	bl33_image_ep_info = *from_bl2->bl33_ep_info;
-#endif /* LOAD_IMAGE_V2 */
+	while (bl_params) {
+		if (bl_params->image_id == BL32_IMAGE_ID)
+			bl32_image_ep_info = *bl_params->ep_info;
+
+		if (bl_params->image_id == BL33_IMAGE_ID)
+			bl33_image_ep_info = *bl_params->ep_info;
+
+		bl_params = bl_params->next_params_info;
+	}
+
+	if (bl33_image_ep_info.pc == 0)
+		panic();
 }
 
 void bl31_platform_setup(void)