From nobody Tue Nov 26 06:29:25 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1709537827064383.84544390171163; Sun, 3 Mar 2024 23:37:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rh2sF-0000cV-3s; Mon, 04 Mar 2024 02:36:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rh2sD-0000bq-K1; Mon, 04 Mar 2024 02:36:33 -0500 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rh2sB-0001WE-DJ; Mon, 04 Mar 2024 02:36:33 -0500 Received: from [2a00:23c4:8bb2:1300:eb54:aec0:aa9a:72ab] (helo=localhost.localdomain) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rh2rH-0001gw-9E; Mon, 04 Mar 2024 07:35:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: Message-Id:Date:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=YGVQIgMvq3sqtrQR8Eoo9eAm1kpHnXhFj7jwONKzVos=; b=d78iZqDsL+aF8flVhn+ClVPTYy EdaTyGalSQA05s3i6VpVWZ1K5gKI0xz9SNhC2cNKFwdEoOYL3UYA38mp3Vqm70i5TMKgPi4ltnVg1 aivrgAVrHNxx5U3qNa4unfYLUB0N/c0nGUT67eJPDS2f3SJFcjlXdqeYN6Mm+aWdWXVYTu1RxLAPo t0m7wzuF8SOlDLJOZHSFTfqjC0PcRFsc32Obxu+RZDoEc2vO4TCwL0U3IAJglxNHYdojalhJiDFTn 7JbxFA9qtd8Ie3yhPYwOxFHrUvIdAIWbYJjDN8GDk5f6QPv5tCF2WeG9QXGbCc+kDOisah85c7OYw ALz3Tf6y56Qz3EMubr2wVwGJmoM8ZTQB9ROYkSutnBVpzKeuTpQjS78PSVnPjqiOVzZ0MFpj0JqoN uBFC8k/AlSWsdGcTViPolgR/G6W94CKysBliqHSwVdy5IMXP1zR0HX5krqiRP0GxQtF1Cnu0bH+Kg myP3fEJXGPP7I22yp9xZReyuk16rD0VfevWGXLBHW7GTJ8cJMagw0onTBUFH3nie/5xX+mmQ4nt0Y fmnI+7PfbpeC5DuatJxhV8io7vQ8Zy//0UiG5zjCtGRbDlawxVhCbdcijnBskNMIaYu/5phbRqaJb jLwIPd3bAxlJumRKo+JRI9y3mPmq3LsqJRnl7Q3/s=; From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Date: Mon, 4 Mar 2024 07:35:48 +0000 Message-Id: <20240304073548.2098806-1-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8bb2:1300:eb54:aec0:aa9a:72ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH] mac_newworld: change timebase frequency from 100MHz to 25MHz for mac99 machine X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1709537828136100002 Content-Type: text/plain; charset="utf-8" MacOS X uses multiple techniques for calibrating timers depending upon the = detected hardware. One of these calibration routines compares the change in the time= base against the KeyLargo timer and uses this to recalculate the clock frequency, timebase frequency and bus frequency if the calibration exceeds certain lim= its. This recalibration occurs despite the correct values being passed via the d= evice tree, and is likely due to buggy firmware on some hardware. The timebase frequency of 100MHz was set way back in 2005 by commit fa296b0= fb4 ("PIC fix - changed back TB frequency to 100 MHz") and with this value on a mac99,via=3Dpmu machine the OSX 10.2 timer calibration incorrectly calculat= es 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 1= 0.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 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- 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 @@ =20 #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) =20 --=20 2.39.2