From 0c8c8434dc54ad92a3c75d31d86a7d7d39e44864 Mon Sep 17 00:00:00 2001 From: Simone Lombardo Date: Sun, 25 Jun 2023 18:50:39 +0300 Subject: [PATCH] [USBOHCI] Workaround for interrupts problem on Xbox CORE-16352 --- drivers/usb/usbohci/usbohci.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/usb/usbohci/usbohci.c b/drivers/usb/usbohci/usbohci.c index 7bfac5f939c5c..b6f9aef4af16f 100644 --- a/drivers/usb/usbohci/usbohci.c +++ b/drivers/usb/usbohci/usbohci.c @@ -2124,6 +2124,10 @@ OHCI_CheckController(IN PVOID ohciExtension) ULONG FmNumber; USHORT FmDiff; POHCI_HCCA HcHCCA; + PULONG InterruptEnableReg = (PULONG)&OhciExtension->OperationalRegs->HcInterruptEnable; + PULONG InterruptStatusReg = (PULONG)&OhciExtension->OperationalRegs->HcInterruptStatus; + OHCI_REG_INTERRUPT_STATUS IntStatus; + OHCI_REG_INTERRUPT_ENABLE_DISABLE IntEnable; //DPRINT_OHCI("OHCI_CheckController: ...\n"); @@ -2132,6 +2136,14 @@ OHCI_CheckController(IN PVOID ohciExtension) if (!OHCI_HardwarePresent(OhciExtension, TRUE)) return; + /* Clear all bits in HcInterruptStatus register */ + IntStatus.AsULONG = 0xFFFFFFFF; + WRITE_REGISTER_ULONG(InterruptStatusReg, IntStatus.AsULONG); + /* Setup HcInterruptEnable register */ + IntEnable.AsULONG = 0xFFFFFFFF; + IntEnable.Reserved1 = 0; + WRITE_REGISTER_ULONG(InterruptEnableReg, IntEnable.AsULONG); + HcControlReg = (PULONG)&OperationalRegs->HcControl; HcControl.AsULONG = READ_REGISTER_ULONG(HcControlReg);