ARM: OMAP4: Workaround the OCP synchronisation issue with 32K synctimer.
authorSantosh Shilimkar <santosh.shilimkar@ti.com>
Mon, 12 Mar 2012 15:04:45 +0000 (20:34 +0530)
committerKevin Hilman <khilman@ti.com>
Thu, 22 Mar 2012 23:11:17 +0000 (16:11 -0700)
commit68523f4233de5f233478dde0a63047b4efb710b8
treeb14340de1407bb518fa9cb40829ba388dd5a7c79
parentc16fa4f2ad19908a47c63d8fa436a1178438c7e7
ARM: OMAP4: Workaround the OCP synchronisation issue with 32K synctimer.

On OMAP4, recently a synchronisation bug is discovered by hardware
team, which leads to incorrect timer value read from 32K sync timer
IP when the IP is comming out of idle.

The issue is due to the synchronization methodology used in the SYNCTIMER IP.
The value of the counter register in 32kHz domain is synchronized to the OCP
domain register only at count up event, and if the OCP clock is switched off,
the OCP register gets out of synch until the first count up event after the
clock is switched back -at the next falling edge of the 32kHz clock.

Further investigation revealed that it applies to gptimer1 and watchdog timer2
as well which may run on 32KHz. This patch fixes the issue for all the
applicable modules.

The BUG has not made it yet to the OMAP errata list and it is applicable to
OMAP1/2/3/4/5. OMAP1/2/3 it is taken care indirectly by autodeps.

By enabling static depedency of wakeup clockdomain with MPU, as soon as MPU
is woken up from lowpower state(idle) or whenever MPU is active, PRCM forces
the OCP clock to be running and allow the counter value to be updated properly
in the OCP clock domain.

The bug is going to fixed in future OMAP versions.

Reported-Tested-by: dave.long@linaro.org
[dave.long@linaro.org: Reported the oprofile time stamp issue with synctimer
and helped to test this patch]
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
arch/arm/mach-omap2/pm44xx.c