Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Aug 2015 17:06:23 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r286674 - head/sys/arm64/arm64
Message-ID:  <201508121706.t7CH6Nlv033694@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andrew
Date: Wed Aug 12 17:06:22 2015
New Revision: 286674
URL: https://svnweb.freebsd.org/changeset/base/286674

Log:
  Set the counter-timer virtual offset to a know value, it may not have been
  set by the boot code and are reset to an implementation defined value that
  may be unknown.
  
  Sponsored by:	ABT Systems Ltd

Modified:
  head/sys/arm64/arm64/locore.S

Modified: head/sys/arm64/arm64/locore.S
==============================================================================
--- head/sys/arm64/arm64/locore.S	Wed Aug 12 16:53:37 2015	(r286673)
+++ head/sys/arm64/arm64/locore.S	Wed Aug 12 17:06:22 2015	(r286674)
@@ -220,6 +220,14 @@ drop_to_el1:
 	/* Don't trap to EL2 for CP15 traps */
 	msr	hstr_el2, xzr
 
+	/* Enable access to the physical timers at EL1 */
+	mrs	x2, cnthctl_el2
+	orr	x2, x2, #(CNTHCTL_EL1PCTEN | CNTHCTL_EL1PCEN)
+	msr	cnthctl_el2, x2
+
+	/* Set the counter offset to a known value */
+	msr	cntvoff_el2, xzr
+
 	/* Hypervisor trap functions */
 	adr	x2, hyp_vectors
 	msr	vbar_el2, x2



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201508121706.t7CH6Nlv033694>