]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
ARM: smp_scu: enable SCU standby support
authorShawn Guo <shawn.guo@freescale.com>
Fri, 25 Jul 2014 08:09:50 +0000 (16:09 +0800)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 30 Jul 2014 11:21:41 +0000 (13:21 +0200)
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>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arch/arm/kernel/smp_scu.c

index c947508f84e682059ea475db11cbc9dffbc1111d..72f9241ad5dba5eb42fe7d5e5e31be456a96ad97 100644 (file)
@@ -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);
 
        /*