From: Ranjani Vaidyanathan Date: Wed, 1 Feb 2012 13:32:32 +0000 (-0600) Subject: ENGR00173585: MX6: Added WAIT mode workaround for MX6Q TO1.1 X-Git-Tag: v3.0.35-fsl~1569 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=eb973246e66fef6d19c76bb4507298d8f095a00d;p=karo-tx-linux.git ENGR00173585: MX6: Added WAIT mode workaround for MX6Q TO1.1 There is small window where an interrupt can occur when the SOC is in the process of entering WAIT mode. The ARM core responds to this interrupt and can access the internal memories when their clocks are disabled. To avoid crashes generated due to this, WFI code should be executed from non-cacheable IRAM and enough delay should added after the WFI so that accesses to memories are prevented. This workaround assumes that all interrupts are routed to CPU0 only. This workaround is applicable to iMX6DL/Solo also. Signed-off-by: Ranjani Vaidyanathan --- diff --git a/arch/arm/mach-mx6/system.c b/arch/arm/mach-mx6/system.c index 9288b9f599ab..fae41383eaab 100644 --- a/arch/arm/mach-mx6/system.c +++ b/arch/arm/mach-mx6/system.c @@ -43,12 +43,12 @@ #define MODULE_CLKGATE (1 << 30) #define MODULE_SFTRST (1 << 31) -/* static DEFINE_SPINLOCK(wfi_lock); */ +static DEFINE_SPINLOCK(wfi_lock); extern unsigned int gpc_wake_irq[4]; extern int mx6q_revision(void); -/* static unsigned int cpu_idle_mask; */ +static unsigned int cpu_idle_mask; static void __iomem *gpc_base = IO_ADDRESS(GPC_BASE_ADDR); @@ -145,8 +145,7 @@ void mxc_cpu_lp_set(enum mxc_cpu_pwr_mode mode) if ((num_online_cpus() == num_present_cpus()) && mx6_wait_in_iram != NULL) { mxc_cpu_lp_set(WAIT_UNCLOCKED_POWER_OFF); - if (smp_processor_id() == 0 && - (mx6q_revision() <= IMX_CHIP_REVISION_1_0)) + if (smp_processor_id() == 0) mx6_wait_in_iram(); else cpu_do_idle();