]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/misc/aspeed_scu: Support the Frequency Counter Control register for AST2700
authorJamin Lin <jamin_lin@aspeedtech.com>
Wed, 18 Jun 2025 08:00:05 +0000 (16:00 +0800)
committerCédric Le Goater <clg@redhat.com>
Thu, 3 Jul 2025 11:41:57 +0000 (13:41 +0200)
commita6ca5dfccc2b584d2f7bf31fb488fc178e967972
treec58f1a4b5a9cbfc51de7068d1a3be0d2e4c04889
parent51ac481bff88723ef4c101925082fab03bba200a
hw/misc/aspeed_scu: Support the Frequency Counter Control register for AST2700

According to the datasheet:
BIT[1] (SCU_FREQ_OSC_EN) enables the oscillator frequency measurement counter.
BIT[6] (SCU_FREQ_DONE) indicates the measurement is finished.
Firmware polls BIT[6] to determine when measurement is complete.
The flag can be cleared by writing BIT[1] to 0.

To simulate this hardware behavior in QEMU:
If BIT[1] is set to 1, BIT[6] is immediately set to 1 to avoid
firmware hanging during polling.
If BIT[1] is cleared to 0, BIT[6] is also cleared to 0 to match
hardware semantics.

The initial value of this register is initialized to 0x80, reflecting the
default value confirmed from an EVB register dump.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20250618080006.846355-3-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
hw/misc/aspeed_scu.c