aboutsummaryrefslogtreecommitdiffstats
path: root/plat/meson/gxbb
diff options
context:
space:
mode:
authorAntonio Nino Diaz <antonio.ninodiaz@arm.com>2018-10-05 20:42:42 +0100
committerAntonio Nino Diaz <antonio.ninodiaz@arm.com>2018-10-26 11:53:52 +0100
commitd1bc71455bfb7a4bf1dc9c8bcd06cc58663fadbf (patch)
tree0d362321f3ae7cab8ffd691d9911419af51c751b /plat/meson/gxbb
parentf3ff9f77d3a5d2d619a8bb8d2ec33d8abc113308 (diff)
downloadplatform_external_arm-trusted-firmware-d1bc71455bfb7a4bf1dc9c8bcd06cc58663fadbf.tar.gz
platform_external_arm-trusted-firmware-d1bc71455bfb7a4bf1dc9c8bcd06cc58663fadbf.tar.bz2
platform_external_arm-trusted-firmware-d1bc71455bfb7a4bf1dc9c8bcd06cc58663fadbf.zip
gxbb: Implement PSCI_CPU_OFF
This works fine for CPU1-3, but it fails for CPU0, where it is simply ignored and leaves CPU0 in a WFI loop. Change-Id: I7d73683fdd894f2021d6a5bc2cce6cd03e18e633 Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Diffstat (limited to 'plat/meson/gxbb')
-rw-r--r--plat/meson/gxbb/gxbb_pm.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/plat/meson/gxbb/gxbb_pm.c b/plat/meson/gxbb/gxbb_pm.c
index 6a13159a8..632a53f46 100644
--- a/plat/meson/gxbb/gxbb_pm.c
+++ b/plat/meson/gxbb/gxbb_pm.c
@@ -101,12 +101,28 @@ static void gxbb_pwr_domain_on_finish(const psci_power_state_t *target_state)
gicv2_cpuif_enable();
}
+static void gxbb_pwr_domain_off(const psci_power_state_t *target_state)
+{
+ u_register_t mpidr = read_mpidr_el1();
+ unsigned int core = plat_gxbb_calc_core_pos(mpidr);
+ uintptr_t addr = GXBB_PSCI_MAILBOX_BASE + 8 + (core << 4);
+
+ mmio_write_32(addr, 0xFFFFFFFF);
+ flush_dcache_range(addr, sizeof(uint32_t));
+
+ gicv2_cpuif_disable();
+
+ scpi_set_css_power_state(mpidr,
+ SCPI_POWER_OFF, SCPI_POWER_ON, SCPI_POWER_ON);
+}
+
/*******************************************************************************
* Platform handlers and setup function.
******************************************************************************/
static const plat_psci_ops_t gxbb_ops = {
.pwr_domain_on = gxbb_pwr_domain_on,
.pwr_domain_on_finish = gxbb_pwr_domain_on_finish,
+ .pwr_domain_off = gxbb_pwr_domain_off,
.system_off = gxbb_system_off,
.system_reset = gxbb_system_reset,
};