]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ARM: imx: add suspend support for i.mx6sx
authorAnson Huang <b20788@freescale.com>
Fri, 20 Jun 2014 05:20:54 +0000 (13:20 +0800)
committerShawn Guo <shawn.guo@freescale.com>
Sat, 21 Jun 2014 09:19:25 +0000 (17:19 +0800)
Add suspend support for i.MX6SX.

To enter suspend, echo mem > /sys/power/state.
To exit suspend, using RTC alarm or enable debug UART wakeup.

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

index 7668ff53773ffab9b6287f6d591b721aa1aa5880..50ee9c23974c2021954edb9804ab4ff4a3c8b562 100644 (file)
@@ -133,6 +133,7 @@ static inline void imx6_suspend(void __iomem *ocram_vbase) {}
 void imx6q_pm_init(void);
 void imx6dl_pm_init(void);
 void imx6sl_pm_init(void);
+void imx6sx_pm_init(void);
 void imx6q_pm_set_ccm_base(void __iomem *base);
 
 #ifdef CONFIG_PM
index 02fccf6033ac8a0993087e36fde4e81cfee0e6a5..b7a0bdeed31c5493eb058aa9292f325d23da5a7a 100644 (file)
@@ -26,6 +26,7 @@ static void __init imx6sx_init_machine(void)
        of_platform_populate(NULL, of_default_bus_match_table, NULL, parent);
 
        imx_anatop_init();
+       imx6sx_pm_init();
 }
 
 static void __init imx6sx_init_irq(void)
index 9392a8f4ef24bcbb31ad58a14623b23c6511afc1..331055b59218b76ff3c9c72c2928a6d3856a39ae 100644 (file)
@@ -129,6 +129,14 @@ static const u32 imx6sl_mmdc_io_offset[] __initconst = {
        0x330, 0x334, 0x320,        /* SDCKE0, SDCKE1, RESET */
 };
 
+static const u32 imx6sx_mmdc_io_offset[] __initconst = {
+       0x2ec, 0x2f0, 0x2f4, 0x2f8, /* DQM0 ~ DQM3 */
+       0x60c, 0x610, 0x61c, 0x620, /* GPR_B0DS ~ GPR_B3DS */
+       0x300, 0x2fc, 0x32c, 0x5f4, /* CAS, RAS, SDCLK_0, GPR_ADDS */
+       0x310, 0x314, 0x5f8, 0x608, /* SODT0, SODT1, MODE_CTL, MODE */
+       0x330, 0x334, 0x338, 0x33c, /* SDQS0 ~ SDQS3 */
+};
+
 static const struct imx6_pm_socdata imx6q_pm_data __initconst = {
        .cpu_type = MXC_CPU_IMX6Q,
        .mmdc_compat = "fsl,imx6q-mmdc",
@@ -159,6 +167,16 @@ static const struct imx6_pm_socdata imx6sl_pm_data __initconst = {
        .mmdc_io_offset = imx6sl_mmdc_io_offset,
 };
 
+static const struct imx6_pm_socdata imx6sx_pm_data __initconst = {
+       .cpu_type = MXC_CPU_IMX6SX,
+       .mmdc_compat = "fsl,imx6sx-mmdc",
+       .src_compat = "fsl,imx6sx-src",
+       .iomuxc_compat = "fsl,imx6sx-iomuxc",
+       .gpc_compat = "fsl,imx6sx-gpc",
+       .mmdc_io_num = ARRAY_SIZE(imx6sx_mmdc_io_offset),
+       .mmdc_io_offset = imx6sx_mmdc_io_offset,
+};
+
 /*
  * This structure is for passing necessary data for low level ocram
  * suspend code(arch/arm/mach-imx/suspend-imx6.S), if this struct
@@ -265,12 +283,12 @@ int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode)
                val |= 0x3 << BP_CLPCR_STBY_COUNT;
                val |= BM_CLPCR_VSTBY;
                val |= BM_CLPCR_SBYOS;
-               if (cpu_is_imx6sl()) {
+               if (cpu_is_imx6sl())
                        val |= BM_CLPCR_BYPASS_PMIC_READY;
+               if (cpu_is_imx6sl() || cpu_is_imx6sx())
                        val |= BM_CLPCR_BYP_MMDC_CH0_LPM_HS;
-               } else {
+               else
                        val |= BM_CLPCR_BYP_MMDC_CH1_LPM_HS;
-               }
                break;
        default:
                return -EINVAL;
@@ -549,3 +567,8 @@ void __init imx6sl_pm_init(void)
 {
        imx6_pm_common_init(&imx6sl_pm_data);
 }
+
+void __init imx6sx_pm_init(void)
+{
+       imx6_pm_common_init(&imx6sx_pm_data);
+}