Subject: [PATCH] arm64: acpi/gtdt: validate CNTFRQ after having enabled the frame

From: [email-masked] (Mark Rutland)
Date: Tue, 1 Aug 2017 15:57:04 +0100

On Tue, Aug 01, 2017 at 12:31:21PM +0100, Mark Rutland wrote:
> On Tue, Aug 01, 2017 at 12:09:32PM +0100, Ard Biesheuvel wrote:

> > The point here is that CNTFRQ cannot differ between frames. It either
> > returns the value of the base frame or RES0.
> 
> Sorry; you had mentioned this before, and I had forgotten.
> 
> I'm under the impression that the ARM ARM may be misleading (and
> potentially erroneous) in that regard. In the past I had been told that
> each instance of a CNTFRQ register was independent, and each must be
> writeable for system initialization.

FWIW, I took a look at a Juno R1 with a DSTREAM.

I can independently configure CNTCTLBase.CNTFRQ and CNTBase1.CNTFRQ,
with the latter being RW from the Non-secure side. It seems that
firmware I'm using doesn't bother to initialise either. :/

So regardless of what the architectural intent is, there exist platforms
where these can differ.

I'll try to fix up the patch accordingly, to check all instances.

Thanks,
Mark.