gic: Remove deprecated driver and interfaces

Change-Id: I567a406edb090ae9d109382f6874846a79dd7473
Co-authored-by: Roberto Vargas <roberto.vargas@arm.com>
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
diff --git a/drivers/arm/gic/v2/gicv2_helpers.c b/drivers/arm/gic/v2/gicv2_helpers.c
index 221f1b5..bc4c1d1 100644
--- a/drivers/arm/gic/v2/gicv2_helpers.c
+++ b/drivers/arm/gic/v2/gicv2_helpers.c
@@ -114,43 +114,6 @@
 		gicd_write_icfgr(gicd_base, index, 0U);
 }
 
-#if !ERROR_DEPRECATED
-/*******************************************************************************
- * Helper function to configure secure G0 SPIs.
- ******************************************************************************/
-void gicv2_secure_spis_configure(uintptr_t gicd_base,
-				     unsigned int num_ints,
-				     const unsigned int *sec_intr_list)
-{
-	unsigned int index, irq_num;
-
-	/* If `num_ints` is not 0, ensure that `sec_intr_list` is not NULL */
-	if (num_ints != 0U)
-		assert(sec_intr_list != NULL);
-
-	for (index = 0; index < num_ints; index++) {
-		irq_num = sec_intr_list[index];
-		if (irq_num >= MIN_SPI_ID) {
-			/* Configure this interrupt as a secure interrupt */
-			gicd_clr_igroupr(gicd_base, irq_num);
-
-			/* Set the priority of this interrupt */
-			gicd_set_ipriorityr(gicd_base,
-					      irq_num,
-					      GIC_HIGHEST_SEC_PRIORITY);
-
-			/* Target the secure interrupts to primary CPU */
-			gicd_set_itargetsr(gicd_base, irq_num,
-					gicv2_get_cpuif_id(gicd_base));
-
-			/* Enable this interrupt */
-			gicd_set_isenabler(gicd_base, irq_num);
-		}
-	}
-
-}
-#endif
-
 /*******************************************************************************
  * Helper function to configure properties of secure G0 SPIs.
  ******************************************************************************/
@@ -191,56 +154,6 @@
 		gicd_set_isenabler(gicd_base, prop_desc->intr_num);
 	}
 }
-
-#if !ERROR_DEPRECATED
-/*******************************************************************************
- * Helper function to configure secure G0 SGIs and PPIs.
- ******************************************************************************/
-void gicv2_secure_ppi_sgi_setup(uintptr_t gicd_base,
-					unsigned int num_ints,
-					const unsigned int *sec_intr_list)
-{
-	unsigned int index, irq_num, sec_ppi_sgi_mask = 0;
-
-	/* If `num_ints` is not 0, ensure that `sec_intr_list` is not NULL */
-	assert(num_ints ? (uintptr_t)sec_intr_list : 1);
-
-	/*
-	 * Disable all SGIs (imp. def.)/PPIs before configuring them. This is a
-	 * more scalable approach as it avoids clearing the enable bits in the
-	 * GICD_CTLR.
-	 */
-	gicd_write_icenabler(gicd_base, 0, ~0);
-
-	/* Setup the default PPI/SGI priorities doing four at a time */
-	for (index = 0; index < MIN_SPI_ID; index += 4)
-		gicd_write_ipriorityr(gicd_base,
-				      index,
-				      GICD_IPRIORITYR_DEF_VAL);
-
-	for (index = 0; index < num_ints; index++) {
-		irq_num = sec_intr_list[index];
-		if (irq_num < MIN_SPI_ID) {
-			/* We have an SGI or a PPI. They are Group0 at reset */
-			sec_ppi_sgi_mask |= 1U << irq_num;
-
-			/* Set the priority of this interrupt */
-			gicd_set_ipriorityr(gicd_base,
-					    irq_num,
-					    GIC_HIGHEST_SEC_PRIORITY);
-		}
-	}
-
-	/*
-	 * Invert the bitmask to create a mask for non-secure PPIs and
-	 * SGIs. Program the GICD_IGROUPR0 with this bit mask.
-	 */
-	gicd_write_igroupr(gicd_base, 0, ~sec_ppi_sgi_mask);
-
-	/* Enable the Group 0 SGIs and PPIs */
-	gicd_write_isenabler(gicd_base, 0, sec_ppi_sgi_mask);
-}
-#endif
 
 /*******************************************************************************
  * Helper function to configure properties of secure G0 SGIs and PPIs.
diff --git a/drivers/arm/gic/v2/gicv2_main.c b/drivers/arm/gic/v2/gicv2_main.c
index 55897bf..b872905 100644
--- a/drivers/arm/gic/v2/gicv2_main.c
+++ b/drivers/arm/gic/v2/gicv2_main.c
@@ -79,27 +79,9 @@
 	assert(driver_data != NULL);
 	assert(driver_data->gicd_base != 0U);
 
-#if !ERROR_DEPRECATED
-	if (driver_data->interrupt_props != NULL) {
-#endif
-		gicv2_secure_ppi_sgi_setup_props(driver_data->gicd_base,
-				driver_data->interrupt_props,
-				driver_data->interrupt_props_num);
-#if !ERROR_DEPRECATED
-	} else {
-		/*
-		 * Suppress deprecated declaration warnings in compatibility
-		 * function
-		 */
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-		assert(driver_data->g0_interrupt_array);
-		gicv2_secure_ppi_sgi_setup(driver_data->gicd_base,
-				driver_data->g0_interrupt_num,
-				driver_data->g0_interrupt_array);
-#pragma GCC diagnostic pop
-	}
-#endif
+	gicv2_secure_ppi_sgi_setup_props(driver_data->gicd_base,
+			driver_data->interrupt_props,
+			driver_data->interrupt_props_num);
 
 	/* Enable G0 interrupts if not already */
 	ctlr = gicd_read_ctlr(driver_data->gicd_base);
