ti: k3: common: Add basic PSCI core off support
authorAndrew F. Davis <[email protected]>
Thu, 9 Aug 2018 15:01:53 +0000 (10:01 -0500)
committerAndrew F. Davis <[email protected]>
Fri, 31 Aug 2018 14:23:21 +0000 (09:23 -0500)
Use TI-SCI messages to request core power down from system controller
firmware.

Signed-off-by: Andrew F. Davis <[email protected]>
plat/ti/k3/common/k3_psci.c

index 4c501f571e75a854c4f92970196c1e07e53f6a02..e75ebac8c842985530b8425a55d680644ee6adc8 100644 (file)
@@ -76,10 +76,19 @@ static int k3_pwr_domain_on(u_register_t mpidr)
 
 void k3_pwr_domain_off(const psci_power_state_t *target_state)
 {
+       int core_id, device, ret;
+
        /* Prevent interrupts from spuriously waking up this cpu */
        k3_gic_cpuif_disable();
 
-       /* TODO: Indicate to System firmware about powering down */
+       core_id = plat_my_core_pos();
+       device = PLAT_PROC_DEVICE_START_ID + core_id;
+
+       ret = ti_sci_device_put(device);
+       if (ret) {
+               ERROR("Request to stop core failed: %d\n", ret);
+               return;
+       }
 }
 
 void k3_pwr_domain_on_finish(const psci_power_state_t *target_state)