ARM: EXYNOS: use generic exynos cpu power control functions
authorLeela Krishna Amudala <leela.krishna@linaro.org>
Thu, 15 May 2014 19:23:25 +0000 (04:23 +0900)
committerKukjin Kim <kgene.kim@samsung.com>
Thu, 15 May 2014 19:24:50 +0000 (04:24 +0900)
Use generic exynos cpu power control functions to power up/down
and to know the status of the cpu in platsmp and hotplug code.

Signed-off-by: Leela Krishna Amudala <leela.krishna@linaro.org>
Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
arch/arm/mach-exynos/hotplug.c
arch/arm/mach-exynos/platsmp.c
arch/arm/mach-exynos/regs-pmu.h

index 5eead530c6f8fa57ab8444911b19b684ef1e84fc..609c99ca59c44f7a5814a1696ceebe5982fa5837 100644 (file)
@@ -96,7 +96,7 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
 
                /* make cpu1 to be turned off at next WFI command */
                if (cpu == 1)
-                       __raw_writel(0, S5P_ARM_CORE1_CONFIGURATION);
+                       exynos_cpu_power_down(cpu);
 
                /*
                 * here's the WFI
index c11c5418e0fc9ee80fd857b5a5fa15065a633df0..78002c7344b349510e3bcd7cb36c1b1bd5a81d0c 100644 (file)
@@ -133,15 +133,12 @@ static int exynos_boot_secondary(unsigned int cpu, struct task_struct *idle)
         */
        write_pen_release(phys_cpu);
 
-       if (!(__raw_readl(S5P_ARM_CORE1_STATUS) & S5P_CORE_LOCAL_PWR_EN)) {
-               __raw_writel(S5P_CORE_LOCAL_PWR_EN,
-                            S5P_ARM_CORE1_CONFIGURATION);
-
+       if (!exynos_cpu_power_state(cpu)) {
+               exynos_cpu_power_up(cpu);
                timeout = 10;
 
                /* wait max 10 ms until cpu1 is on */
-               while ((__raw_readl(S5P_ARM_CORE1_STATUS)
-                       & S5P_CORE_LOCAL_PWR_EN) != S5P_CORE_LOCAL_PWR_EN) {
+               while (exynos_cpu_power_state(cpu) != S5P_CORE_LOCAL_PWR_EN) {
                        if (timeout-- == 0)
                                break;
 
index 84634ac5b1274f331e2ba3619c477aa394f005a6..98fb8d8715e6f890cb52a3423da67bb4ce84f85d 100644 (file)
 #define EXYNOS_ARM_CORE_STATUS(_nr)            \
                        (EXYNOS_ARM_CORE_CONFIGURATION(_nr) + 0x4)
 
-#define S5P_ARM_CORE1_CONFIGURATION            S5P_PMUREG(0x2080)
-#define S5P_ARM_CORE1_STATUS                   S5P_PMUREG(0x2084)
-
 #define S5P_PAD_RET_MAUDIO_OPTION              S5P_PMUREG(0x3028)
 #define S5P_PAD_RET_GPIO_OPTION                        S5P_PMUREG(0x3108)
 #define S5P_PAD_RET_UART_OPTION                        S5P_PMUREG(0x3128)