qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] (What happened to the pci_databases.c?) Adding Voodoo2 em


From: Jd Lyons
Subject: Re: [Qemu-ppc] (What happened to the pci_databases.c?) Adding Voodoo2 emulation.
Date: Mon, 13 Feb 2017 13:13:33 -0500


On Feb 13, 2017, at 12:33 PM, Mark Cave-Ayland <address@hidden> wrote:

On 13/02/17 16:19, Jd Lyons wrote:

I’ve got a copy of the Qemu source I downloaded from a place other than
the official git repository, it has a file called pic_datbase.c, but the
Qemu source from the official git repository does’t have this file.

Is this file part of Openbios, or was it ever included in the official
source for Qemu?

This is part of OpenBIOS, however it is possible to install the OpenBIOS
repository as a git sub-module within the QEMU git repository so that
everything is in one place.

Once you've got the OpenBIOS tree, either as a submodule or directly
from github, you'll find the pci_database.c file in drivers/.

Ok, thanks Mark, I’ll look into that.

I’m trying to build emulation for a Voodoo2 into Qemu-PPC, and I have
enumerated the device in the device tree, and name space, but the
Voodoo2 drivers don’t find the device in Mac OS 9.

I’m not sure how driver loading works under the Classic Mac OS’s, as a
PC Voodoo2 would work in a Mac, and the Voodoo2 didn’t have an Option
Rom, the drivers must be looking for something I’m not providing in the
PCI Configuration Registers.

I set,

Vendor ID = 0x121a
Device ID = 0x0002
Subvendor ID = 0x121a
Subdevice ID = 0x0002 ????????
Class-code = 0x02 ???????

I’m not sure what the Subdevice ID is for a Voodoo2, and I’m not sure if
the Class-code should be 0x02 or 3000 for a display device?

The old pci_database.c had:

staticconstpci_subclass_t displ_subclass[] = {
   {
       PCI_SUBCLASS_DISPLAY_VGA, "display controller",
       NULL, NULL, vga_iface,
       NULL, NULL,
   },
   {
       PCI_SUBCLASS_DISPLAY_XGA, "XGA display controller",
       NULL, NULL, NULL,
       NULL, NULL,
   },
   {
       PCI_SUBCLASS_DISPLAY_3D, "3D display controller",
       NULL, NULL, NULL,
       NULL, NULL,
   },
   {
       PCI_SUBCLASS_DISPLAY_OTHER, "misc display controller",
       NULL, NULL, NULL,
       NULL, NULL,
   },
   {
       0xFF, NULL,
       NULL, NULL, NULL,
       NULL, NULL,
   },
};

And  PCI_SUBCLASS_DISPLAY_3D is defined as 0x02, but I’m not sure I
should use it for the Class-code?

I tried a Class-code of 30000, and to pass the property for the Subclass
Display 3D, but it resulted in no video output at all in Qemu-ppc.

staticuint16_t pci_default_sub_vendor_id = PCI_SUBVENDOR_ID_3DFX;
staticuint16_t pci_default_sub_device_id = PCI_SUBDEVICE_ID_Voodoo2;
staticuint16_t pci_default_subclass_display_3d = PCI_SUBCLASS_DISPLAY_3D;

staticvoidpci_set_default_subsystem_id(PCIDevice *pci_dev)
{
   pci_set_word(pci_dev->config + PCI_SUBSYSTEM_VENDOR_ID,
                pci_default_sub_vendor_id);
   pci_set_word(pci_dev->config + PCI_SUBSYSTEM_ID,
                pci_default_sub_device_id);
   pci_set_word(pci_dev->config + PCI_SUBCLASS_DISPLAY_3D,
                pci_default_subclass_display_3d);
}


I’m I passing a property to Openbios that it doesn’t understand?

I couldn’t find anything in the PCI Bus Bindings to deal with a Subclass
Display?

