Revision afcc3cdf hw/usb-uhci.c

b/hw/usb-uhci.c
783 783
    register_ioport_read(addr, 32, 1, uhci_ioport_readb, s);
784 784
}
785 785

  
786
void usb_uhci_init(PCIBus *bus, int devfn)
786
void usb_uhci_piix3_init(PCIBus *bus, int devfn)
787 787
{
788 788
    UHCIState *s;
789 789
    uint8_t *pci_conf;
......
817 817
    pci_register_io_region(&s->dev, 4, 0x20, 
818 818
                           PCI_ADDRESS_SPACE_IO, uhci_map);
819 819
}
820

  
821
void usb_uhci_piix4_init(PCIBus *bus, int devfn)
822
{
823
    UHCIState *s;
824
    uint8_t *pci_conf;
825
    int i;
826

  
827
    s = (UHCIState *)pci_register_device(bus,
828
                                        "USB-UHCI", sizeof(UHCIState),
829
                                        devfn, NULL, NULL);
830
    pci_conf = s->dev.config;
831
    pci_conf[0x00] = 0x86;
832
    pci_conf[0x01] = 0x80;
833
    pci_conf[0x02] = 0x12;
834
    pci_conf[0x03] = 0x71;
835
    pci_conf[0x08] = 0x01; // revision number
836
    pci_conf[0x09] = 0x00;
837
    pci_conf[0x0a] = 0x03;
838
    pci_conf[0x0b] = 0x0c;
839
    pci_conf[0x0e] = 0x00; // header_type
840
    pci_conf[0x3d] = 4; // interrupt pin 3
841
    pci_conf[0x60] = 0x10; // release number
842

  
843
    for(i = 0; i < NB_PORTS; i++) {
844
        qemu_register_usb_port(&s->ports[i].port, s, i, uhci_attach);
845
    }
846
    s->frame_timer = qemu_new_timer(vm_clock, uhci_frame_timer, s);
847

  
848
    uhci_reset(s);
849

  
850
    /* Use region 4 for consistency with real hardware.  BSD guests seem
851
       to rely on this.  */
852
    pci_register_io_region(&s->dev, 4, 0x20,
853
                           PCI_ADDRESS_SPACE_IO, uhci_map);
854
}
855

  

Also available in: Unified diff