aboutsummaryrefslogtreecommitdiff
path: root/bl31
diff options
context:
space:
mode:
authorSoby Mathew <soby.mathew@arm.com>2014-08-29 14:41:58 +0100
committerSoby Mathew <soby.mathew@arm.com>2014-09-02 13:59:14 +0100
commit14c0526b737592776360fec99b452e740879d532 (patch)
treeb14c9cf3aeeeade8b12f152d301e9656ad582f24 /bl31
parent14b6608c9a2eba27ef36cc3e0806c9fa6d5555b0 (diff)
Reset CNTVOFF_EL2 register before exit into EL1 on warm boot
This patch resets the value of CNTVOFF_EL2 before exit to EL1 on warm boot. This needs to be done if only the Trusted Firmware exits to EL1 instead of EL2, otherwise the hypervisor would be responsible for this. Fixes ARM-software/tf-issues#240 Change-Id: I79d54831356cf3215bcf1f251c373bd8f89db0e0
Diffstat (limited to 'bl31')
-rw-r--r--bl31/context_mgmt.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/bl31/context_mgmt.c b/bl31/context_mgmt.c
index 489d454..698fb6f 100644
--- a/bl31/context_mgmt.c
+++ b/bl31/context_mgmt.c
@@ -247,6 +247,9 @@ void cm_prepare_el3_exit(uint32_t security_state)
/* Enable EL1 access to timer */
write_cnthctl_el2(EL1PCEN_BIT | EL1PCTEN_BIT);
+ /* Reset CNTVOFF_EL2 */
+ write_cntvoff_el2(0);
+
/* Set VPIDR, VMPIDR to match MIDR, MPIDR */
write_vpidr_el2(read_midr_el1());
write_vmpidr_el2(read_mpidr_el1());