aboutsummaryrefslogtreecommitdiff
path: root/plat/rpi
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2019-07-15 23:04:26 +0100
committerAndre Przywara <andre.przywara@arm.com>2019-09-13 16:54:21 +0100
commite6fd00ab0a52fcdb130c343e0748f440200d9ae2 (patch)
tree802fd1ba2db7756d2c0d1a02fc28df77bbf48f89 /plat/rpi
parenta95e6415ac3117eeaec522574bde753f1e4ffb9f (diff)
downloadtrusted-firmware-a-e6fd00ab0a52fcdb130c343e0748f440200d9ae2.tar.gz
rpi3: Prepare for supporting a GIC (in RPi4)
As the PSCI "power" management functions for the Raspberry Pi 3 port will be shared with the upcoming RPi4 support, we need to prepare them for dealing with the GIC interrupt controller. Splitting this code just for those simple calls to the generic GIC routines does not seem worthwhile, so just use a #define the protect the GIC code from being included by the existing RPi3 code. Change-Id: Iaca6b0214563852b28ad4a088ec45348ae8be40d Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'plat/rpi')
-rw-r--r--plat/rpi/common/rpi3_pm.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/plat/rpi/common/rpi3_pm.c b/plat/rpi/common/rpi3_pm.c
index b79e2736e5..8c2d070c44 100644
--- a/plat/rpi/common/rpi3_pm.c
+++ b/plat/rpi/common/rpi3_pm.c
@@ -17,6 +17,10 @@
#include <rpi_hw.h>
+#ifdef RPI_HAVE_GIC
+#include <drivers/arm/gicv2.h>
+#endif
+
/* Make composite power state parameter till power level 0 */
#if PSCI_EXTENDED_STATE_ID
@@ -112,6 +116,13 @@ static void rpi3_cpu_standby(plat_local_state_t cpu_state)
wfi();
}
+static void rpi3_pwr_domain_off(const psci_power_state_t *target_state)
+{
+#ifdef RPI_HAVE_GIC
+ gicv2_cpuif_disable();
+#endif
+}
+
/*******************************************************************************
* Platform handler called when a power domain is about to be turned on. The
* mpidr determines the CPU to be turned on.
@@ -144,6 +155,11 @@ static void rpi3_pwr_domain_on_finish(const psci_power_state_t *target_state)
{
assert(target_state->pwr_domain_state[MPIDR_AFFLVL0] ==
PLAT_LOCAL_STATE_OFF);
+
+#ifdef RPI_HAVE_GIC
+ gicv2_pcpu_distif_init();
+ gicv2_cpuif_enable();
+#endif
}
/*******************************************************************************
@@ -207,6 +223,7 @@ static void __dead2 rpi3_system_off(void)
******************************************************************************/
static const plat_psci_ops_t plat_rpi3_psci_pm_ops = {
.cpu_standby = rpi3_cpu_standby,
+ .pwr_domain_off = rpi3_pwr_domain_off,
.pwr_domain_on = rpi3_pwr_domain_on,
.pwr_domain_on_finish = rpi3_pwr_domain_on_finish,
.system_off = rpi3_system_off,