Beispiel #1
0
/*
 * bl_enter_powerdown - Programs CPU to enter the specified state
 * @dev: cpuidle device
 * @drv: The target state to be programmed
 * @idx: state index
 *
 * Called from the CPUidle framework to program the device to the
 * specified target state selected by the governor.
 */
static int bl_enter_powerdown(struct cpuidle_device *dev,
				struct cpuidle_driver *drv, int idx)
{
	struct timespec ts_preidle, ts_postidle, ts_idle;
	int ret;

	/* Used to keep track of the total time in idle */
	getnstimeofday(&ts_preidle);

	BUG_ON(!irqs_disabled());

	cpu_pm_enter();

	clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &dev->cpu);

	ret = cpu_suspend((unsigned long) dev, bl_powerdown_finisher);
	if (ret)
		BUG();

	mcpm_cpu_powered_up();

	clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &dev->cpu);

	cpu_pm_exit();

	getnstimeofday(&ts_postidle);
	local_irq_enable();
	ts_idle = timespec_sub(ts_postidle, ts_preidle);

	dev->last_residency = ts_idle.tv_nsec / NSEC_PER_USEC +
					ts_idle.tv_sec * USEC_PER_SEC;
	return idx;
}
/*
static int notrace mcpm_powerdown_finisher(unsigned long arg)
{
	u32 mpidr = read_cpuid_mpidr();
	u32 cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0);
	u32 this_cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);

	mcpm_set_entry_vector(cpu, this_cluster, cpu_resume);
	mcpm_cpu_suspend(arg);
	return 1;
}
*/
static int mmp_pm_enter(suspend_state_t state)
{
	unsigned int real_idx = mmp_suspend->suspend_state;

#ifdef CONFIG_SEC_GPIO_DVS
	/************************ Caution !!! ****************************
	This function must be located in appropriate SLEEP position
	in accordance with the specification of each BB vendor.
	************************ Caution !!! ****************************/
	gpio_dvs_check_sleepgpio();
#endif

	if (mmp_suspend->ops->pre_suspend_check) {
		if (mmp_suspend->ops->pre_suspend_check())
			return -EAGAIN;
	}

	cpu_suspend((unsigned long)&real_idx);

	if (mmp_suspend->ops->post_chk_wakeup)
		detect_wakeup_status = mmp_suspend->ops->post_chk_wakeup();

	if (mmp_suspend->ops->post_clr_wakeup)
		mmp_suspend->ops->post_clr_wakeup(detect_wakeup_status);

	if (real_idx != mmp_suspend->suspend_state)
		pr_info("WARNING!!! Suspend Didn't enter the Expected Low power mode\n");

	mcpm_cpu_powered_up();

	return 0;
}
Beispiel #3
0
/**
 * bl_enter_powerdown - Programs CPU to enter the specified state
 * @dev: cpuidle device
 * @drv: The target state to be programmed
 * @idx: state index
 *
 * Called from the CPUidle framework to program the device to the
 * specified target state selected by the governor.
 */
static int bl_enter_powerdown(struct cpuidle_device *dev,
				struct cpuidle_driver *drv, int idx)
{
	cpu_pm_enter();

	cpu_suspend(0, bl_powerdown_finisher);

	/* signals the MCPM core that CPU is out of low power state */
	mcpm_cpu_powered_up();

	cpu_pm_exit();

	return idx;
}
/*
 * mcpm_enter_powerdown - Programs CPU to enter the specified state
 *
 * @dev: cpuidle device
 * @drv: cpuidle driver
 * @idx: state index
 *
 * Called from the CPUidle framework to program the device to the
 * specified target state selected by the governor.
 */
static int mmp_enter_powerdown(struct cpuidle_device *dev,
			       struct cpuidle_driver *drv, int idx)
{
	int ret;

	BUG_ON(!idx);

	cpu_pm_enter();

	ret = cpu_suspend((unsigned long)&idx, mcpm_powerdown_finisher);
	if (ret)
		pr_err("cpu%d failed to enter power down!", dev->cpu);

	mcpm_cpu_powered_up();

	cpu_pm_exit();

	return idx;
}
static void __cpuinit mcpm_secondary_init(unsigned int cpu)
{
	mcpm_cpu_powered_up();
	gic_secondary_init(0);
}
Beispiel #6
0
static void exynos5420_prepare_pm_resume(void)
{
	if (IS_ENABLED(CONFIG_EXYNOS5420_MCPM))
		WARN_ON(mcpm_cpu_powered_up());
}
Beispiel #7
0
static void mcpm_secondary_init(unsigned int cpu)
{
	mcpm_cpu_powered_up();
}