drivers: clocksource: add support for ARM architected timer event stream
authorWill Deacon <will.deacon@arm.com>
Fri, 23 Aug 2013 14:32:29 +0000 (15:32 +0100)
committerAlex Shi <alex.shi@linaro.org>
Mon, 28 Apr 2014 05:59:00 +0000 (13:59 +0800)
commit8c06dc7aa190931ea26e5eb1192314ad83385ae5
tree63ed39b7d5c0047f04ba7382d01bdb84f1c87e04
parenta8d3b80b5ddba1f49129360d14bf9104074d1581
drivers: clocksource: add support for ARM architected timer event stream

The ARM architected timer can generate events (used for waking up
CPUs executing the wfe instruction) at a frequency represented as a
power-of-2 divisor of the clock rate.

An event stream might be used:
- To implement wfe-based timeouts for userspace locking implementations.
- To impose a timeout on a wfe for safeguarding against any programming
  error in case an expected event is not generated.

This patch computes the event stream frequency aiming for a period
of 100us between events. It uses ARM/ARM64 specific backends to configure
and enable the event stream.

Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Will Deacon <will.deacon@arm.com>
[sudeep: moving ARM/ARM64 changes into separate patches
         and adding Kconfig option]
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
(cherry picked from commit 037f637767a82907efedda78d3ff405c34020075)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Conflicts:
drivers/clocksource/Kconfig
drivers/clocksource/arm_arch_timer.c
drivers/clocksource/Kconfig
drivers/clocksource/arm_arch_timer.c
include/clocksource/arm_arch_timer.h