hw/arm/sbsa-ref: Force CPU generic timer to 62.5MHz
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 26 Apr 2024 12:29:11 +0000 (13:29 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 30 Apr 2024 14:14:15 +0000 (15:14 +0100)
commitee4336f9470b74f4dd3493d1fdbd61ff13005f9d
treef7ffc58812b45e0281e866efb935bf177df9475b
parentbd8e9ddf6f6915b8a67909a21e7f46f77a05767d
hw/arm/sbsa-ref: Force CPU generic timer to 62.5MHz

Currently QEMU CPUs always run with a generic timer counter frequency
of 62.5MHz, but ARMv8.6 CPUs will run at 1GHz.  For older versions of
the TF-A firmware that sbsa-ref runs, the frequency of the generic
timer is hardcoded into the firmware, and so if the CPU actually has
a different frequency then timers in the guest will be set
incorrectly.

The default frequency used by the 'max' CPU is about to change, so
make the sbsa-ref board force the CPU frequency to the value which
the firmware expects.

Newer versions of TF-A will read the frequency from the CPU's
CNTFRQ_EL0 register:
 https://github.com/ARM-software/arm-trusted-firmware/commit/4c77fac98dac0bebc63798aae9101ac865b87148
so in the longer term we could make this board use the 1GHz
frequency. We will need to make sure we update the binaries used
by our avocado test
 Aarch64SbsarefMachine.test_sbsaref_alpine_linux_max_pauth_impdef
before we can do that.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Message-id: 20240426122913.3427983-3-peter.maydell@linaro.org
hw/arm/sbsa-ref.c