From 6454b7b9d40120eadc8bc245c8c76b14ecf4c5d8 Mon Sep 17 00:00:00 2001 From: wutno Date: Fri, 22 Oct 2021 04:29:28 -0400 Subject: [PATCH] xbox: Change PCI IDs for USB and IDE controllers to match Xbox --- hw/ide/piix.c | 6 ++++++ hw/usb/hcd-ohci-pci.c | 10 ++++++++++ include/hw/pci/pci_ids.h | 2 ++ 3 files changed, 18 insertions(+) diff --git a/hw/ide/piix.c b/hw/ide/piix.c index d3e738320b..e372e0fa84 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -228,8 +228,14 @@ static void piix3_ide_class_init(ObjectClass *klass, void *data) dc->reset = piix_ide_reset; k->realize = pci_piix_ide_realize; k->exit = pci_piix_ide_exitfn; +#ifdef XBOX + k->vendor_id = PCI_VENDOR_ID_NVIDIA; + k->device_id = PCI_DEVICE_ID_NVIDIA_NFORCE_IDE; + k->revision = 0xB1; +#else k->vendor_id = PCI_VENDOR_ID_INTEL; k->device_id = PCI_DEVICE_ID_INTEL_82371SB_1; +#endif k->class_id = PCI_CLASS_STORAGE_IDE; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); dc->hotpluggable = false; diff --git a/hw/usb/hcd-ohci-pci.c b/hw/usb/hcd-ohci-pci.c index 8e1146b862..5e12e2f81e 100644 --- a/hw/usb/hcd-ohci-pci.c +++ b/hw/usb/hcd-ohci-pci.c @@ -134,11 +134,21 @@ static void ohci_pci_class_init(ObjectClass *klass, void *data) k->realize = usb_ohci_realize_pci; k->exit = usb_ohci_exit; +#ifdef XBOX + k->vendor_id = PCI_VENDOR_ID_NVIDIA; + k->device_id = PCI_DEVICE_ID_NVIDIA_NFORCE_USB; + k->revision = 0xB1; +#else k->vendor_id = PCI_VENDOR_ID_APPLE; k->device_id = PCI_DEVICE_ID_APPLE_IPID_USB; +#endif k->class_id = PCI_CLASS_SERIAL_USB; set_bit(DEVICE_CATEGORY_USB, dc->categories); +#ifdef XBOX + dc->desc = "nForce USB Controller"; +#else dc->desc = "Apple USB Controller"; +#endif device_class_set_props(dc, ohci_pci_properties); dc->hotpluggable = false; dc->vmsd = &vmstate_ohci; diff --git a/include/hw/pci/pci_ids.h b/include/hw/pci/pci_ids.h index 38b41189c6..0655d8caa3 100644 --- a/include/hw/pci/pci_ids.h +++ b/include/hw/pci/pci_ids.h @@ -289,6 +289,8 @@ #define PCI_DEVICE_ID_NVIDIA_NFORCE_LPC 0x01b2 #define PCI_DEVICE_ID_NVIDIA_NFORCE_SMBUS 0x01b4 #define PCI_DEVICE_ID_NVIDIA_NFORCE_AGP 0x01b7 +#define PCI_DEVICE_ID_NVIDIA_NFORCE_IDE 0x01bc +#define PCI_DEVICE_ID_NVIDIA_NFORCE_USB 0x01c2 #define PCI_DEVICE_ID_NVIDIA_NVENET_1 0x01c3 #define PCI_DEVICE_ID_NVIDIA_GEFORCE_NV2A 0x02a0