Do you have a git repository somewhere showing your changes to both
OpenBIOS and QEMU? It's a bit difficult to provide some pointers when
it's not possible to see how far you've got.
I’ve not gotten very far, I’m just enumerating the device on the device tree. I haven’t done anything about emulating the Voodoo2 Chipset, itself. I’m not really a programmer, more of a hacker. I figured first step is to get the pci121a,2 into the device tree, then get the OS 9 Voodoo Extension to load, then work on emulating the actual Voodoo chip, ram, and ringbus, the the second may not be possible without the third. I don’t really understand how Driver Matching works in the classic Mac OS’s. I know I can hand OS X the ATY, Rage 128 Pro, in the device tree, and it loads the drivers, even the OpenGL drivers, but I have done nothing about emulating the actual Rage 128 Chip.




I’ve just hacked the code in as part of the Secondary VGA:

Looks something like:

diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c
index ac9a764..0e63fc2 100644
--- a/hw/display/vga-pci.c
+++ b/hw/display/vga-pci.c
@@ -357,8 +357,10 @@ static void secondary_class_init(ObjectClass *klass, void *data)
     DeviceClass *dc = DEVICE_CLASS(klass);
     PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);

 

+    k->vendor_id = PCI_VENDOR_ID_3DFX;
+    k->device_id = PCI_DEVICE_ID_3DFX_Voodoo2;
     k->realize = pci_secondary_vga_realize;
-    k->class_id = PCI_CLASS_DISPLAY_OTHER;
+    k->class_id = PCI_SUBCLASS_DISPLAY_3D;
     dc->props = secondary_pci_properties;
     dc->reset = pci_secondary_vga_reset;
 }
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index a563555..42a071d 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -177,8 +177,8 @@ static void pci_irq_handler(void *opaque, int irq_num, int level);
 static void pci_add_option_rom(PCIDevice *pdev, bool is_default_rom, Error **);
 static void pci_del_option_rom(PCIDevice *pdev);

 

-static uint16_t pci_default_sub_vendor_id = PCI_SUBVENDOR_ID_REDHAT_QUMRANET;
-static uint16_t pci_default_sub_device_id = PCI_SUBDEVICE_ID_QEMU;
+static uint16_t pci_default_sub_vendor_id = PCI_SUBVENDOR_ID_3DFX;
+static uint16_t pci_default_sub_device_id = PCI_SUBDEVICE_ID_Voodoo2;

 

 static QLIST_HEAD(, PCIHostState) pci_host_bridges;

 

diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
index cbc1fdf..2410ac8 100644
--- a/include/hw/pci/pci.h
+++ b/include/hw/pci/pci.h
@@ -55,6 +55,11 @@
 #define PCI_VENDOR_ID_QEMU               0x1234
 #define PCI_DEVICE_ID_QEMU_VGA           0x1111

 

+/*_3DFX_Voodoo2(0x121a)  */
+#define PCI_VENDOR_ID_3DFX               0x121a
+#define PCI_DEVICE_ID_3DFX_Voodoo2       0x0002
+#define PCI_SUBCLASS_DISPLAY_3D          0x02
+
 /* VMWare (0x15ad) */
 #define PCI_VENDOR_ID_VMWARE             0x15ad
 #define PCI_DEVICE_ID_VMWARE_SVGA2       0x0405
@@ -75,6 +80,9 @@
 #define PCI_SUBVENDOR_ID_REDHAT_QUMRANET 0x1af4
 #define PCI_SUBDEVICE_ID_QEMU            0x1100

 

+#define PCI_SUBVENDOR_ID_3DFX            0x121a
+#define PCI_SUBDEVICE_ID_Voodoo2         0x0002
+
 #define PCI_DEVICE_ID_VIRTIO_NET         0x1000
 #define PCI_DEVICE_ID_VIRTIO_BLOCK       0x1001
 #define PCI_DEVICE_ID_VIRTIO_BALLOON     0x1002
(END)

That’s All I really have right now.


ATB,

Mark.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]