From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 7/7] ARM: virt: arch_timers: enable access to physical timers
Date: Sat, 11 Aug 2012 12:04:37 +0100 [thread overview]
Message-ID: <1344683077-12841-8-git-send-email-marc.zyngier@arm.com> (raw)
In-Reply-To: <1344683077-12841-1-git-send-email-marc.zyngier@arm.com>
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>
---
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 4ff46fa..8c288ba 100644
--- a/arch/arm/kernel/hyp-stub.S
+++ b/arch/arm/kernel/hyp-stub.S
@@ -137,6 +137,19 @@ THUMB( orr r7, #(1 << 30) ) @ HSCTLR.TE
mcr p15, 4, r7, c1, c0, 0 @ HSCTLR
isb
+#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 )
--
1.7.8.6
prev parent reply other threads:[~2012-08-11 11:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-11 11:04 [PATCH 0/7] Allow the kernel to be booted in HYP mode Marc Zyngier
2012-08-11 11:04 ` [PATCH 1/7] ARM: opcodes: add __ERET/__MSR_ELR_HYP instruction encoding Marc Zyngier
2012-08-11 11:04 ` [PATCH 2/7] ARM: virt: allow the kernel to be entered in HYP mode Marc Zyngier
2012-08-11 11:04 ` [PATCH 3/7] ARM: zImage/virt: hyp mode entry support for the zImage loader Marc Zyngier
2012-08-11 11:04 ` [PATCH 4/7] ARM: virt: Update documentation for hyp mode entry support Marc Zyngier
2012-08-11 11:04 ` [PATCH 5/7] ARM: virt: Add boot-time diagnostics Marc Zyngier
2012-08-11 11:04 ` [PATCH 6/7] ARM: virt: Add CONFIG_ARM_VIRT_EXT option Marc Zyngier
2012-08-11 11:04 ` Marc Zyngier [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1344683077-12841-8-git-send-email-marc.zyngier@arm.com \
--to=marc.zyngier@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).