Commit a25d67a4 authored by Anson Huang's avatar Anson Huang Committed by Shawn Guo

ARM: imx: add cpuidle support for i.mx6sx

Add cpuidle support for i.MX6SX, derive from i.MX6Q's
cpuidle, two levels supported:

1. WFI;
2. WAIT mode.
Signed-off-by: default avatarAnson Huang <b20788@freescale.com>
Signed-off-by: default avatarShawn Guo <shawn.guo@freescale.com>
parent ff843d62
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "common.h" #include "common.h"
#include "cpuidle.h" #include "cpuidle.h"
#include "hardware.h"
static atomic_t master = ATOMIC_INIT(0); static atomic_t master = ATOMIC_INIT(0);
static DEFINE_SPINLOCK(master_lock); static DEFINE_SPINLOCK(master_lock);
...@@ -66,6 +67,7 @@ static struct cpuidle_driver imx6q_cpuidle_driver = { ...@@ -66,6 +67,7 @@ static struct cpuidle_driver imx6q_cpuidle_driver = {
int __init imx6q_cpuidle_init(void) int __init imx6q_cpuidle_init(void)
{ {
/* Need to enable SCU standby for entering WAIT modes */ /* Need to enable SCU standby for entering WAIT modes */
if (!cpu_is_imx6sx())
imx_scu_standby_enable(); imx_scu_standby_enable();
/* Set INT_MEM_CLK_LPM bit to get a reliable WAIT mode support */ /* Set INT_MEM_CLK_LPM bit to get a reliable WAIT mode support */
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include "common.h" #include "common.h"
#include "cpuidle.h"
static void __init imx6sx_init_machine(void) static void __init imx6sx_init_machine(void)
{ {
...@@ -38,6 +39,11 @@ static void __init imx6sx_init_irq(void) ...@@ -38,6 +39,11 @@ static void __init imx6sx_init_irq(void)
irqchip_init(); irqchip_init();
} }
static void __init imx6sx_init_late(void)
{
imx6q_cpuidle_init();
}
static const char *imx6sx_dt_compat[] __initconst = { static const char *imx6sx_dt_compat[] __initconst = {
"fsl,imx6sx", "fsl,imx6sx",
NULL, NULL,
...@@ -48,5 +54,6 @@ DT_MACHINE_START(IMX6SX, "Freescale i.MX6 SoloX (Device Tree)") ...@@ -48,5 +54,6 @@ DT_MACHINE_START(IMX6SX, "Freescale i.MX6 SoloX (Device Tree)")
.init_irq = imx6sx_init_irq, .init_irq = imx6sx_init_irq,
.init_machine = imx6sx_init_machine, .init_machine = imx6sx_init_machine,
.dt_compat = imx6sx_dt_compat, .dt_compat = imx6sx_dt_compat,
.init_late = imx6sx_init_late,
.restart = mxc_restart, .restart = mxc_restart,
MACHINE_END MACHINE_END
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment