[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 19/19] mac_{old, new}world: Pass MacOS VGA NDRV in card ROM in
From: |
BALATON Zoltan |
Subject: |
[PATCH v6 19/19] mac_{old, new}world: Pass MacOS VGA NDRV in card ROM instead of fw_cfg |
Date: |
Fri, 28 Oct 2022 13:56:36 +0200 (CEST) |
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="" (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 <balaton@eik.bme.hu>
---
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 4ca9ab3e03..104835b5a8 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -526,18 +526,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);
- /* MacOS NDRV VGA driver */
- filename = 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);
}
@@ -581,6 +569,11 @@ static int core99_kvm_type(MachineState *machine, const
char *arg)
return 2;
}
+static GlobalProperty props[] = {
+ /* MacOS NDRV VGA driver */
+ { "VGA", "romfile", NDRV_VGA_FILENAME },
+};
+
static void core99_machine_class_init(ObjectClass *oc, void *data)
{
MachineClass *mc = MACHINE_CLASS(oc);
@@ -601,6 +594,7 @@ static void core99_machine_class_init(ObjectClass *oc, void
*data)
#endif
mc->default_ram_id = "ppc_core99.ram";
mc->ignore_boot_device_suffixes = true;
+ compat_props_add(mc->compat_props, props, G_N_ELEMENTS(props));
fwc->get_dev_path = core99_fw_dev_path;
}
diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c
index 558c639202..801123c507 100644
--- a/hw/ppc/mac_oldworld.c
+++ b/hw/ppc/mac_oldworld.c
@@ -345,18 +345,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);
- /* MacOS NDRV VGA driver */
- filename = 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);
}
@@ -401,6 +389,11 @@ static int heathrow_kvm_type(MachineState *machine, const
char *arg)
return 2;
}
+static GlobalProperty props[] = {
+ /* MacOS NDRV VGA driver */
+ { "VGA", "romfile", NDRV_VGA_FILENAME },
+};
+
static void heathrow_class_init(ObjectClass *oc, void *data)
{
MachineClass *mc = MACHINE_CLASS(oc);
@@ -421,6 +414,7 @@ static void heathrow_class_init(ObjectClass *oc, void *data)
mc->default_display = "std";
mc->ignore_boot_device_suffixes = true;
mc->default_ram_id = "ppc_heathrow.ram";
+ compat_props_add(mc->compat_props, props, G_N_ELEMENTS(props));
fwc->get_dev_path = heathrow_fw_dev_path;
}
--
2.30.6
- [PATCH v6 06/19] mac_{old|new}world: Reduce number of QOM casts, (continued)
- [PATCH v6 06/19] mac_{old|new}world: Reduce number of QOM casts, BALATON Zoltan, 2022/10/28
- [PATCH v6 05/19] mac_newworld: Clean up creation of Uninorth devices, BALATON Zoltan, 2022/10/28
- [PATCH v6 14/19] mac_newworld: Turn CORE99_VIA_CONFIG defines into an enum, BALATON Zoltan, 2022/10/28
- [PATCH v6 16/19] mac_newworld: Deprecate mac99 with G5 CPU, BALATON Zoltan, 2022/10/28
- [PATCH v6 18/19] mac_newworld: Document deprecation, BALATON Zoltan, 2022/10/28
- [PATCH v6 09/19] hw/ppc/mac.h: Move grackle-pcihost type declaration out to a header, BALATON Zoltan, 2022/10/28
- [PATCH v6 12/19] mac_nvram: Use NVRAM_SIZE constant, BALATON Zoltan, 2022/10/28
- [PATCH v6 10/19] hw/ppc/mac.h: Move PROM and KERNEL defines to board code, BALATON Zoltan, 2022/10/28
- [PATCH v6 15/19] mac_newworld: Add machine types for different mac99 configs, BALATON Zoltan, 2022/10/28
- [PATCH v6 19/19] mac_{old, new}world: Pass MacOS VGA NDRV in card ROM instead of fw_cfg,
BALATON Zoltan <=
- [PATCH v6 17/19] mac_newworld: Deprecate mac99 "via" option, BALATON Zoltan, 2022/10/28
- [PATCH v6 07/19] hw/ppc/mac.h: Move newworld specific parts out from shared header, BALATON Zoltan, 2022/10/28
- [PATCH v6 11/19] hw/ppc/mac.h: Rename to include/hw/nvram/mac_nvram.h, BALATON Zoltan, 2022/10/28
- [PATCH v6 13/19] mac_{old|new}world: Code style fix adding missing braces to if-s, BALATON Zoltan, 2022/10/28
- [PATCH v6 08/19] hw/ppc/mac.h: Move macio specific parts out from shared header, BALATON Zoltan, 2022/10/28
- Re: [PATCH v6 00/19] Misc ppc/mac machines clean up, Mark Cave-Ayland, 2022/10/30