コード例 #1
0
ファイル: exynos-powermode.c プロジェクト: 1paul1/dynamite
void wakeup_from_c2(unsigned int cpu)
{
	exynos_cpu.power_up(cpu);

	update_c2_state(false, cpu);

	if (!get_cluster_id(cpu))
		exynos_cpu_sequencer_ctrl(false);
}
コード例 #2
0
ファイル: exynos-powermode.c プロジェクト: 1paul1/dynamite
int enter_c2(unsigned int cpu, int index, int *sub_state)
{
	exynos_cpu.power_down(cpu);

	spin_lock(&c2_lock);
	update_c2_state(true, cpu);

	/*
	 * This function determines whether to power down the cluster/enter LPC
	 * or not. If idle time is not enough, skip this routine.
	 */
	if (get_next_event_time_us(cpu) < min(cpd_residency, lpc_residency))
		goto out;

	/*
	 * If LPC is available, write flag to internal RAM. By this, know whether
	 * AP put into LPC or not in EL3 PSCI handler.
	 */
	if (
#ifdef CONFIG_SOC_EXYNOS7420
		get_cluster_id(cpu) &&
#endif
		is_lpc_available(lpc_residency)) {
		exynos_ss_cpuidle(EXYNOS_SS_LPC_INDEX, 0, 0, ESS_FLAG_IN);
#ifdef CONFIG_SOC_EXYNOS7420
		write_lpc_flag(ENTER_LPC);
		*sub_state |= LPC_STATE;
#endif
		s3c24xx_serial_fifo_wait();
	}

	/*
	 * Power down of LITTLE cluster have nothing to gain power consumption,
	 * so does not support. For you reference, cluster id "1" indicates LITTLE.
	 */
	if (get_cluster_id(cpu))
		goto out;

	/* If cluster is not busy, enable cpu sequcner to shutdown cluster */
	if (!is_cpus_busy(cpd_residency, cpu_coregroup_mask(cpu))) {
		exynos_cpu_sequencer_ctrl(true);
		*sub_state |= CPD_STATE;
		index++;
	}

out:
	spin_unlock(&c2_lock);

	return index;
}
コード例 #3
0
void wakeup_from_c2(unsigned int cpu)
{
	exynos_cpu.power_up(cpu);

	spin_lock(&cpd_lock);

	update_cpd_state(false, cpu);

	if (is_in_boot_cluster(cpu))
		goto unlock;

	exynos_cpu_sequencer_ctrl(false);

unlock:
	spin_unlock(&cpd_lock);
}
コード例 #4
0
int determine_cpd(int index, int c2_index, unsigned int cpu,
		  unsigned int target_residency)
{
	exynos_cpu.power_down(cpu);

	if (index == c2_index)
		return c2_index;

#ifdef CONFIG_ARM_EXYNOS_SMP_CPUFREQ
	if (disabled_cluster_power_down)
		return c2_index;
#endif

	spin_lock(&cpd_lock);

	update_cpd_state(true, cpu);

	if (is_lpc_available(target_residency)) {
		set_lpc_flag();
		s3c24xx_serial_fifo_wait();
	}

	if (is_in_boot_cluster(cpu)) {
		index = c2_index;
		goto unlock;
	}

	if (is_busy(target_residency, cpu_coregroup_mask(cpu)))
		index = c2_index;
	else
		exynos_cpu_sequencer_ctrl(true);

unlock:
	spin_unlock(&cpd_lock);

	return index;
}