Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cad2f807 authored by Maulik Shah's avatar Maulik Shah
Browse files

cpuidle: lpm-levels: Add Support for PSCI on 32bit



The lpm-levels will work with PSCI specification using the OS initiated
scheme. The lpm-levels driver would determine the last man standing and
vote into TZ accordingly.

Change-Id: I65ff03a3b68e3a197dba7653caea271298bf1475
Signed-off-by: default avatarMaulik Shah <mkshah@codeaurora.org>
parent 31653389
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -810,10 +810,28 @@ bool psci_enter_sleep(struct lpm_cluster *cluster, int idx, bool from_idle)
		return success;
	}
}
#elif defined(CONFIG_ARM_PSCI)
bool psci_enter_sleep(struct lpm_cluster *cluster, int idx, bool from_idle)
{
	int affinity_level = 0;
	int state_id = get_cluster_id(cluster, &affinity_level);
	int power_state = PSCI_POWER_STATE(cluster->cpu->levels[idx].is_reset);

	affinity_level = PSCI_AFFINITY_LEVEL(affinity_level);
	if (!idx) {
		wfi();
		return 1;
	}

	state_id |= (power_state | affinity_level
				| cluster->cpu->levels[idx].psci_id);

	return !cpu_suspend(state_id);
}
#else
bool psci_enter_sleep(struct lpm_cluster *cluster, int idx, bool from_idle)
{
	WARN_ONCE(true, "PSCI cpu_suspend ops not supported on V7\n");
	WARN_ONCE(true, "PSCI cpu_suspend ops not supported\n");
	return false;
}
#endif