@@ -680,6 +680,12 @@ static void uhci_wakeup(USBPort *port1)
{
UHCIState *s = port1->opaque;
UHCIPort *port = &s->ports[port1->index];
+ uint8_t *pci_conf = s->dev.config;
+
+ /* Do not resume UHCI when UHCI PIRQ was disabled */
+ if (pci_conf[0xc1] == 0x00 && pci_conf[0xc0] == 0x00) {
+ return;
+ }
if (port->ctrl & UHCI_PORT_SUSPEND && !(port->ctrl & UHCI_PORT_RD)) {
port->ctrl |= UHCI_PORT_RD;
@@ -1241,6 +1247,10 @@ static int usb_uhci_common_initfn(PCIDevice *dev)
/* TODO: reset value should be 0. */
pci_conf[USB_SBRN] = USB_RELEASE_1; // release number
+ /* LEGACY SUPPORT REGISTER - UHCI11D 5.2.1 */
+ pci_conf[0xc0] |= 0x00;
+ pci_conf[0xc1] |= 0x20; /* Enable USB PIRQ */
+
pci_config_set_interrupt_pin(pci_conf, u->info.irq_pin + 1);
if (s->masterbus) {
Signed-off-by: Gonglei <arei.gonglei@huawei.com> --- hw/usb/hcd-uhci.c | 10 ++++++++++ 1 file changed, 10 insertions(+)