diff --git a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/xhci.c b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/xhci.c index a86acaf22..193907743 100644 --- a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/xhci.c +++ b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/xhci.c @@ -358,18 +358,26 @@ static void xhci_legacy_claim ( struct xhci_host *xhci ) { return; /* Claim ownership */ +// writeb ( XHCI_USBLEGSUP_OS_OWNED, +// xhci->cap + xhci->legacy + XHCI_USBLEGSUP_OS ); + writeb ( XHCI_USBLEGSUP_OS_OWNED, - xhci->cap + xhci->legacy + XHCI_USBLEGSUP_OS ); + xhci->cap_addr + xhci->legacy + XHCI_USBLEGSUP_OS ); /* Wait for BIOS to release ownership */ for ( i = 0 ; i < XHCI_USBLEGSUP_MAX_WAIT_MS ; i++ ) { /* Check if BIOS has released ownership */ - bios = readb ( xhci->cap + xhci->legacy + XHCI_USBLEGSUP_BIOS ); +// bios = readb ( xhci->cap + xhci->legacy + XHCI_USBLEGSUP_BIOS ); + bios = readb ( xhci->cap_addr + xhci->legacy + XHCI_USBLEGSUP_BIOS ); + if ( ! ( bios & XHCI_USBLEGSUP_BIOS_OWNED ) ) { USB_LOG_DBG("XHCI %s claimed ownership from BIOS\n", xhci->name ); - ctlsts = readl ( xhci->cap + xhci->legacy + +// ctlsts = readl ( xhci->cap + xhci->legacy + +// XHCI_USBLEGSUP_CTLSTS ); + + ctlsts = readl ( xhci->cap_addr + xhci->legacy + XHCI_USBLEGSUP_CTLSTS ); if ( ctlsts ) { USB_LOG_DBG("XHCI %s warning: BIOS retained " @@ -428,15 +436,18 @@ static int xhci_stop ( struct xhci_host *xhci ) { unsigned int i; /* Clear run/stop bit */ - usbcmd = readl ( xhci->op + XHCI_OP_USBCMD ); +// usbcmd = readl ( xhci->op + XHCI_OP_USBCMD ); + usbcmd = readl ( xhci->op_addr + XHCI_OP_USBCMD ); usbcmd &= ~XHCI_USBCMD_RUN; - writel ( usbcmd, xhci->op + XHCI_OP_USBCMD ); +// writel ( usbcmd, xhci->op + XHCI_OP_USBCMD ); + writel ( usbcmd, xhci->op_addr + XHCI_OP_USBCMD ); /* Wait for device to stop */ for ( i = 0 ; i < XHCI_STOP_MAX_WAIT_MS ; i++ ) { /* Check if device is stopped */ - usbsts = readl ( xhci->op + XHCI_OP_USBSTS ); +// usbsts = readl ( xhci->op + XHCI_OP_USBSTS ); + usbsts = readl ( xhci->op_addr + XHCI_OP_USBSTS ); if ( usbsts & XHCI_USBSTS_HCH ) return 0;