arm: tegra: pm: issue a pl310 cache sync for tegra2
Mayuresh Kulkarni [Thu, 15 Sep 2011 09:26:10 +0000 (14:26 +0530)]
this needs to be done when the lp2 is aborted before the
stipulated programmed time to wake-up

for bug 867094

Change-Id: I02102ed8afa69d782de5950118352e80edc79df4
Signed-off-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
Reviewed-on: http://git-master/r/52581
Reviewed-by: Jin Qian <jqian@nvidia.com>
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-by: Scott Williams <scwilliams@nvidia.com>

Rebase-Id: R5938771982b7cceb9ea23ee73852ca8b9b3490ae

arch/arm/mach-tegra/sleep-t20.S

index e718d3d..b129158 100644 (file)
@@ -60,6 +60,8 @@
 
 #define CLK_RESET_RST_CPU_CMPLX_SET    0x340
 
+#define TEGRA_PL310_VIRT       (TEGRA_ARM_PL310_BASE - IO_PPSB_PHYS + IO_PPSB_VIRT)
+
 #if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_PM_SLEEP)
 /*
  * tegra20_hotplug_shutdown(void)
@@ -247,6 +249,15 @@ ENTRY(tegra2_sleep_wfi)
 #endif
 #endif
 
+#ifdef CONFIG_CACHE_L2X0
+       /* Issue a PL310 cache sync operation */
+       dsb
+       mov32   r2, TEGRA_PL310_VIRT + 0x730    @ cache sync
+       add     r2, r2, r1
+       mov     r1, #0
+       str     r1, [r2]
+#endif
+
        pop_ctx_regs r0, r1             @ restore context registers
        mov     pc, lr
 ENDPROC(tegra2_sleep_wfi)