clocksource: arch_timer: make virtual counter access configurable

Change-Id: Ibdb1fd768b748002b90bfc165612c12c8311f8a2
Signed-off-by: Greg Hackmann <ghackmann@google.com>
Signed-off-by: Kyle Yan <kyan@codeaurora.org>
This commit is contained in:
Greg Hackmann 2017-09-19 10:55:17 -07:00 • committed by Kyle Yan
commit 7b4edf240b
2 changed files with 15 additions and 2 deletions

View file

@ -315,6 +315,14 @@ config FSL_ERRATUM_A008585
value"). The workaround will only be active if the
fsl,erratum-a008585 property is found in the timer node.
config ARM_ARCH_TIMER_VCT_ACCESS
bool "Support for ARM architected timer virtual counter access in userspace"
default !ARM64
depends on ARM_ARCH_TIMER
help
This option enables support for reading the ARM architected timer's
virtual counter in userspace.
config ARM_GLOBAL_TIMER
bool "Support for the ARM global timer" if COMPILE_TEST
select CLKSRC_OF if OF

View file

@ -447,8 +447,13 @@ static void arch_counter_set_user_access(void)
| ARCH_TIMER_USR_VT_ACCESS_EN
| ARCH_TIMER_VIRT_EVT_EN);
/* Enable user access to the virtual and physical counters */
cntkctl |= ARCH_TIMER_USR_VCT_ACCESS_EN | ARCH_TIMER_USR_PCT_ACCESS_EN;
cntkctl |= ARCH_TIMER_USR_PCT_ACCESS_EN;
/* Enable user access to the virtual counter */
if (IS_ENABLED(CONFIG_ARM_ARCH_TIMER_VCT_ACCESS))
cntkctl |= ARCH_TIMER_USR_VCT_ACCESS_EN;
else
cntkctl &= ~ARCH_TIMER_USR_VCT_ACCESS_EN;
arch_timer_set_cntkctl(cntkctl);
}