From: Abhilash Kesavan <a.kesavan@samsung.com> To: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kgene.kim@samsung.com, abrestic@chromium.org, thomas.ab@samsung.com, inderpal.s@samsung.com, lorenzo.pieralisi@arm.com, nicolas.pitre@linaro.org, Dave.Martin@arm.com, t.figa@samsung.com Cc: kesavan.abhilash@gmail.com, Leela Krishna Amudala <leela.krishna@linaro.org>, Abhilash Kesavan <a.kesavan@samsung.com> Subject: [PATCH v6 1/5] ARM: EXYNOS: Add generic cpu power control functions for all exynos based SoCs Date: Tue, 13 May 2014 17:28:40 +0530 [thread overview] Message-ID: <1399982324-27879-2-git-send-email-a.kesavan@samsung.com> (raw) In-Reply-To: <1399982324-27879-1-git-send-email-a.kesavan@samsung.com> From: Leela Krishna Amudala <leela.krishna@linaro.org> 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> Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com> --- 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 278b573..20adc2c 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h @@ -132,6 +132,9 @@ struct exynos_pmu_conf { }; extern void exynos_sys_powerdown_conf(enum sys_powerdown mode); +extern void exynos_cpu_power_down(int cpu); +extern void exynos_cpu_power_up(int cpu); +extern int exynos_cpu_power_state(int cpu); extern void s5p_init_cpu(void __iomem *cpuid_addr); extern unsigned int samsung_rev(void); diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c index ca672e2..60c3356 100644 --- a/arch/arm/mach-exynos/pm.c +++ b/arch/arm/mach-exynos/pm.c @@ -99,6 +99,42 @@ static int exynos_irq_set_wake(struct irq_data *data, unsigned int state) return -ENOENT; } +/** + * exynos_core_power_down : power down the specified cpu + * @cpu : the cpu to power down + * + * Power down the specified cpu. The sequence must be finished by a + * call to cpu_do_idle() + * + */ +void exynos_cpu_power_down(int cpu) +{ + __raw_writel(0, EXYNOS_ARM_CORE_CONFIGURATION(cpu)); +} + +/** + * exynos_cpu_power_up : power up the specified cpu + * @cpu : the cpu to power up + * + * Power up the specified cpu + */ +void exynos_cpu_power_up(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..84634ac 100644 --- a/arch/arm/mach-exynos/regs-pmu.h +++ b/arch/arm/mach-exynos/regs-pmu.h @@ -105,6 +105,12 @@ #define S5P_GPS_LOWPWR S5P_PMUREG(0x139C) #define S5P_GPS_ALIVE_LOWPWR S5P_PMUREG(0x13A0) +#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) + #define S5P_ARM_CORE1_CONFIGURATION S5P_PMUREG(0x2080) #define S5P_ARM_CORE1_STATUS S5P_PMUREG(0x2084) -- 1.7.9.5
WARNING: multiple messages have this Message-ID (diff)
From: a.kesavan@samsung.com (Abhilash Kesavan) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v6 1/5] ARM: EXYNOS: Add generic cpu power control functions for all exynos based SoCs Date: Tue, 13 May 2014 17:28:40 +0530 [thread overview] Message-ID: <1399982324-27879-2-git-send-email-a.kesavan@samsung.com> (raw) In-Reply-To: <1399982324-27879-1-git-send-email-a.kesavan@samsung.com> From: Leela Krishna Amudala <leela.krishna@linaro.org> 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> Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com> --- 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 278b573..20adc2c 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h @@ -132,6 +132,9 @@ struct exynos_pmu_conf { }; extern void exynos_sys_powerdown_conf(enum sys_powerdown mode); +extern void exynos_cpu_power_down(int cpu); +extern void exynos_cpu_power_up(int cpu); +extern int exynos_cpu_power_state(int cpu); extern void s5p_init_cpu(void __iomem *cpuid_addr); extern unsigned int samsung_rev(void); diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c index ca672e2..60c3356 100644 --- a/arch/arm/mach-exynos/pm.c +++ b/arch/arm/mach-exynos/pm.c @@ -99,6 +99,42 @@ static int exynos_irq_set_wake(struct irq_data *data, unsigned int state) return -ENOENT; } +/** + * exynos_core_power_down : power down the specified cpu + * @cpu : the cpu to power down + * + * Power down the specified cpu. The sequence must be finished by a + * call to cpu_do_idle() + * + */ +void exynos_cpu_power_down(int cpu) +{ + __raw_writel(0, EXYNOS_ARM_CORE_CONFIGURATION(cpu)); +} + +/** + * exynos_cpu_power_up : power up the specified cpu + * @cpu : the cpu to power up + * + * Power up the specified cpu + */ +void exynos_cpu_power_up(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..84634ac 100644 --- a/arch/arm/mach-exynos/regs-pmu.h +++ b/arch/arm/mach-exynos/regs-pmu.h @@ -105,6 +105,12 @@ #define S5P_GPS_LOWPWR S5P_PMUREG(0x139C) #define S5P_GPS_ALIVE_LOWPWR S5P_PMUREG(0x13A0) +#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) + #define S5P_ARM_CORE1_CONFIGURATION S5P_PMUREG(0x2080) #define S5P_ARM_CORE1_STATUS S5P_PMUREG(0x2084) -- 1.7.9.5
next prev parent reply other threads:[~2014-05-13 11:58 UTC|newest] Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-05-13 11:58 [PATCH v6 0/5] MCPM backend for Exynos5420 Abhilash Kesavan 2014-05-13 11:58 ` Abhilash Kesavan 2014-05-13 11:58 ` Abhilash Kesavan [this message] 2014-05-13 11:58 ` [PATCH v6 1/5] ARM: EXYNOS: Add generic cpu power control functions for all exynos based SoCs Abhilash Kesavan 2014-05-13 11:58 ` [PATCH v6 2/5] ARM: EXYNOS: use generic exynos cpu power control functions Abhilash Kesavan 2014-05-13 11:58 ` Abhilash Kesavan 2014-05-13 11:58 ` [PATCH v6 3/5] arm: exynos: Add generic cluster " Abhilash Kesavan 2014-05-13 11:58 ` Abhilash Kesavan 2014-05-13 11:58 ` [PATCH v6 4/5] ARM: dts: exynos5420: add CCI node Abhilash Kesavan 2014-05-13 11:58 ` Abhilash Kesavan 2014-05-13 11:58 ` [PATCH v6 5/5] arm: exynos: Add MCPM call-back functions Abhilash Kesavan 2014-05-13 11:58 ` Abhilash Kesavan 2014-05-13 16:48 ` Lorenzo Pieralisi 2014-05-13 16:48 ` Lorenzo Pieralisi 2014-05-14 2:44 ` Abhilash Kesavan 2014-05-14 2:44 ` Abhilash Kesavan 2014-05-14 2:54 ` Chander Kashyap 2014-05-14 2:54 ` Chander Kashyap 2014-05-14 3:02 ` Abhilash Kesavan 2014-05-14 3:02 ` Abhilash Kesavan 2014-05-14 3:02 ` Nicolas Pitre 2014-05-14 3:02 ` Nicolas Pitre 2014-05-14 3:20 ` Chander Kashyap 2014-05-14 3:20 ` Chander Kashyap 2014-05-14 3:34 ` Nicolas Pitre 2014-05-14 3:34 ` Nicolas Pitre 2014-05-14 7:24 ` [PATCH v7 " Abhilash Kesavan 2014-05-14 7:24 ` Abhilash Kesavan 2014-05-13 17:55 ` [PATCH v6 0/5] MCPM backend for Exynos5420 Nicolas Pitre 2014-05-13 17:55 ` Nicolas Pitre 2014-05-14 4:15 ` Abhilash Kesavan 2014-05-14 4:15 ` Abhilash Kesavan 2014-05-14 4:45 ` Nicolas Pitre 2014-05-14 4:45 ` Nicolas Pitre 2014-05-14 7:34 ` Abhilash Kesavan 2014-05-14 7:34 ` Abhilash Kesavan 2014-05-14 13:33 ` Nicolas Pitre 2014-05-14 13:33 ` Nicolas Pitre 2014-05-14 13:39 ` Abhilash Kesavan 2014-05-14 13:39 ` Abhilash Kesavan 2014-05-15 15:49 ` Abhilash Kesavan 2014-05-15 15:49 ` Abhilash Kesavan 2014-05-15 16:52 ` Nicolas Pitre 2014-05-15 16:52 ` Nicolas Pitre 2014-05-16 23:55 ` Kukjin Kim 2014-05-16 23:55 ` Kukjin Kim 2014-05-19 2:38 ` Abhilash Kesavan 2014-05-19 2:38 ` Abhilash Kesavan 2014-05-19 2:38 ` Abhilash Kesavan 2014-05-19 2:38 ` Abhilash Kesavan 2014-05-20 3:30 ` Nicolas Pitre 2014-05-20 3:30 ` Nicolas Pitre 2014-05-20 4:42 ` Abhilash Kesavan 2014-05-20 4:42 ` Abhilash Kesavan
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1399982324-27879-2-git-send-email-a.kesavan@samsung.com \ --to=a.kesavan@samsung.com \ --cc=Dave.Martin@arm.com \ --cc=abrestic@chromium.org \ --cc=inderpal.s@samsung.com \ --cc=kesavan.abhilash@gmail.com \ --cc=kgene.kim@samsung.com \ --cc=leela.krishna@linaro.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-samsung-soc@vger.kernel.org \ --cc=lorenzo.pieralisi@arm.com \ --cc=nicolas.pitre@linaro.org \ --cc=t.figa@samsung.com \ --cc=thomas.ab@samsung.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.