* [PATCH 0/2] Add generic cpu power control functions for exynos
@ 2014-04-24 9:31 Leela Krishna Amudala
2014-04-24 9:31 ` [PATCH 1/2] ARM: EXYNOS: Add generic cpu power control functions for all exynos based SoCs Leela Krishna Amudala
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Leela Krishna Amudala @ 2014-04-24 9:31 UTC (permalink / raw)
To: linux-pm, linux-samsung-soc, linux-kernel, linux-arm-kernel
Cc: daniel.lezcano, nicolas.pitre, kgene.kim, amit.kucheria
This patchset adds the generic cpu power control functions for
exynos based SoCs to power up/down and to know the status of the cpu.
Note: This series has been rebased on 3.15-rc1 and tested on
Exynos based Origen(Cortex-A9) and Arndale-octa(Cortex A7,A15) boards.
Leela Krishna Amudala (2):
ARM: EXYNOS: Add generic cpu power control functions for all exynos
based SoCs
ARM: EXYNOS: use generic exynos cpu power control functions
arch/arm/mach-exynos/common.h | 3 +++
arch/arm/mach-exynos/platsmp.c | 9 +++------
arch/arm/mach-exynos/pm.c | 36 ++++++++++++++++++++++++++++++++++++
arch/arm/mach-exynos/regs-pmu.h | 6 ++++++
4 files changed, 48 insertions(+), 6 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 1/2] ARM: EXYNOS: Add generic cpu power control functions for all exynos based SoCs 2014-04-24 9:31 [PATCH 0/2] Add generic cpu power control functions for exynos Leela Krishna Amudala @ 2014-04-24 9:31 ` Leela Krishna Amudala 2014-04-24 9:31 ` [PATCH 2/2] ARM: EXYNOS: use generic exynos cpu power control functions Leela Krishna Amudala 2014-04-24 9:54 ` [PATCH 0/2] Add generic cpu power control functions for exynos Daniel Lezcano 2 siblings, 0 replies; 6+ messages in thread From: Leela Krishna Amudala @ 2014-04-24 9:31 UTC (permalink / raw) To: linux-pm, linux-samsung-soc, linux-kernel, linux-arm-kernel Cc: daniel.lezcano, nicolas.pitre, kgene.kim, amit.kucheria Add generic cpu power control functions for exynos based SoCS for cpu power up/down and to know the cpu status. Signed-off-by: Leela Krishna Amudala <leela.krishna@linaro.org> --- arch/arm/mach-exynos/common.h | 3 +++ arch/arm/mach-exynos/pm.c | 36 ++++++++++++++++++++++++++++++++++++ arch/arm/mach-exynos/regs-pmu.h | 6 ++++++ 3 files changed, 45 insertions(+) diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h index 9ef3f83..566f222 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h @@ -62,5 +62,8 @@ struct exynos_pmu_conf { }; extern void exynos_sys_powerdown_conf(enum sys_powerdown mode); +extern void exynos_cpu_powerdown(int cpu); +extern void exynos_cpu_powerup(int cpu); +extern int exynos_cpu_power_state(int cpu); #endif /* __ARCH_ARM_MACH_EXYNOS_COMMON_H */ diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c index 15af0ce..6651028 100644 --- a/arch/arm/mach-exynos/pm.c +++ b/arch/arm/mach-exynos/pm.c @@ -100,6 +100,42 @@ static int exynos_irq_set_wake(struct irq_data *data, unsigned int state) return -ENOENT; } +/** + * exynos_cpu_powerdown : power down the specified cpu + * @cpu : the cpu to power down + * + * Power downs the specified cpu. The sequence must be finished by a + * call to cpu_do_idle() + * + */ +void exynos_cpu_powerdown(int cpu) +{ + __raw_writel(0, EXYNOS_ARM_CORE_CONFIGURATION(cpu)); +} + +/** + * exynos_cpu_powerup : power up the specified cpu + * @cpu : the cpu to power up + * + * Power up the specified cpu + */ +void exynos_cpu_powerup(int cpu) +{ + __raw_writel(S5P_CORE_LOCAL_PWR_EN, + EXYNOS_ARM_CORE_CONFIGURATION(cpu)); +} + +/** + * exynos_cpu_power_state : returns the power state of the cpu + * @cpu : the cpu to retrieve the power state from + * + */ +int exynos_cpu_power_state(int cpu) +{ + return (__raw_readl(EXYNOS_ARM_CORE_STATUS(cpu)) & + S5P_CORE_LOCAL_PWR_EN); +} + /* For Cortex-A9 Diagnostic and Power control register */ static unsigned int save_arm_register[2]; diff --git a/arch/arm/mach-exynos/regs-pmu.h b/arch/arm/mach-exynos/regs-pmu.h index 4f6a256..0bdfcbc 100644 --- a/arch/arm/mach-exynos/regs-pmu.h +++ b/arch/arm/mach-exynos/regs-pmu.h @@ -121,6 +121,12 @@ #define S5P_CHECK_SLEEP 0x00000BAD +#define EXYNOS_ARM_CORE0_CONFIGURATION S5P_PMUREG(0x2000) +#define EXYNOS_ARM_CORE_CONFIGURATION(_nr) \ + (EXYNOS_ARM_CORE0_CONFIGURATION + (0x80 * (_nr))) +#define EXYNOS_ARM_CORE_STATUS(_nr) \ + (EXYNOS_ARM_CORE_CONFIGURATION(_nr) + 0x4) + /* Only for EXYNOS4210 */ #define S5P_CMU_CLKSTOP_LCD1_LOWPWR S5P_PMUREG(0x1154) #define S5P_CMU_RESET_LCD1_LOWPWR S5P_PMUREG(0x1174) -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] ARM: EXYNOS: use generic exynos cpu power control functions 2014-04-24 9:31 [PATCH 0/2] Add generic cpu power control functions for exynos Leela Krishna Amudala 2014-04-24 9:31 ` [PATCH 1/2] ARM: EXYNOS: Add generic cpu power control functions for all exynos based SoCs Leela Krishna Amudala @ 2014-04-24 9:31 ` Leela Krishna Amudala 2014-04-24 9:54 ` [PATCH 0/2] Add generic cpu power control functions for exynos Daniel Lezcano 2 siblings, 0 replies; 6+ messages in thread From: Leela Krishna Amudala @ 2014-04-24 9:31 UTC (permalink / raw) To: linux-pm, linux-samsung-soc, linux-kernel, linux-arm-kernel Cc: daniel.lezcano, nicolas.pitre, kgene.kim, amit.kucheria Use generic exynos cpu power control functions to power up/down and to know the status of the cpu. Signed-off-by: Leela Krishna Amudala <leela.krishna@linaro.org> --- arch/arm/mach-exynos/platsmp.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c index 03e5e9f..e3d005b 100644 --- a/arch/arm/mach-exynos/platsmp.c +++ b/arch/arm/mach-exynos/platsmp.c @@ -107,15 +107,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_powerup(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; -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 0/2] Add generic cpu power control functions for exynos 2014-04-24 9:31 [PATCH 0/2] Add generic cpu power control functions for exynos Leela Krishna Amudala 2014-04-24 9:31 ` [PATCH 1/2] ARM: EXYNOS: Add generic cpu power control functions for all exynos based SoCs Leela Krishna Amudala 2014-04-24 9:31 ` [PATCH 2/2] ARM: EXYNOS: use generic exynos cpu power control functions Leela Krishna Amudala @ 2014-04-24 9:54 ` Daniel Lezcano 2014-04-24 10:26 ` Leela Krishna Amudala 2 siblings, 1 reply; 6+ messages in thread From: Daniel Lezcano @ 2014-04-24 9:54 UTC (permalink / raw) To: Leela Krishna Amudala, linux-pm, linux-samsung-soc, linux-kernel, linux-arm-kernel Cc: nicolas.pitre, kgene.kim, amit.kucheria, Abhilash Kesavan Hi Abhilash and Leela, FYI I think you are working on similar patches. On 04/24/2014 11:31 AM, Leela Krishna Amudala wrote: > This patchset adds the generic cpu power control functions for > exynos based SoCs to power up/down and to know the status of the cpu. > > Note: This series has been rebased on 3.15-rc1 and tested on > Exynos based Origen(Cortex-A9) and Arndale-octa(Cortex A7,A15) boards. > > Leela Krishna Amudala (2): > ARM: EXYNOS: Add generic cpu power control functions for all exynos > based SoCs > ARM: EXYNOS: use generic exynos cpu power control functions > > arch/arm/mach-exynos/common.h | 3 +++ > arch/arm/mach-exynos/platsmp.c | 9 +++------ > arch/arm/mach-exynos/pm.c | 36 ++++++++++++++++++++++++++++++++++++ > arch/arm/mach-exynos/regs-pmu.h | 6 ++++++ > 4 files changed, 48 insertions(+), 6 deletions(-) > -- <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/2] Add generic cpu power control functions for exynos 2014-04-24 9:54 ` [PATCH 0/2] Add generic cpu power control functions for exynos Daniel Lezcano @ 2014-04-24 10:26 ` Leela Krishna Amudala 2014-04-26 16:07 ` Abhilash Kesavan 0 siblings, 1 reply; 6+ messages in thread From: Leela Krishna Amudala @ 2014-04-24 10:26 UTC (permalink / raw) To: Daniel Lezcano Cc: linux-pm, linux-samsung-soc, linux-kernel, linux-arm-kernel, nicolas.pitre, Kukjin Kim, Amit Kucheria, Abhilash Kesavan Hi Abhilash, If you are okay with this patchset you can rebase/merge it with your mcpm patches. Best Wishes, Leela Krishna. On Thu, Apr 24, 2014 at 3:24 PM, Daniel Lezcano <daniel.lezcano@linaro.org> wrote: > > Hi Abhilash and Leela, > > FYI I think you are working on similar patches. > > > On 04/24/2014 11:31 AM, Leela Krishna Amudala wrote: >> This patchset adds the generic cpu power control functions for >> >> exynos based SoCs to power up/down and to know the status of the cpu. >> >> Note: This series has been rebased on 3.15-rc1 and tested on >> Exynos based Origen(Cortex-A9) and Arndale-octa(Cortex A7,A15) boards. >> >> Leela Krishna Amudala (2): >> ARM: EXYNOS: Add generic cpu power control functions for all exynos >> based SoCs >> ARM: EXYNOS: use generic exynos cpu power control functions >> >> arch/arm/mach-exynos/common.h | 3 +++ >> arch/arm/mach-exynos/platsmp.c | 9 +++------ >> arch/arm/mach-exynos/pm.c | 36 >> ++++++++++++++++++++++++++++++++++++ >> arch/arm/mach-exynos/regs-pmu.h | 6 ++++++ >> 4 files changed, 48 insertions(+), 6 deletions(-) >> > > > -- > <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs > > Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | > <http://twitter.com/#!/linaroorg> Twitter | > <http://www.linaro.org/linaro-blog/> Blog > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/2] Add generic cpu power control functions for exynos 2014-04-24 10:26 ` Leela Krishna Amudala @ 2014-04-26 16:07 ` Abhilash Kesavan 0 siblings, 0 replies; 6+ messages in thread From: Abhilash Kesavan @ 2014-04-26 16:07 UTC (permalink / raw) To: Leela Krishna Amudala Cc: Daniel Lezcano, linux-pm@vger.kernel.org, linux-samsung-soc, linux-kernel@vger.kernel.org, linux-arm-kernel, nicolas.pitre, Kukjin Kim, Amit Kucheria Hi Leela, On Thu, Apr 24, 2014 at 3:56 PM, Leela Krishna Amudala <leela.krishna@linaro.org> wrote: > Hi Abhilash, > > If you are okay with this patchset you can rebase/merge it with your > mcpm patches. I have added these patches as part of my mcpm v3 patchset. Thanks, Abhilash > > Best Wishes, > Leela Krishna. > > On Thu, Apr 24, 2014 at 3:24 PM, Daniel Lezcano > <daniel.lezcano@linaro.org> wrote: >> >> Hi Abhilash and Leela, >> >> FYI I think you are working on similar patches. >> >> >> On 04/24/2014 11:31 AM, Leela Krishna Amudala wrote: >>> This patchset adds the generic cpu power control functions for >>> >>> exynos based SoCs to power up/down and to know the status of the cpu. >>> >>> Note: This series has been rebased on 3.15-rc1 and tested on >>> Exynos based Origen(Cortex-A9) and Arndale-octa(Cortex A7,A15) boards. >>> >>> Leela Krishna Amudala (2): >>> ARM: EXYNOS: Add generic cpu power control functions for all exynos >>> based SoCs >>> ARM: EXYNOS: use generic exynos cpu power control functions >>> >>> arch/arm/mach-exynos/common.h | 3 +++ >>> arch/arm/mach-exynos/platsmp.c | 9 +++------ >>> arch/arm/mach-exynos/pm.c | 36 >>> ++++++++++++++++++++++++++++++++++++ >>> arch/arm/mach-exynos/regs-pmu.h | 6 ++++++ >>> 4 files changed, 48 insertions(+), 6 deletions(-) >>> >> >> >> -- >> <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs >> >> Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | >> <http://twitter.com/#!/linaroorg> Twitter | >> <http://www.linaro.org/linaro-blog/> Blog >> ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-04-26 16:07 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-04-24 9:31 [PATCH 0/2] Add generic cpu power control functions for exynos Leela Krishna Amudala 2014-04-24 9:31 ` [PATCH 1/2] ARM: EXYNOS: Add generic cpu power control functions for all exynos based SoCs Leela Krishna Amudala 2014-04-24 9:31 ` [PATCH 2/2] ARM: EXYNOS: use generic exynos cpu power control functions Leela Krishna Amudala 2014-04-24 9:54 ` [PATCH 0/2] Add generic cpu power control functions for exynos Daniel Lezcano 2014-04-24 10:26 ` Leela Krishna Amudala 2014-04-26 16:07 ` Abhilash Kesavan
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox