qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/3] target/arm: Refactor default generic timer frequency han


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 2/3] target/arm: Refactor default generic timer frequency handling
Date: Tue, 23 Apr 2024 14:12:10 +0200
User-agent: Mozilla Thunderbird

On 19/4/24 20:46, Peter Maydell wrote:
The generic timer frequency is settable by board code via a QOM
property "cntfrq", but otherwise defaults to 62.5MHz.  The way this
is done includes some complication resulting from how this was
originally a fixed value with no QOM property.  Clean it up:

  * always set cpu->gt_cntfrq_hz to some sensible value, whether
    the CPU has the generic timer or not, and whether it's system
    or user-only emulation
  * this means we can always use gt_cntfrq_hz, and never need
    the old GTIMER_SCALE define
  * set the default value in exactly one place, in the realize fn

The aim here is to pave the way for handling the ARMv8.6 requirement
that the generic timer frequency is always 1GHz.  We're going to do
that by having old CPU types keep their legacy-in-QEMU behaviour and
having the default for any new CPU types be a 1GHz rather han 62.5MHz
cntfrq, so we want the point where the default is decided to be in
one place, and in code, not in a DEFINE_PROP_UINT64() initializer.

This commit should have no behavioural changes.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
  target/arm/internals.h |  7 ++++---
  target/arm/cpu.c       | 31 +++++++++++++++++--------------
  target/arm/helper.c    | 16 ++++++++--------
  3 files changed, 29 insertions(+), 25 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]