ARM: firmware: add AFTR mode support to firmware do_idle method
On some platforms (i.e. EXYNOS ones) more than one idle mode is available and we need to distinguish them in firmware do_idle method. Add mode parameter to do_idle firmware method and AFTR mode support to EXYNOS do_idle implementation. This change is a preparation for adding secure firmware support to EXYNOS cpuidle driver. This patch shouldn't cause any functionality changes. Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
This commit is contained in:
parent
134abc297e
commit
0b7778a801
4 changed files with 15 additions and 4 deletions
|
@ -28,7 +28,7 @@ struct firmware_ops {
|
||||||
/*
|
/*
|
||||||
* Enters CPU idle mode
|
* Enters CPU idle mode
|
||||||
*/
|
*/
|
||||||
int (*do_idle)(void);
|
int (*do_idle)(unsigned long mode);
|
||||||
/*
|
/*
|
||||||
* Sets boot address of specified physical CPU
|
* Sets boot address of specified physical CPU
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -119,6 +119,11 @@ extern void __iomem *sysram_base_addr;
|
||||||
extern void __iomem *pmu_base_addr;
|
extern void __iomem *pmu_base_addr;
|
||||||
void exynos_sysram_init(void);
|
void exynos_sysram_init(void);
|
||||||
|
|
||||||
|
enum {
|
||||||
|
FW_DO_IDLE_SLEEP,
|
||||||
|
FW_DO_IDLE_AFTR,
|
||||||
|
};
|
||||||
|
|
||||||
void exynos_firmware_init(void);
|
void exynos_firmware_init(void);
|
||||||
|
|
||||||
extern u32 exynos_get_eint_wake_mask(void);
|
extern u32 exynos_get_eint_wake_mask(void);
|
||||||
|
|
|
@ -28,9 +28,15 @@
|
||||||
#define EXYNOS_BOOT_ADDR 0x8
|
#define EXYNOS_BOOT_ADDR 0x8
|
||||||
#define EXYNOS_BOOT_FLAG 0xc
|
#define EXYNOS_BOOT_FLAG 0xc
|
||||||
|
|
||||||
static int exynos_do_idle(void)
|
static int exynos_do_idle(unsigned long mode)
|
||||||
{
|
{
|
||||||
exynos_smc(SMC_CMD_SLEEP, 0, 0, 0);
|
switch (mode) {
|
||||||
|
case FW_DO_IDLE_AFTR:
|
||||||
|
exynos_smc(SMC_CMD_CPU0AFTR, 0, 0, 0);
|
||||||
|
break;
|
||||||
|
case FW_DO_IDLE_SLEEP:
|
||||||
|
exynos_smc(SMC_CMD_SLEEP, 0, 0, 0);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ static int tegra114_idle_power_down(struct cpuidle_device *dev,
|
||||||
call_firmware_op(prepare_idle);
|
call_firmware_op(prepare_idle);
|
||||||
|
|
||||||
/* Do suspend by ourselves if the firmware does not implement it */
|
/* Do suspend by ourselves if the firmware does not implement it */
|
||||||
if (call_firmware_op(do_idle) == -ENOSYS)
|
if (call_firmware_op(do_idle, 0) == -ENOSYS)
|
||||||
cpu_suspend(0, tegra30_sleep_cpu_secondary_finish);
|
cpu_suspend(0, tegra30_sleep_cpu_secondary_finish);
|
||||||
|
|
||||||
clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &dev->cpu);
|
clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &dev->cpu);
|
||||||
|
|
Loading…
Reference in a new issue