summaryrefslogtreecommitdiff
path: root/arch/arm/kernel/hyp-stub.S
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2012-08-01 14:46:41 +0100
committerMarc Zyngier <marc.zyngier@arm.com>2012-09-19 08:32:54 +0100
commit8ec58be9f3ff2ad4a4d7bde8f48b4a4c406768e7 (patch)
tree32cc5b0d73b522d13518891e9d24b8163d5f04e8 /arch/arm/kernel/hyp-stub.S
parent5b6728d4189d14c19f384d5ec6087276e7c196d8 (diff)
downloadlwn-8ec58be9f3ff2ad4a4d7bde8f48b4a4c406768e7.tar.gz
lwn-8ec58be9f3ff2ad4a4d7bde8f48b4a4c406768e7.zip
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/arm/kernel/hyp-stub.S')
-rw-r--r--arch/arm/kernel/hyp-stub.S13
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
and r7, #0x1f @ Preserve HPMN
mcr p15, 4, r7, c1, c1, 1 @ HDCR
+#if !defined(ZIMAGE) && defined(CONFIG_ARM_ARCH_TIMER)
+ @ make CNTP_* and CNTPCT accessible from PL1
+ mrc p15, 0, r7, c0, c1, 1 @ ID_PFR1
+ lsr r7, #16
+ and r7, #0xf
+ cmp r7, #1
+ bne 1f
+ mrc p15, 4, r7, c14, c1, 0 @ CNTHCTL
+ orr r7, r7, #3 @ PL1PCEN | PL1PCTEN
+ mcr p15, 4, r7, c14, c1, 0 @ CNTHCTL
+1:
+#endif
+
bic r7, r4, #MODE_MASK
orr r7, r7, #SVC_MODE
THUMB( orr r7, r7, #PSR_T_BIT )