From nobody Fri May 10 02:58:47 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=eik.bme.hu Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1672871375248785.2042619472489; Wed, 4 Jan 2023 14:29:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDBrr-0007aS-QS; Wed, 04 Jan 2023 17:04:15 -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 1pDBpi-00069f-9A; Wed, 04 Jan 2023 17:02:14 -0500 Received: from zero.eik.bme.hu ([152.66.115.2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDBpd-0003BR-PC; Wed, 04 Jan 2023 17:02:00 -0500 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id AC990749023; Wed, 4 Jan 2023 22:59:36 +0100 (CET) Received: by zero.eik.bme.hu (Postfix, from userid 432) id 75A46749022; Wed, 4 Jan 2023 22:59:36 +0100 (CET) Message-Id: In-Reply-To: References: From: BALATON Zoltan Subject: [PATCH v7 1/7] input/adb: Only include header where needed To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Cc: Mark Cave-Ayland Date: Wed, 4 Jan 2023 22:59:36 +0100 (CET) X-Spam-Probability: 8% 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=152.66.115.2; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-ZM-MESSAGEID: 1672871376055100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The header hw/input/adb.h is included by some files that don't need it. Clean it up and include only where necessary. Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/misc/macio/cuda.c | 2 -- hw/misc/macio/pmu.c | 3 --- hw/misc/mos6522.c | 1 - include/hw/misc/mac_via.h | 1 + include/hw/misc/macio/cuda.h | 1 + include/hw/misc/macio/pmu.h | 1 + include/hw/misc/mos6522.h | 3 +-- 7 files changed, 4 insertions(+), 8 deletions(-) diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c index 853e88bfed..7208b90e12 100644 --- a/hw/misc/macio/cuda.c +++ b/hw/misc/macio/cuda.c @@ -27,8 +27,6 @@ #include "hw/irq.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" -#include "hw/input/adb.h" -#include "hw/misc/mos6522.h" #include "hw/misc/macio/cuda.h" #include "qapi/error.h" #include "qemu/timer.h" diff --git a/hw/misc/macio/pmu.c b/hw/misc/macio/pmu.c index 97ef8c771b..8575bc1264 100644 --- a/hw/misc/macio/pmu.c +++ b/hw/misc/macio/pmu.c @@ -31,10 +31,7 @@ #include "qemu/osdep.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" -#include "hw/input/adb.h" #include "hw/irq.h" -#include "hw/misc/mos6522.h" -#include "hw/misc/macio/gpio.h" #include "hw/misc/macio/pmu.h" #include "qapi/error.h" #include "qemu/timer.h" diff --git a/hw/misc/mos6522.c b/hw/misc/mos6522.c index 0ed631186c..d6ba47bde9 100644 --- a/hw/misc/mos6522.c +++ b/hw/misc/mos6522.c @@ -25,7 +25,6 @@ */ =20 #include "qemu/osdep.h" -#include "hw/input/adb.h" #include "hw/irq.h" #include "hw/misc/mos6522.h" #include "hw/qdev-properties.h" diff --git a/include/hw/misc/mac_via.h b/include/hw/misc/mac_via.h index 5fe7a7f592..422da43bf9 100644 --- a/include/hw/misc/mac_via.h +++ b/include/hw/misc/mac_via.h @@ -12,6 +12,7 @@ #include "exec/memory.h" #include "hw/sysbus.h" #include "hw/misc/mos6522.h" +#include "hw/input/adb.h" #include "qom/object.h" =20 =20 diff --git a/include/hw/misc/macio/cuda.h b/include/hw/misc/macio/cuda.h index a71deec968..8a6678c749 100644 --- a/include/hw/misc/macio/cuda.h +++ b/include/hw/misc/macio/cuda.h @@ -26,6 +26,7 @@ #ifndef CUDA_H #define CUDA_H =20 +#include "hw/input/adb.h" #include "hw/misc/mos6522.h" #include "qom/object.h" =20 diff --git a/include/hw/misc/macio/pmu.h b/include/hw/misc/macio/pmu.h index 00fcdd23f5..ba76afb52a 100644 --- a/include/hw/misc/macio/pmu.h +++ b/include/hw/misc/macio/pmu.h @@ -10,6 +10,7 @@ #ifndef PMU_H #define PMU_H =20 +#include "hw/input/adb.h" #include "hw/misc/mos6522.h" #include "hw/misc/macio/gpio.h" #include "qom/object.h" diff --git a/include/hw/misc/mos6522.h b/include/hw/misc/mos6522.h index 05872fffc9..fba45668ab 100644 --- a/include/hw/misc/mos6522.h +++ b/include/hw/misc/mos6522.h @@ -27,9 +27,8 @@ #ifndef MOS6522_H #define MOS6522_H =20 -#include "exec/memory.h" +#include "exec/hwaddr.h" #include "hw/sysbus.h" -#include "hw/input/adb.h" #include "qom/object.h" =20 #define MOS6522_NUM_REGS 16 --=20 2.30.6 From nobody Fri May 10 02:58:47 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=eik.bme.hu Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1672870015676392.96710938133594; Wed, 4 Jan 2023 14:06:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDBr0-00071i-F2; Wed, 04 Jan 2023 17:03:22 -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 1pDBpn-00069e-4J; Wed, 04 Jan 2023 17:02:18 -0500 Received: from zero.eik.bme.hu ([2001:738:2001:2001::2001]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDBpd-0003Bf-OB; Wed, 04 Jan 2023 17:02:00 -0500 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id AA0457496AC; Wed, 4 Jan 2023 22:59:37 +0100 (CET) Received: by zero.eik.bme.hu (Postfix, from userid 432) id 8F8CE7496AB; Wed, 4 Jan 2023 22:59:37 +0100 (CET) Message-Id: <719299533b89aa4516966065eae05c75744f50d3.1672868854.git.balaton@eik.bme.hu> In-Reply-To: References: From: BALATON Zoltan Subject: [PATCH v7 2/7] mac_{old,new}world: Use local variable instead of qdev_get_machine() To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Cc: Mark Cave-Ayland Date: Wed, 4 Jan 2023 22:59:37 +0100 (CET) X-Spam-Probability: 8% 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:738:2001:2001::2001; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-ZM-MESSAGEID: 1672870018211100006 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We already have machine in a local variable so no need to use qdev_get_machine(), also remove now unneded line break. Signed-off-by: BALATON Zoltan Reviewed-by: Bernhard Beschow Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/ppc/mac_newworld.c | 3 +-- hw/ppc/mac_oldworld.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index 601ea518f8..460c14b5e3 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -466,8 +466,7 @@ static void ppc_core99_init(MachineState *machine) fw_cfg =3D FW_CFG(dev); qdev_prop_set_uint32(dev, "data_width", 1); qdev_prop_set_bit(dev, "dma_enabled", false); - object_property_add_child(OBJECT(qdev_get_machine()), TYPE_FW_CFG, - OBJECT(fw_cfg)); + object_property_add_child(OBJECT(machine), TYPE_FW_CFG, OBJECT(fw_cfg)= ); s =3D SYS_BUS_DEVICE(dev); sysbus_realize_and_unref(s, &error_fatal); sysbus_mmio_map(s, 0, CFG_ADDR); diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index 558c639202..5a7b25a4a8 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -303,8 +303,7 @@ static void ppc_heathrow_init(MachineState *machine) fw_cfg =3D FW_CFG(dev); qdev_prop_set_uint32(dev, "data_width", 1); qdev_prop_set_bit(dev, "dma_enabled", false); - object_property_add_child(OBJECT(qdev_get_machine()), TYPE_FW_CFG, - OBJECT(fw_cfg)); + object_property_add_child(OBJECT(machine), TYPE_FW_CFG, OBJECT(fw_cfg)= ); s =3D SYS_BUS_DEVICE(dev); sysbus_realize_and_unref(s, &error_fatal); sysbus_mmio_map(s, 0, CFG_ADDR); --=20 2.30.6 From nobody Fri May 10 02:58:47 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=eik.bme.hu Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1672872463089265.36400020475344; Wed, 4 Jan 2023 14:47:43 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDBre-0007Gz-NG; Wed, 04 Jan 2023 17:04:02 -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 1pDBpi-00069g-Bm; Wed, 04 Jan 2023 17:02:14 -0500 Received: from zero.eik.bme.hu ([152.66.115.2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDBpd-0003C4-P8; Wed, 04 Jan 2023 17:02:00 -0500 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id BE84C7496AE; Wed, 4 Jan 2023 22:59:38 +0100 (CET) Received: by zero.eik.bme.hu (Postfix, from userid 432) id 98A8F7496AB; Wed, 4 Jan 2023 22:59:38 +0100 (CET) Message-Id: In-Reply-To: References: From: BALATON Zoltan Subject: [PATCH v7 3/7] mac_{old,new}world: Pass MacOS VGA NDRV in card ROM instead of fw_cfg To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Cc: Mark Cave-Ayland Date: Wed, 4 Jan 2023 22:59:38 +0100 (CET) X-Spam-Probability: 8% 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=152.66.115.2; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-ZM-MESSAGEID: 1672872463288100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" OpenBIOS cannot run FCode ROMs yet but it can detect NDRV in VGA card ROM and add it to the device tree for MacOS. Pass the NDRV this way instead of via fw_cfg. This solves the problem with OpenBIOS also adding the NDRV to ati-vga which it does not work with. This does not need any changes to OpenBIOS as this NDRV ROM handling is already there but this patch also allows simplifying OpenBIOS later to remove the fw_cfg ndrv handling from the vga FCode and also drop the vga-ndrv? option which is not needed any more as users can disable the ndrv with -device VGA,romfile=3D"" (or override it with their own NDRV or ROM). Once FCode support is implemented in OpenBIOS, the proper FCode ROM can be set the same way so this paves the way to remove some hacks. Signed-off-by: BALATON Zoltan --- hw/ppc/mac_newworld.c | 18 ++++++------------ hw/ppc/mac_oldworld.c | 18 ++++++------------ 2 files changed, 12 insertions(+), 24 deletions(-) diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index 460c14b5e3..60c9c27986 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -510,18 +510,6 @@ static void ppc_core99_init(MachineState *machine) fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_BUSFREQ, BUSFREQ); fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_NVRAM_ADDR, nvram_addr); =20 - /* MacOS NDRV VGA driver */ - filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, NDRV_VGA_FILENAME); - if (filename) { - gchar *ndrv_file; - gsize ndrv_size; - - if (g_file_get_contents(filename, &ndrv_file, &ndrv_size, NULL)) { - fw_cfg_add_file(fw_cfg, "ndrv/qemu_vga.ndrv", ndrv_file, ndrv_= size); - } - g_free(filename); - } - qemu_register_boot_set(fw_cfg_boot_set, fw_cfg); } =20 @@ -565,6 +553,11 @@ static int core99_kvm_type(MachineState *machine, cons= t char *arg) return 2; } =20 +static GlobalProperty props[] =3D { + /* MacOS NDRV VGA driver */ + { "VGA", "romfile", NDRV_VGA_FILENAME }, +}; + static void core99_machine_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); @@ -585,6 +578,7 @@ static void core99_machine_class_init(ObjectClass *oc, = void *data) #endif mc->default_ram_id =3D "ppc_core99.ram"; mc->ignore_boot_device_suffixes =3D true; + compat_props_add(mc->compat_props, props, G_N_ELEMENTS(props)); fwc->get_dev_path =3D core99_fw_dev_path; } =20 diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index 5a7b25a4a8..6a1b1ad47a 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -344,18 +344,6 @@ static void ppc_heathrow_init(MachineState *machine) fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_CLOCKFREQ, CLOCKFREQ); fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_BUSFREQ, BUSFREQ); =20 - /* MacOS NDRV VGA driver */ - filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, NDRV_VGA_FILENAME); - if (filename) { - gchar *ndrv_file; - gsize ndrv_size; - - if (g_file_get_contents(filename, &ndrv_file, &ndrv_size, NULL)) { - fw_cfg_add_file(fw_cfg, "ndrv/qemu_vga.ndrv", ndrv_file, ndrv_= size); - } - g_free(filename); - } - qemu_register_boot_set(fw_cfg_boot_set, fw_cfg); } =20 @@ -400,6 +388,11 @@ static int heathrow_kvm_type(MachineState *machine, co= nst char *arg) return 2; } =20 +static GlobalProperty props[] =3D { + /* MacOS NDRV VGA driver */ + { "VGA", "romfile", NDRV_VGA_FILENAME }, +}; + static void heathrow_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); @@ -420,6 +413,7 @@ static void heathrow_class_init(ObjectClass *oc, void *= data) mc->default_display =3D "std"; mc->ignore_boot_device_suffixes =3D true; mc->default_ram_id =3D "ppc_heathrow.ram"; + compat_props_add(mc->compat_props, props, G_N_ELEMENTS(props)); fwc->get_dev_path =3D heathrow_fw_dev_path; } =20 --=20 2.30.6 From nobody Fri May 10 02:58:47 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=eik.bme.hu Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1672872595736233.31393158211142; Wed, 4 Jan 2023 14:49:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDBqx-0006mj-9V; Wed, 04 Jan 2023 17:03:19 -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 1pDBpi-00069d-7z; Wed, 04 Jan 2023 17:02:14 -0500 Received: from zero.eik.bme.hu ([152.66.115.2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDBpe-0003Cs-3r; Wed, 04 Jan 2023 17:02:00 -0500 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id C95207496B0; Wed, 4 Jan 2023 22:59:39 +0100 (CET) Received: by zero.eik.bme.hu (Postfix, from userid 432) id A1E907496AB; Wed, 4 Jan 2023 22:59:39 +0100 (CET) Message-Id: In-Reply-To: References: From: BALATON Zoltan Subject: [PATCH v7 4/7] mac_newworld: Add machine types for different mac99 configs To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Cc: Mark Cave-Ayland Date: Wed, 4 Jan 2023 22:59:39 +0100 (CET) X-Spam-Probability: 8% 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=152.66.115.2; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-ZM-MESSAGEID: 1672872596147100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The mac99 machine emulates different machines depending on machine properties or even if it is run as qemu-system-ppc64 or qemu-system-ppc. This is very confusing for users and many hours were lost trying to explain it or finding out why commands users came up with are not working as expected. (E.g. Windows users might think qemu-system-ppc64 is just the 64 bit version of qemu-system-ppc and then fail to boot a 32 bit OS with -M mac99 trying to follow an example that had qemu-system-ppc.) To avoid such confusion, add explicit machine types for the different configs which will work the same with both qemu-system-ppc and qemu-system-ppc64 and also make the command line clearer for new users. Signed-off-by: BALATON Zoltan --- hw/ppc/mac_newworld.c | 94 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index 60c9c27986..3f5d1ec097 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -642,9 +642,103 @@ static const TypeInfo core99_machine_info =3D { }, }; =20 +static void powermac3_1_machine_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc =3D MACHINE_CLASS(oc); + + core99_machine_class_init(oc, data); + mc->desc =3D "Apple Power Mac G4 AGP (Sawtooth)"; + mc->default_cpu_type =3D POWERPC_CPU_TYPE_NAME("7400_v2.9"); +} + +static void powermac3_1_instance_init(Object *obj) +{ + Core99MachineState *cms =3D CORE99_MACHINE(obj); + + cms->via_config =3D CORE99_VIA_CONFIG_PMU; + return; +} + +static const TypeInfo powermac3_1_machine_info =3D { + .name =3D MACHINE_TYPE_NAME("powermac3_1"), + .parent =3D TYPE_MACHINE, + .class_init =3D powermac3_1_machine_class_init, + .instance_init =3D powermac3_1_instance_init, + .instance_size =3D sizeof(Core99MachineState), + .interfaces =3D (InterfaceInfo[]) { + { TYPE_FW_PATH_PROVIDER }, + { } + }, +}; + +static void powerbook3_2_machine_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc =3D MACHINE_CLASS(oc); + + core99_machine_class_init(oc, data); + mc->desc =3D "Apple PowerBook G4 Titanium (Mercury)"; + mc->default_cpu_type =3D POWERPC_CPU_TYPE_NAME("7400_v2.9"); +} + +static void powerbook3_2_instance_init(Object *obj) +{ + Core99MachineState *cms =3D CORE99_MACHINE(obj); + + cms->via_config =3D CORE99_VIA_CONFIG_PMU_ADB; + return; +} + +static const TypeInfo powerbook3_2_machine_info =3D { + .name =3D MACHINE_TYPE_NAME("powerbook3_2"), + .parent =3D TYPE_MACHINE, + .class_init =3D powerbook3_2_machine_class_init, + .instance_init =3D powerbook3_2_instance_init, + .instance_size =3D sizeof(Core99MachineState), + .interfaces =3D (InterfaceInfo[]) { + { TYPE_FW_PATH_PROVIDER }, + { } + }, +}; + +#ifdef TARGET_PPC64 +static void powermac7_3_machine_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc =3D MACHINE_CLASS(oc); + + core99_machine_class_init(oc, data); + mc->desc =3D "Apple Power Mac G5 (Niagara)"; + mc->default_cpu_type =3D POWERPC_CPU_TYPE_NAME("970fx_v3.1"); +} + +static void powermac7_3_instance_init(Object *obj) +{ + Core99MachineState *cms =3D CORE99_MACHINE(obj); + + cms->via_config =3D CORE99_VIA_CONFIG_PMU; + return; +} + +static const TypeInfo powermac7_3_machine_info =3D { + .name =3D MACHINE_TYPE_NAME("powermac7_3"), + .parent =3D TYPE_MACHINE, + .class_init =3D powermac7_3_machine_class_init, + .instance_init =3D powermac7_3_instance_init, + .instance_size =3D sizeof(Core99MachineState), + .interfaces =3D (InterfaceInfo[]) { + { TYPE_FW_PATH_PROVIDER }, + { } + }, +}; +#endif + static void mac_machine_register_types(void) { type_register_static(&core99_machine_info); + type_register_static(&powermac3_1_machine_info); + type_register_static(&powerbook3_2_machine_info); +#ifdef TARGET_PPC64 + type_register_static(&powermac7_3_machine_info); +#endif } =20 type_init(mac_machine_register_types) --=20 2.30.6 From nobody Fri May 10 02:58:47 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=eik.bme.hu Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 167287256228758.61384146430839; Wed, 4 Jan 2023 14:49:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDBrl-0007Mh-6s; Wed, 04 Jan 2023 17:04:09 -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 1pDBpv-0006Gk-IF; Wed, 04 Jan 2023 17:02:20 -0500 Received: from zero.eik.bme.hu ([152.66.115.2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDBpn-0003Gv-Oh; Wed, 04 Jan 2023 17:02:10 -0500 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id C868B7496B4; Wed, 4 Jan 2023 22:59:40 +0100 (CET) Received: by zero.eik.bme.hu (Postfix, from userid 432) id AB6307496AB; Wed, 4 Jan 2023 22:59:40 +0100 (CET) Message-Id: In-Reply-To: References: From: BALATON Zoltan Subject: [PATCH v7 5/7] mac_newworld: Deprecate mac99 with G5 CPU To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Cc: Mark Cave-Ayland Date: Wed, 4 Jan 2023 22:59:40 +0100 (CET) X-Spam-Probability: 8% 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=152.66.115.2; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-ZM-MESSAGEID: 1672872564101100003 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Besides resolving the confusing behaviour mentioned in previous commit this might also allow unifying qemu-system-ppc and qemu-system-ppc64 in the future. Signed-off-by: BALATON Zoltan --- hw/ppc/mac_newworld.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index 3f5d1ec097..f07c37328b 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -165,6 +165,12 @@ static void ppc_core99_init(MachineState *machine) qemu_register_reset(ppc_core99_reset, cpu); } =20 + if (object_property_find(OBJECT(machine), "via")) { + if (PPC_INPUT(env) =3D=3D PPC_FLAGS_INPUT_970) { + warn_report("mac99 with G5 CPU is deprecated, " + "use powermac7_3 instead"); + } + } /* allocate RAM */ if (machine->ram_size > 2 * GiB) { error_report("RAM size more than 2 GiB is not supported"); --=20 2.30.6 From nobody Fri May 10 02:58:47 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=eik.bme.hu Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1672870470214508.06386490465786; Wed, 4 Jan 2023 14:14:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDBrt-0007in-2S; Wed, 04 Jan 2023 17:04:17 -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 1pDBpp-0006G9-Ri; Wed, 04 Jan 2023 17:02:18 -0500 Received: from zero.eik.bme.hu ([2001:738:2001:2001::2001]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDBpk-0003Gq-9p; Wed, 04 Jan 2023 17:02:08 -0500 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id D4BD57496DA; Wed, 4 Jan 2023 22:59:41 +0100 (CET) Received: by zero.eik.bme.hu (Postfix, from userid 432) id B7FC87496AB; Wed, 4 Jan 2023 22:59:41 +0100 (CET) Message-Id: <4162db13bd1da9c6ddd77f185cef738e44790467.1672868854.git.balaton@eik.bme.hu> In-Reply-To: References: From: BALATON Zoltan Subject: [PATCH v7 6/7] mac_newworld: Deprecate mac99 "via" option To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Cc: Mark Cave-Ayland Date: Wed, 4 Jan 2023 22:59:41 +0100 (CET) X-Spam-Probability: 8% 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:738:2001:2001::2001; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-ZM-MESSAGEID: 1672870471246100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Setting emulated machine type with a property called "via" is confusing users so deprecate the "via" option in favour of newly added explicit machine types. The default via=3Dcuda option is not a valid config (no real Mac has this combination of hardware) so no machine type could be defined for that therefore it is kept for backwards compatibility with older QEMU versions for now but other options resembling real machines are deprecated. Signed-off-by: BALATON Zoltan --- hw/ppc/mac_newworld.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index f07c37328b..adf185bd3a 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -169,6 +169,15 @@ static void ppc_core99_init(MachineState *machine) if (PPC_INPUT(env) =3D=3D PPC_FLAGS_INPUT_970) { warn_report("mac99 with G5 CPU is deprecated, " "use powermac7_3 instead"); + } else { + if (core99_machine->via_config =3D=3D CORE99_VIA_CONFIG_PMU) { + warn_report("mac99,via=3Dpmu is deprecated, " + "use powermac3_1 instead"); + } + if (core99_machine->via_config =3D=3D CORE99_VIA_CONFIG_PMU_AD= B) { + warn_report("mac99,via=3Dpmu-adb is deprecated, " + "use powerbook3_2 instead"); + } } } /* allocate RAM */ --=20 2.30.6 From nobody Fri May 10 02:58:47 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=eik.bme.hu Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1672872448993826.3306055340374; Wed, 4 Jan 2023 14:47:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDBrl-0007Ot-Bu; Wed, 04 Jan 2023 17:04:09 -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 1pDBpv-0006Gj-IC; Wed, 04 Jan 2023 17:02:20 -0500 Received: from zero.eik.bme.hu ([152.66.115.2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDBpm-0003Gt-2n; Wed, 04 Jan 2023 17:02:10 -0500 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id E7E6E755F86; Wed, 4 Jan 2023 22:59:42 +0100 (CET) Received: by zero.eik.bme.hu (Postfix, from userid 432) id C58167496AB; Wed, 4 Jan 2023 22:59:42 +0100 (CET) Message-Id: In-Reply-To: References: From: BALATON Zoltan Subject: [PATCH v7 7/7] mac_newworld: Document deprecation To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Cc: Mark Cave-Ayland Date: Wed, 4 Jan 2023 22:59:42 +0100 (CET) X-Spam-Probability: 8% 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=152.66.115.2; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-ZM-MESSAGEID: 1672872449655100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Also update PowerMac family docs with some more recent info. Signed-off-by: BALATON Zoltan --- docs/about/deprecated.rst | 7 +++++++ docs/system/ppc/powermac.rst | 12 ++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 93affe3669..07661af7fe 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -248,6 +248,13 @@ These old machine types are quite neglected nowadays a= nd thus might have various pitfalls with regards to live migration. Use a newer machine type instead. =20 +``mac99`` variants other than the default qemu-system-ppc version (since 7= .2) +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''= ''' + +The ``mac99`` machine emulates different hardware depending on using +qemu-system-ppc64 or ``via`` property. To avoid confusion new machine +types has been added for these variants which are now preferred over +``mac99``. =20 Backend options --------------- diff --git a/docs/system/ppc/powermac.rst b/docs/system/ppc/powermac.rst index 04334ba210..d4a47a6881 100644 --- a/docs/system/ppc/powermac.rst +++ b/docs/system/ppc/powermac.rst @@ -4,8 +4,12 @@ PowerMac family boards (``g3beige``, ``mac99``) Use the executable ``qemu-system-ppc`` to simulate a complete PowerMac PowerPC system. =20 -- ``g3beige`` Heathrow based PowerMAC -- ``mac99`` Mac99 based PowerMAC +- ``g3beige`` Heathrow based old world Power Macintosh G3 +- ``mac99`` Core99 based generic PowerMac +- ``powermac3_1`` Power Mac G4 AGP (Sawtooth) +- ``powerbook3_2`` PowerBook G4 Titanium (Mercury) +- ``powermac7_3`` Power Mac G5 (Niagara) (only in ``qemu-system-ppc6= 4``) + =20 Supported devices ----------------- @@ -15,9 +19,9 @@ QEMU emulates the following PowerMac peripherals: * UniNorth or Grackle PCI Bridge * PCI VGA compatible card with VESA Bochs Extensions * 2 PMAC IDE interfaces with hard disk and CD-ROM support - * NE2000 PCI adapters + * Sungem PCI network adapter * Non Volatile RAM - * VIA-CUDA with ADB keyboard and mouse. + * VIA-CUDA or VIA-PMU99 with or without ADB or USB keyboard and mouse. =20 =20 Missing devices --=20 2.30.6