MLK-11391 ARM: imx: make sure SNVS clk is enabled during suspend
authorAnson Huang <b20788@freescale.com>
Wed, 19 Aug 2015 17:11:42 +0000 (01:11 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:49:07 +0000 (14:49 -0500)
As SNVS clk may be disabled in kernel to save power(~1mA),
but during suspend/resume, we have to access SNVS register
to do MMDC retention and power down SoC etc.., need to
make sure SNVS clk is enabled before accessing its register.

Signed-off-by: Anson Huang <b20788@freescale.com>
arch/arm/mach-imx/suspend-imx7.S

index 566a49e..34910ad 100644 (file)
@@ -88,6 +88,8 @@
 #define DDRC_SWSTAT    0x324
 #define DDRPHY_LP_CON0 0x18
 
+#define CCM_SNVS_LPCG  0x250
+
        .align 3
 
        .macro  disable_l1_dcache
 ENTRY(imx7_suspend)
        push    {r4-r12}
 
+       /* make sure SNVS clk is enabled */
+       ldr     r11, [r0, #PM_INFO_MX7_CCM_V_OFFSET]
+       add     r11, r11, #0x4000
+       ldr     r7, =0x3
+       str     r7, [r11, #CCM_SNVS_LPCG]
+
        /* check whether it is a standby mode */
        ldr     r11, [r0, #PM_INFO_MX7_GPC_V_OFFSET]
        ldr     r7, [r11, #GPC_PGC_C0]