ppc/pnv: Implement the ChipTOD to Core transfer
commitcde2ba34a951997f01c184acf6e3a29eb6a81e79
authorNicholas Piggin <npiggin@gmail.com>
Thu, 23 Nov 2023 08:02:36 +0000 (23 18:02 +1000)
committerNicholas Piggin <npiggin@gmail.com>
Fri, 23 Feb 2024 13:24:43 +0000 (23 23:24 +1000)
tree340ee414749fc39e8cc3eca9acb0e2d35414d3db
parentde3ba0cc38ffb96265f29c2399df0a5c0f301f40
ppc/pnv: Implement the ChipTOD to Core transfer

One of the functions of the ChipTOD is to transfer TOD to the Core
(aka PC - Pervasive Core) timebase facility.

The ChipTOD can be programmed with a target address to send the TOD
value to. The hardware implementation seems to perform this by
sending the TOD value to a SCOM address.

This implementation grabs the core directly and manipulates the
timebase facility state in the core. This is a hack, but it works
enough for now. A better implementation would implement the transfer
to the PnvCore xscom register and drive the timebase state machine
from there.

Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
hw/ppc/pnv.c
hw/ppc/pnv_chiptod.c
include/hw/ppc/pnv.h
include/hw/ppc/pnv_chiptod.h
target/ppc/cpu.h