[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 26/43] mac_newworld: change timebase frequency from 100MHz to 25MH
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 26/43] mac_newworld: change timebase frequency from 100MHz to 25MHz for mac99 machine |
Date: |
Sat, 9 Mar 2024 20:21:53 +0100 |
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
MacOS X uses multiple techniques for calibrating timers depending upon the
detected
hardware. One of these calibration routines compares the change in the timebase
against the KeyLargo timer and uses this to recalculate the clock frequency,
timebase frequency and bus frequency if the calibration exceeds certain limits.
This recalibration occurs despite the correct values being passed via the device
tree, and is likely due to buggy firmware on some hardware.
The timebase frequency of 100MHz was set way back in 2005 by commit fa296b0fb4
("PIC fix - changed back TB frequency to 100 MHz") and with this value on a
mac99,via=pmu machine the OSX 10.2 timer calibration incorrectly calculates the
bus frequency as 400MHz instead of 100MHz. The most noticeable side-effect is
the UI appears sluggish and not very responsive for normal use.
Change the timebase frequency from 100MHz to 25MHz which matches that of a real
G4 AGP machine (the closest match to QEMU's mac99 machine) and allows OSX 10.2
to correctly detect all of the clock frequency, timebase frequency and bus
frequency.
Tested on various MacOS images from OS 9.2 through to OSX 10.4, along with Linux
and NetBSD and I was unable to find any regressions from this change.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240304073548.2098806-1-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/ppc/mac_newworld.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index 3e796d2f6d..ff9e490c4e 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -77,7 +77,7 @@
#define MAX_IDE_BUS 2
#define CFG_ADDR 0xf0000510
-#define TBFREQ (100UL * 1000UL * 1000UL)
+#define TBFREQ (25UL * 1000UL * 1000UL)
#define CLOCKFREQ (900UL * 1000UL * 1000UL)
#define BUSFREQ (100UL * 1000UL * 1000UL)
--
2.41.0
- [PULL 16/43] hw/net/xen_nic: Fix missing ERRP_GUARD() for error_prepend(), (continued)
- [PULL 16/43] hw/net/xen_nic: Fix missing ERRP_GUARD() for error_prepend(), Philippe Mathieu-Daudé, 2024/03/09
- [PULL 17/43] hw/remote/remote-obj: hw/misc/ivshmem: Fix missing ERRP_GUARD() for error_prepend(), Philippe Mathieu-Daudé, 2024/03/09
- [PULL 19/43] hw/i386/pc: Remove pc_compat_1_4..1.7[] left over declarations, Philippe Mathieu-Daudé, 2024/03/09
- [PULL 18/43] target/i386/sev: Fix missing ERRP_GUARD() for error_prepend(), Philippe Mathieu-Daudé, 2024/03/09
- [PULL 20/43] hw/i386/pc: Use generated NotifyVmexitOption_str(), Philippe Mathieu-Daudé, 2024/03/09
- [PULL 21/43] hw/i386/pc: Remove 'host_type' argument from pc_init1(), Philippe Mathieu-Daudé, 2024/03/09
- [PULL 22/43] hw/i386/pc: Have pc_init_isa() pass a NULL pci_type argument, Philippe Mathieu-Daudé, 2024/03/09
- [PULL 23/43] hw/intc/apic: fix memory leak, Philippe Mathieu-Daudé, 2024/03/09
- [PULL 24/43] qdev: Add a granule_mode property, Philippe Mathieu-Daudé, 2024/03/09
- [PULL 25/43] hmp: Add option to info qtree to omit details, Philippe Mathieu-Daudé, 2024/03/09
- [PULL 26/43] mac_newworld: change timebase frequency from 100MHz to 25MHz for mac99 machine,
Philippe Mathieu-Daudé <=
- [PULL 27/43] hw/intc/grlib_irqmp: abort realize when ncpus value is out of range, Philippe Mathieu-Daudé, 2024/03/09
- [PULL 29/43] docs/interop/firmware.json: Fix doc for FirmwareFlashMode, Philippe Mathieu-Daudé, 2024/03/09
- [PULL 28/43] docs/interop/firmware.json: Align examples, Philippe Mathieu-Daudé, 2024/03/09
- [PULL 31/43] hw/core/machine-smp: Deprecate unsupported "parameter=1" SMP configurations, Philippe Mathieu-Daudé, 2024/03/09
- [PULL 32/43] hw/core/machine-smp: Calculate total CPUs once in machine_parse_smp_config(), Philippe Mathieu-Daudé, 2024/03/09
- [PULL 34/43] tests/unit/test-smp-parse: Use CPU number macros in invalid topology case, Philippe Mathieu-Daudé, 2024/03/09
- [PULL 30/43] hw/core/machine-smp: Remove deprecated "parameter=0" SMP configurations, Philippe Mathieu-Daudé, 2024/03/09
- [PULL 35/43] tests/unit/test-smp-parse: Bump max_cpus to 4096, Philippe Mathieu-Daudé, 2024/03/09
- [PULL 39/43] tests/unit/test-smp-parse: Test "drawers" and "books" combination case, Philippe Mathieu-Daudé, 2024/03/09
- [PULL 41/43] tests/unit/test-smp-parse: Test smp_props.has_clusters, Philippe Mathieu-Daudé, 2024/03/09