11 #include <linux/kernel.h>
16 #include <linux/export.h>
17 #include <linux/time.h>
19 #include <asm/proc-fns.h>
21 #include <asm/suspend.h>
29 #define REG_DIRECTGO_ADDR (samsung_rev() == EXYNOS4210_REV_1_1 ? \
30 S5P_INFORM7 : (samsung_rev() == EXYNOS4210_REV_1_0 ? \
31 (S5P_VA_SYSRAM + 0x24) : S5P_INFORM0))
32 #define REG_DIRECTGO_FLAG (samsung_rev() == EXYNOS4210_REV_1_1 ? \
33 S5P_INFORM6 : (samsung_rev() == EXYNOS4210_REV_1_0 ? \
34 (S5P_VA_SYSRAM + 0x20) : S5P_INFORM1))
36 #define S5P_CHECK_AFTR 0xFCBA0D10
45 .enter = exynos4_enter_lowpower,
47 .target_residency = 100000,
50 .desc =
"ARM power down",
57 .name =
"exynos4_idle",
59 .en_core_tk_irqen = 1,
63 static void exynos4_set_wakeupmask(
void)
68 static unsigned int g_pwr_ctrl, g_diag_reg;
70 static void save_cpu_arch_register(
void)
73 asm(
"mrc p15, 0, %0, c15, c0, 0" :
"=r"(g_pwr_ctrl) : :
"cc");
75 asm(
"mrc p15, 0, %0, c15, c0, 1" :
"=r"(g_diag_reg) : :
"cc");
79 static void restore_cpu_arch_register(
void)
82 asm(
"mcr p15, 0, %0, c15, c0, 0" : :
"r"(g_pwr_ctrl) :
"cc");
84 asm(
"mcr p15, 0, %0, c15, c0, 1" : :
"r"(g_diag_reg) :
"cc");
88 static int idle_finisher(
unsigned long flags)
100 exynos4_set_wakeupmask();
108 save_cpu_arch_register();
123 restore_cpu_arch_register();
147 int new_index =
index;
156 return exynos4_enter_core0_aftr(dev, drv, new_index);
159 static int __init exynos4_init_cpuidle(
void)
161 int i, max_cpuidle_state,
cpu_id;
169 for (i = 0; i < max_cpuidle_state; i++) {
177 device = &
per_cpu(exynos4_cpuidle_device, cpu_id);
181 device->
state_count = (
sizeof(exynos4_cpuidle_set) /