diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2012-08-01 09:46:41 -0400 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2012-09-19 03:32:54 -0400 |
commit | 8ec58be9f3ff2ad4a4d7bde8f48b4a4c406768e7 (patch) | |
tree | 32cc5b0d73b522d13518891e9d24b8163d5f04e8 /arch | |
parent | 5b6728d4189d14c19f384d5ec6087276e7c196d8 (diff) |
ARM: virt: arch_timers: enable access to physical timers
If booting in HYP mode, it makes sense to enable the use of the
physical timers, so the kernel can use them directly.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/kernel/hyp-stub.S | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/arm/kernel/hyp-stub.S b/arch/arm/kernel/hyp-stub.S index 70609417deaf..65b2417aebce 100644 --- a/arch/arm/kernel/hyp-stub.S +++ b/arch/arm/kernel/hyp-stub.S | |||
@@ -142,6 +142,19 @@ THUMB( orr r7, #(1 << 30) ) @ HSCTLR.TE | |||
142 | and r7, #0x1f @ Preserve HPMN | 142 | and r7, #0x1f @ Preserve HPMN |
143 | mcr p15, 4, r7, c1, c1, 1 @ HDCR | 143 | mcr p15, 4, r7, c1, c1, 1 @ HDCR |
144 | 144 | ||
145 | #if !defined(ZIMAGE) && defined(CONFIG_ARM_ARCH_TIMER) | ||
146 | @ make CNTP_* and CNTPCT accessible from PL1 | ||
147 | mrc p15, 0, r7, c0, c1, 1 @ ID_PFR1 | ||
148 | lsr r7, #16 | ||
149 | and r7, #0xf | ||
150 | cmp r7, #1 | ||
151 | bne 1f | ||
152 | mrc p15, 4, r7, c14, c1, 0 @ CNTHCTL | ||
153 | orr r7, r7, #3 @ PL1PCEN | PL1PCTEN | ||
154 | mcr p15, 4, r7, c14, c1, 0 @ CNTHCTL | ||
155 | 1: | ||
156 | #endif | ||
157 | |||
145 | bic r7, r4, #MODE_MASK | 158 | bic r7, r4, #MODE_MASK |
146 | orr r7, r7, #SVC_MODE | 159 | orr r7, r7, #SVC_MODE |
147 | THUMB( orr r7, r7, #PSR_T_BIT ) | 160 | THUMB( orr r7, r7, #PSR_T_BIT ) |