|
From: | Jd Lyons |
Subject: | Re: [Qemu-ppc] (What happened to the pci_databases.c?) Adding Voodoo2 emulation. |
Date: | Mon, 13 Feb 2017 17:56:39 -0500 |
I can’t seem to find any info on adding Openbios as a submodule to qemu, can you give me any information on that?
Add, something like: {
Thanks for the -nographic tip, should come in handy, do you know the shut-down command for Openbios, I can’t seem to figure that one out? I can’t seem to set the Revision ID, I found some info on the PCI Configuration Registers in Bochs voodoo2 emulation: v = new voodoo_state; Bit8u model = (Bit8u)SIM->get_param_enum("model", base)->get(); if (model == VOODOO_2) { init_pci_conf(0x121a, 0x0002, 0x02, 0x038000, 0x00); BX_VOODOO_THIS pci_conf[0x10] = 0x08; } else { init_pci_conf(0x121a, 0x0001, 0x02, 0x000000, 0x00); } BX_VOODOO_THIS pci_conf[0x3d] = BX_PCI_INTA; BX_VOODOO_THIS pci_base_address[0] = 0; voodoo_init(model); Obviously, 0x121a is the Vendor ID, and 0x0002 is the Device ID, 0x038000 must be the Class-code, and I’m not sure if 0x02 is the Sub-device ID or the Sub-System ID, I think 0x00 is the Revision ID. Not sure how to set the revision ID, or the Sub-device ID, I tried: diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c index ac9a764..6537a19 100644 --- a/hw/display/vga-pci.c +++ b/hw/display/vga-pci.c @@ -357,8 +357,13 @@ 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->subclass_id = PCI_SUBCLASS_DISPLAY_3D; + k->revision_id = PCI_VOODOO2_REVISION; + k->subsystem_id = PCI_SUBSYSTEM_ID_VOODOO2; 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..ce6ab6c 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -55,6 +55,16 @@ #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 +#define PCI_SUBVENDOR_ID_3DFX 0x121a +#define PCI_SUBDEVICE_ID_Voodoo2 0x02 +#define PCI_VOODOO2_REVISION 0x00 +#define PCI_SUBSYSTEM_ID_VOODOO2 0x0200 + + /* VMWare (0x15ad) */ #define PCI_VENDOR_ID_VMWARE 0x15ad #define PCI_DEVICE_ID_VMWARE_SVGA2 0x0405 @@ -75,6 +85,7 @@ #define PCI_SUBVENDOR_ID_REDHAT_QUMRANET 0x1af4 #define PCI_SUBDEVICE_ID_QEMU 0x1100 + #define PCI_DEVICE_ID_VIRTIO_NET 0x1000 #define PCI_DEVICE_ID_VIRTIO_BLOCK 0x1001 #define PCI_DEVICE_ID_VIRTIO_BALLOON 0x1002 @@ -213,7 +224,9 @@ typedef struct PCIDeviceClass { uint16_t vendor_id; uint16_t device_id; uint8_t revision; + uint8_t revision_id; uint16_t class_id; + uint16_t subclass_id; uint16_t subsystem_vendor_id; /* only for header type = 0 */ uint16_t subsystem_id; /* only for header type = 0 */ @@ -525,12 +538,24 @@ pci_config_set_device_id(uint8_t *pci_config, uint16_t val) } static inline void +pci_config_set_subclass_id(uint8_t *pci_config, uint16_t val) +{ + pci_set_word(&pci_config[PCI_DEVICE_ID], val); +} + +static inline void pci_config_set_revision(uint8_t *pci_config, uint8_t val) { pci_set_byte(&pci_config[PCI_REVISION_ID], val); } static inline void +pci_config_set_revision_id(uint8_t *pci_config, uint8_t val) +{ + pci_set_byte(&pci_config[PCI_REVISION_ID], val); +} + +static inline void pci_config_set_class(uint8_t *pci_config, uint16_t val) { pci_set_word(&pci_config[PCI_CLASS_DEVICE], val); (END) But I don’t get any .property for the Sub_Class_ID in Opennbios, or Display Name Registry in the Mac OS, nor does the Revision ID change, it stays 2, even tho I’m trying to set it to 0x00?
Thanks Mark, JD |
[Prev in Thread] | Current Thread | [Next in Thread] |