* [PATCH v2 0/2] Enable SCU standby support at core level
@ 2014-07-25 8:09 Shawn Guo
2014-07-25 8:09 ` [PATCH v2 1/2] ARM: smp_scu: use macro for SCU enable bit Shawn Guo
2014-07-25 8:09 ` [PATCH v2 2/2] ARM: smp_scu: enable SCU standby support Shawn Guo
0 siblings, 2 replies; 6+ messages in thread
From: Shawn Guo @ 2014-07-25 8:09 UTC (permalink / raw)
To: linux-arm-kernel
Changes since v1:
- Check earlier revsions of Cortex-A9 and skip setting standby bit
- Drop i.MX platform patch, which will be handled after core change
gets accepted
Shawn Guo (2):
ARM: smp_scu: use macro for SCU enable bit
ARM: smp_scu: enable SCU standby support
arch/arm/kernel/smp_scu.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/2] ARM: smp_scu: use macro for SCU enable bit
2014-07-25 8:09 [PATCH v2 0/2] Enable SCU standby support at core level Shawn Guo
@ 2014-07-25 8:09 ` Shawn Guo
2014-07-30 15:40 ` Sören Brinkmann
2014-07-25 8:09 ` [PATCH v2 2/2] ARM: smp_scu: enable SCU standby support Shawn Guo
1 sibling, 1 reply; 6+ messages in thread
From: Shawn Guo @ 2014-07-25 8:09 UTC (permalink / raw)
To: linux-arm-kernel
Use macro instead of magic number for SCU enable bit.
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
---
arch/arm/kernel/smp_scu.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/arm/kernel/smp_scu.c b/arch/arm/kernel/smp_scu.c
index 1aafa0d785eb..c947508f84e6 100644
--- a/arch/arm/kernel/smp_scu.c
+++ b/arch/arm/kernel/smp_scu.c
@@ -17,6 +17,7 @@
#include <asm/cputype.h>
#define SCU_CTRL 0x00
+#define SCU_ENABLE (1 << 0)
#define SCU_CONFIG 0x04
#define SCU_CPU_STATUS 0x08
#define SCU_INVALIDATE 0x0c
@@ -50,10 +51,10 @@ void scu_enable(void __iomem *scu_base)
scu_ctrl = readl_relaxed(scu_base + SCU_CTRL);
/* already enabled? */
- if (scu_ctrl & 1)
+ if (scu_ctrl & SCU_ENABLE)
return;
- scu_ctrl |= 1;
+ scu_ctrl |= SCU_ENABLE;
writel_relaxed(scu_ctrl, scu_base + SCU_CTRL);
/*
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 1/2] ARM: smp_scu: use macro for SCU enable bit
2014-07-25 8:09 ` [PATCH v2 1/2] ARM: smp_scu: use macro for SCU enable bit Shawn Guo
@ 2014-07-30 15:40 ` Sören Brinkmann
0 siblings, 0 replies; 6+ messages in thread
From: Sören Brinkmann @ 2014-07-30 15:40 UTC (permalink / raw)
To: linux-arm-kernel
Hi Shawn,
On Fri, 2014-07-25 at 04:09PM +0800, Shawn Guo wrote:
> Use macro instead of magic number for SCU enable bit.
>
> Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
> ---
> arch/arm/kernel/smp_scu.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/kernel/smp_scu.c b/arch/arm/kernel/smp_scu.c
> index 1aafa0d785eb..c947508f84e6 100644
> --- a/arch/arm/kernel/smp_scu.c
> +++ b/arch/arm/kernel/smp_scu.c
> @@ -17,6 +17,7 @@
> #include <asm/cputype.h>
>
> #define SCU_CTRL 0x00
> +#define SCU_ENABLE (1 << 0)
I'd prefer using 'BIT(0)' here (and accordingly in the second patch).
For both patches:
Acked-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
S?ren
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 2/2] ARM: smp_scu: enable SCU standby support
2014-07-25 8:09 [PATCH v2 0/2] Enable SCU standby support at core level Shawn Guo
2014-07-25 8:09 ` [PATCH v2 1/2] ARM: smp_scu: use macro for SCU enable bit Shawn Guo
@ 2014-07-25 8:09 ` Shawn Guo
2014-07-29 12:44 ` Shawn Guo
1 sibling, 1 reply; 6+ messages in thread
From: Shawn Guo @ 2014-07-25 8:09 UTC (permalink / raw)
To: linux-arm-kernel
With SCU standby enabled, SCU CLK will be turned off when all processors
are in WFI mode. And the clock will be turned on when any processor
leaves WFI mode.
This behavior should be preferable in terms of power efficiency of
system idle. So let's set the SCU standby bit to enable the support in
function scu_enable().
Cortex-A9 earlier than r2p0 has no standby bit in SCU, so we need to
skip setting the bit for those.
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
---
arch/arm/kernel/smp_scu.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm/kernel/smp_scu.c b/arch/arm/kernel/smp_scu.c
index c947508f84e6..72f9241ad5db 100644
--- a/arch/arm/kernel/smp_scu.c
+++ b/arch/arm/kernel/smp_scu.c
@@ -18,6 +18,7 @@
#define SCU_CTRL 0x00
#define SCU_ENABLE (1 << 0)
+#define SCU_STANDBY_ENABLE (1 << 5)
#define SCU_CONFIG 0x04
#define SCU_CPU_STATUS 0x08
#define SCU_INVALIDATE 0x0c
@@ -55,6 +56,12 @@ void scu_enable(void __iomem *scu_base)
return;
scu_ctrl |= SCU_ENABLE;
+
+ /* Cortex-A9 earlier than r2p0 has no standby bit in SCU */
+ if ((read_cpuid_id() & 0xff0ffff0) == 0x410fc090 &&
+ (read_cpuid_id() & 0x00f0000f) >= 0x00200000)
+ scu_ctrl |= SCU_STANDBY_ENABLE;
+
writel_relaxed(scu_ctrl, scu_base + SCU_CTRL);
/*
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/2] ARM: smp_scu: enable SCU standby support
2014-07-25 8:09 ` [PATCH v2 2/2] ARM: smp_scu: enable SCU standby support Shawn Guo
@ 2014-07-29 12:44 ` Shawn Guo
2014-07-31 1:10 ` Shawn Guo
0 siblings, 1 reply; 6+ messages in thread
From: Shawn Guo @ 2014-07-29 12:44 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Jul 25, 2014 at 04:09:50PM +0800, Shawn Guo wrote:
> With SCU standby enabled, SCU CLK will be turned off when all processors
> are in WFI mode. And the clock will be turned on when any processor
> leaves WFI mode.
>
> This behavior should be preferable in terms of power efficiency of
> system idle. So let's set the SCU standby bit to enable the support in
> function scu_enable().
>
> Cortex-A9 earlier than r2p0 has no standby bit in SCU, so we need to
> skip setting the bit for those.
>
> Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
If there is no objection on the patch, I will put it into patch tracker
soon.
Russell,
I know it's late for 3.17 at this point, and I'm fine that you queue it
for 3.18.
Shawn
> ---
> arch/arm/kernel/smp_scu.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/arch/arm/kernel/smp_scu.c b/arch/arm/kernel/smp_scu.c
> index c947508f84e6..72f9241ad5db 100644
> --- a/arch/arm/kernel/smp_scu.c
> +++ b/arch/arm/kernel/smp_scu.c
> @@ -18,6 +18,7 @@
>
> #define SCU_CTRL 0x00
> #define SCU_ENABLE (1 << 0)
> +#define SCU_STANDBY_ENABLE (1 << 5)
> #define SCU_CONFIG 0x04
> #define SCU_CPU_STATUS 0x08
> #define SCU_INVALIDATE 0x0c
> @@ -55,6 +56,12 @@ void scu_enable(void __iomem *scu_base)
> return;
>
> scu_ctrl |= SCU_ENABLE;
> +
> + /* Cortex-A9 earlier than r2p0 has no standby bit in SCU */
> + if ((read_cpuid_id() & 0xff0ffff0) == 0x410fc090 &&
> + (read_cpuid_id() & 0x00f0000f) >= 0x00200000)
> + scu_ctrl |= SCU_STANDBY_ENABLE;
> +
> writel_relaxed(scu_ctrl, scu_base + SCU_CTRL);
>
> /*
> --
> 1.9.1
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 2/2] ARM: smp_scu: enable SCU standby support
2014-07-29 12:44 ` Shawn Guo
@ 2014-07-31 1:10 ` Shawn Guo
0 siblings, 0 replies; 6+ messages in thread
From: Shawn Guo @ 2014-07-31 1:10 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Jul 29, 2014 at 08:44:11PM +0800, Shawn Guo wrote:
> On Fri, Jul 25, 2014 at 04:09:50PM +0800, Shawn Guo wrote:
> > With SCU standby enabled, SCU CLK will be turned off when all processors
> > are in WFI mode. And the clock will be turned on when any processor
> > leaves WFI mode.
> >
> > This behavior should be preferable in terms of power efficiency of
> > system idle. So let's set the SCU standby bit to enable the support in
> > function scu_enable().
> >
> > Cortex-A9 earlier than r2p0 has no standby bit in SCU, so we need to
> > skip setting the bit for those.
> >
> > Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
>
> If there is no objection on the patch, I will put it into patch tracker
> soon.
Submitted these two patches as #8121 and #8122.
Shawn
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-07-31 1:10 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-25 8:09 [PATCH v2 0/2] Enable SCU standby support at core level Shawn Guo
2014-07-25 8:09 ` [PATCH v2 1/2] ARM: smp_scu: use macro for SCU enable bit Shawn Guo
2014-07-30 15:40 ` Sören Brinkmann
2014-07-25 8:09 ` [PATCH v2 2/2] ARM: smp_scu: enable SCU standby support Shawn Guo
2014-07-29 12:44 ` Shawn Guo
2014-07-31 1:10 ` Shawn Guo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).