aboutsummaryrefslogtreecommitdiff
path: root/hw/chiptod.c
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2023-06-02 14:30:16 +1000
committerReza Arbab <arbab@linux.ibm.com>2023-07-11 09:12:35 -0500
commit2d878b182c79d4ff5b6feb43f02b237bdf231daa (patch)
tree4bd39579e21e0b6056fd47871029ffe497fce316 /hw/chiptod.c
parent25e28eae9acb0275b7c3a7f3377327b30aae6b5c (diff)
downloadskiboot-2d878b182c79d4ff5b6feb43f02b237bdf231daa.zip
skiboot-2d878b182c79d4ff5b6feb43f02b237bdf231daa.tar.gz
skiboot-2d878b182c79d4ff5b6feb43f02b237bdf231daa.tar.bz2
hw/chiptod: allow qemu to use the chiptod
There is a QEMU model for ChipTOD (not yet upstream) that provides enough to get through skiboot's sync sequence. So run the chiptod init when running under QEMU, if it is being provided in the device tree. If not, don't crash because the QEMU patch has not been merged yet... Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
Diffstat (limited to 'hw/chiptod.c')
-rw-r--r--hw/chiptod.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/hw/chiptod.c b/hw/chiptod.c
index 736bd03..e3941e2 100644
--- a/hw/chiptod.c
+++ b/hw/chiptod.c
@@ -1681,7 +1681,6 @@ error_out:
static int64_t opal_resync_timebase(void)
{
- /* Mambo and qemu doesn't simulate the chiptod */
if (chip_quirk(QUIRK_NO_CHIPTOD))
return OPAL_SUCCESS;
@@ -1829,13 +1828,16 @@ void chiptod_init(void)
bool sres;
int i;
- /* Mambo and qemu doesn't simulate the chiptod */
if (chip_quirk(QUIRK_NO_CHIPTOD))
return;
op_display(OP_LOG, OP_MOD_CHIPTOD, 0);
if (!chiptod_probe()) {
+ /* Not all QEMU models provide chiptod */
+ if (chip_quirk(QUIRK_QEMU))
+ return;
+
prerror("Failed ChipTOD detection !\n");
op_display(OP_FATAL, OP_MOD_CHIPTOD, 0);
abort();
@@ -1903,6 +1905,8 @@ void chiptod_init(void)
chiptod_init_topology_info();
op_display(OP_LOG, OP_MOD_CHIPTOD, 4);
+
+ prlog(PR_NOTICE, "Synchronized all processors to common timebase.\n");
}
/* CAPP timebase sync */