ARM: imx: add cpuidle support for i.mx6sx
authorAnson Huang <b20788@freescale.com>
Fri, 20 Jun 2014 05:44:05 +0000 (13:44 +0800)
committerShawn Guo <shawn.guo@freescale.com>
Fri, 18 Jul 2014 08:10:14 +0000 (16:10 +0800)
Add cpuidle support for i.MX6SX, derive from i.MX6Q's
cpuidle, two levels supported:

1. WFI;
2. WAIT mode.

Signed-off-by: Anson Huang <b20788@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
arch/arm/mach-imx/cpuidle-imx6q.c
arch/arm/mach-imx/mach-imx6sx.c

index 6bcae047904905696c3cb0fbe238f74b1e54100f..fc0bb1eafee3159111beabd56f414b4bbfe4a5cf 100644 (file)
@@ -13,6 +13,7 @@
 
 #include "common.h"
 #include "cpuidle.h"
+#include "hardware.h"
 
 static atomic_t master = ATOMIC_INIT(0);
 static DEFINE_SPINLOCK(master_lock);
@@ -66,7 +67,8 @@ static struct cpuidle_driver imx6q_cpuidle_driver = {
 int __init imx6q_cpuidle_init(void)
 {
        /* Need to enable SCU standby for entering WAIT modes */
-       imx_scu_standby_enable();
+       if (!cpu_is_imx6sx())
+               imx_scu_standby_enable();
 
        /* Set INT_MEM_CLK_LPM bit to get a reliable WAIT mode support */
        imx6q_set_int_mem_clk_lpm();
index b7a0bdeed31c5493eb058aa9292f325d23da5a7a..74ff7d650f8abbc3889b7e0ebda85ae59e61e280 100644 (file)
@@ -12,6 +12,7 @@
 #include <asm/mach/map.h>
 
 #include "common.h"
+#include "cpuidle.h"
 
 static void __init imx6sx_init_machine(void)
 {
@@ -38,6 +39,11 @@ static void __init imx6sx_init_irq(void)
        irqchip_init();
 }
 
+static void __init imx6sx_init_late(void)
+{
+       imx6q_cpuidle_init();
+}
+
 static const char *imx6sx_dt_compat[] __initconst = {
        "fsl,imx6sx",
        NULL,
@@ -48,5 +54,6 @@ DT_MACHINE_START(IMX6SX, "Freescale i.MX6 SoloX (Device Tree)")
        .init_irq       = imx6sx_init_irq,
        .init_machine   = imx6sx_init_machine,
        .dt_compat      = imx6sx_dt_compat,
+       .init_late      = imx6sx_init_late,
        .restart        = mxc_restart,
 MACHINE_END