linux/arch/arm/plat-omap/include/plat
Jon Hunter bfd6d02112 ARM: OMAP3+: Implement timer workaround for errata i103 and i767
Errata Titles:
i103: Delay needed to read some GP timer, WD timer and sync timer
      registers after wakeup (OMAP3/4)
i767: Delay needed to read some GP timer registers after wakeup (OMAP5)

Description (i103/i767):
If a General Purpose Timer (GPTimer) is in posted mode
(TSICR [2].POSTED=1), due to internal resynchronizations, values read in
TCRR, TCAR1 and TCAR2 registers right after the timer interface clock
(L4) goes from stopped to active may not return the expected values. The
most common event leading to this situation occurs upon wake up from
idle.

GPTimer non-posted synchronization mode is not impacted by this
limitation.

Workarounds:
1). Disable posted mode
2). Use static dependency between timer clock domain and MPUSS clock
    domain
3). Use no-idle mode when the timer is active

Workarounds #2 and #3 are not pratical from a power standpoint and so
workaround #1 has been implemented. Disabling posted mode adds some CPU
overhead for configuring and reading the timers as the CPU has to wait
for accesses to be re-synchronised within the timer. However, disabling
posted mode guarantees correct operation.

Please note that it is safe to use posted mode for timers if the counter
(TCRR) and capture (TCARx) registers will never be read. An example of
this is the clock-event system timer. This is used by the kernel to
schedule events however, the timers counter is never read and capture
registers are not used. Given that the kernel configures this timer
often yet never reads the counter register it is safe to enable posted
mode in this case. Hence, for the timer used for kernel clock-events,
posted mode is enabled by overriding the errata for devices that are
impacted by this defect.

For drivers using the timers that do not read the counter or capture
registers and wish to use posted mode, can override the errata and
enable posted mode by making the following function calls.

	__omap_dm_timer_override_errata(timer, OMAP_TIMER_ERRATA_I103_I767);
	__omap_dm_timer_enable_posted(timer);

Both dmtimers and watchdogs are impacted by this defect this patch only
implements the workaround for the dmtimer. Currently the watchdog driver
does not read the counter register and so no workaround is necessary.

Posted mode will be disabled for all OMAP2+ devices (including AM33xx)
using a GP timer as a clock-source timer to guarantee correct operation.
This is not necessary for OMAP24xx devices but the default clock-source
timer for OMAP24xx devices is the 32k-sync timer and not the GP timer
and so should not have any impact. This should be re-visited for future
devices if this errata is fixed.

Confirmed with Vaibhav Hiremath that this bug also impacts AM33xx
devices.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
2012-11-12 16:23:49 -06:00
..
counter-32k.h ARM: OMAP: Remove plat-omap/common.h 2012-10-31 15:37:13 -07:00
cpu.h ARM: OMAP1: Remove relative includes 2012-10-31 15:37:14 -07:00
debug-devices.h ARM: OMAP: Fix relative includes for debug-devices.h 2012-10-31 15:37:13 -07:00
dmtimer.h ARM: OMAP3+: Implement timer workaround for errata i103 and i767 2012-11-12 16:23:49 -06:00
i2c.h ARM: OMAP: Fix relative includes for shared i2c.h file 2012-10-31 15:37:13 -07:00
iommu2.h omap: iommu: omapify 'struct iommu' and exposed API 2011-08-26 11:46:01 +02:00
iommu.h ARM: OMAP3: hwmod data: add mmu data for iva and isp 2012-09-23 17:28:23 -06:00
iopgtable.h omap: iommu: omapify 'struct iommu' and exposed API 2011-08-26 11:46:01 +02:00
iovmm.h iommu/omap: eliminate the public omap_find_iommu_device() method 2011-12-05 15:47:39 +02:00
mailbox.h OMAP: mailbox: add notification support for multiple readers 2010-12-02 05:43:16 -06:00
omap-serial.h Revert "serial: omap: fix software flow control" 2012-10-24 11:57:21 -07:00
prcm.h ARM: OMAP: Allow platforms to hook reset cleanly 2011-01-27 16:39:48 -08:00
sram.h ARM: OMAP: Introduce common omap_map_sram() and omap_sram_reset() 2012-10-31 10:14:13 -07:00
timex.h
vram.h OMAPDSS: Remove video SRAM support 2012-02-23 09:38:26 +02:00