feat(arm): move GPT setup to common BL source

As of now, GPT setup is being handled from BL2 for plat/arm platforms.
However, for platforms having a separate entity to load firmware images,
it is possible for BL31 to setup the GPT. In order to address this
concern, move the GPT setup implementation from arm_bl2_setup.c file to
arm_common.c. Additionally, rename the API from arm_bl2_gpt_setup to
arm_gpt_setup to make it boot stage agnostic.

Signed-off-by: Rohit Mathew <Rohit.Mathew@arm.com>
Change-Id: I35d17a179c8746945c69db37fd23d763a7774ddc
diff --git a/plat/arm/common/arm_bl2_setup.c b/plat/arm/common/arm_bl2_setup.c
index 3ef561a..30d0647 100644
--- a/plat/arm/common/arm_bl2_setup.c
+++ b/plat/arm/common/arm_bl2_setup.c
@@ -131,46 +131,6 @@
 	arm_bl2_platform_setup();
 }
 
-#if ENABLE_RME
-static void arm_bl2_gpt_setup(void)
-{
-	/*
-	 * It is to be noted that any Arm platform that reuses arm_bl2_gpt_setup
-	 * must implement plat_arm_get_gpt_info within its platform code
-	 */
-	const arm_gpt_info_t *arm_gpt_info =
-		plat_arm_get_gpt_info();
-
-	if (arm_gpt_info == NULL) {
-		ERROR("arm_gpt_info not initialized!!\n");
-		panic();
-	}
-
-	/* Initialize entire protected space to GPT_GPI_ANY. */
-	if (gpt_init_l0_tables(arm_gpt_info->pps, arm_gpt_info->l0_base,
-		arm_gpt_info->l0_size) < 0) {
-		ERROR("gpt_init_l0_tables() failed!\n");
-		panic();
-	}
-
-	/* Carve out defined PAS ranges. */
-	if (gpt_init_pas_l1_tables(arm_gpt_info->pgs,
-				   arm_gpt_info->l1_base,
-				   arm_gpt_info->l1_size,
-				   arm_gpt_info->pas_region_base,
-				   arm_gpt_info->pas_region_count) < 0) {
-		ERROR("gpt_init_pas_l1_tables() failed!\n");
-		panic();
-	}
-
-	INFO("Enabling Granule Protection Checks\n");
-	if (gpt_enable() < 0) {
-		ERROR("gpt_enable() failed!\n");
-		panic();
-	}
-}
-#endif /* ENABLE_RME */
-
 /*******************************************************************************
  * Perform the very early platform specific architectural setup here.
  * When RME is enabled the secure environment is initialised before
@@ -211,7 +171,7 @@
 	enable_mmu_el3(0);
 
 	/* Initialise and enable granule protection after MMU. */
-	arm_bl2_gpt_setup();
+	arm_gpt_setup();
 #else
 	enable_mmu_el1(0);
 #endif