@@ -129,30 +111,10 @@
 	/* Set the default attribute of all SPIs */
 	gicv2_spis_configure_defaults(driver_data->gicd_base);
 
-#if !ERROR_DEPRECATED
-	if (driver_data->interrupt_props != NULL) {
-#endif
-		gicv2_secure_spis_configure_props(driver_data->gicd_base,
-				driver_data->interrupt_props,
-				driver_data->interrupt_props_num);
-#if !ERROR_DEPRECATED
-	} else {
-		/*
-		 * Suppress deprecated declaration warnings in compatibility
-		 * function
-		 */
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-
-		assert(driver_data->g0_interrupt_array);
+	gicv2_secure_spis_configure_props(driver_data->gicd_base,
+			driver_data->interrupt_props,
+			driver_data->interrupt_props_num);
 
-		/* Configure the G0 SPIs */
-		gicv2_secure_spis_configure(driver_data->gicd_base,
-				driver_data->g0_interrupt_num,
-				driver_data->g0_interrupt_array);
-#pragma GCC diagnostic pop
-	}
-#endif
 
 	/* Re-enable the secure SPIs now that they have been configured */
 	gicd_write_ctlr(driver_data->gicd_base, ctlr | CTLR_ENABLE_G0_BIT);
@@ -169,35 +131,8 @@
 	assert(plat_driver_data->gicd_base != 0U);
 	assert(plat_driver_data->gicc_base != 0U);
 
-#if !ERROR_DEPRECATED
-	if (plat_driver_data->interrupt_props == NULL) {
-		/* Interrupt properties array size must be 0 */
-		assert(plat_driver_data->interrupt_props_num == 0);
-
-		/*
-		 * Suppress deprecated declaration warnings in compatibility
-		 * function
-		 */
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-
-		/*
-		 * If there are no interrupts of a particular type, then the
-		 * number of interrupts of that type should be 0 and vice-versa.
-		 */
-		assert(plat_driver_data->g0_interrupt_array ?
-				plat_driver_data->g0_interrupt_num :
-				plat_driver_data->g0_interrupt_num == 0);
-#pragma GCC diagnostic pop
-
-		WARN("Using deprecated integer interrupt array in "
-		     "gicv2_driver_data_t\n");
-		WARN("Please migrate to using an interrupt_prop_t array\n");
-	}
-#else
 	assert(plat_driver_data->interrupt_props_num > 0 ?
 			plat_driver_data->interrupt_props != NULL : 1);
-#endif
 
 	/* Ensure that this is a GICv2 system */
 	gic_version = gicd_read_pidr2(plat_driver_data->gicd_base);
diff --git a/drivers/arm/gic/v2/gicv2_private.h b/drivers/arm/gic/v2/gicv2_private.h
index fadc960..1eb6d9d 100644
--- a/drivers/arm/gic/v2/gicv2_private.h
+++ b/drivers/arm/gic/v2/gicv2_private.h
@@ -15,14 +15,6 @@
  * Private function prototypes
  ******************************************************************************/
 void gicv2_spis_configure_defaults(uintptr_t gicd_base);
-#if !ERROR_DEPRECATED
-void gicv2_secure_spis_configure(uintptr_t gicd_base,
-				     unsigned int num_ints,
-				     const unsigned int *sec_intr_list);
-void gicv2_secure_ppi_sgi_setup(uintptr_t gicd_base,
-					unsigned int num_ints,
-					const unsigned int *sec_intr_list);
-#endif
 void gicv2_secure_spis_configure_props(uintptr_t gicd_base,
 		const interrupt_prop_t *interrupt_props,
 		unsigned int interrupt_props_num);