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 b91cc0f36..41c1a9c1b 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 @@ -218,7 +218,8 @@ static void xhci_init ( struct xhci_host *xhci, void *regs ) { xhci->db_addr = ( xhci->cap_addr + dboff ); /* avoid access XHCI_REG_CAP_HCIVERSION = 0x2, unaligned memory */ - xhci->version = ((readl ( xhci->cap + XHCI_CAP_CAPLENGTH ) >> 16) & 0xffff); + // xhci->version = ((readl ( xhci->cap + XHCI_CAP_CAPLENGTH ) >> 16) & 0xffff); + xhci->version = ((readl ( xhci->cap_addr + XHCI_CAP_CAPLENGTH ) >> 16) & 0xffff); USB_LOG_DBG("XHCI %s version %x cap %08lx op %08lx run %08lx db %08lx\n", xhci->name, xhci->version, ( xhci->cap ), @@ -230,7 +231,9 @@ static void xhci_init ( struct xhci_host *xhci, void *regs ) { } /* Read structural parameters 1 */ - hcsparams1 = readl ( xhci->cap + XHCI_CAP_HCSPARAMS1 ); +// hcsparams1 = readl ( xhci->cap + XHCI_CAP_HCSPARAMS1 ); + hcsparams1 = readl ( xhci->cap_addr + XHCI_CAP_HCSPARAMS1 ); + xhci->slots = XHCI_HCSPARAMS1_SLOTS ( hcsparams1 ); xhci->intrs = XHCI_HCSPARAMS1_INTRS ( hcsparams1 ); xhci->ports = XHCI_HCSPARAMS1_PORTS ( hcsparams1 ); @@ -238,13 +241,16 @@ static void xhci_init ( struct xhci_host *xhci, void *regs ) { xhci->name, xhci->slots, xhci->intrs, xhci->ports ); /* Read structural parameters 2 */ - hcsparams2 = readl ( xhci->cap + XHCI_CAP_HCSPARAMS2 ); +// hcsparams2 = readl ( xhci->cap + XHCI_CAP_HCSPARAMS2 ); + hcsparams2 = readl ( xhci->cap_addr + XHCI_CAP_HCSPARAMS2 ); xhci->scratch.count = XHCI_HCSPARAMS2_SCRATCHPADS ( hcsparams2 ); USB_LOG_DBG("XHCI %s needs %d scratchpads\n", xhci->name, xhci->scratch.count ); /* Read capability parameters 1 */ - hccparams1 = readl ( xhci->cap + XHCI_CAP_HCCPARAMS1 ); +// hccparams1 = readl ( xhci->cap + XHCI_CAP_HCCPARAMS1 ); + hccparams1 = readl ( xhci->cap_addr + XHCI_CAP_HCCPARAMS1 ); + xhci->addr64 = XHCI_HCCPARAMS1_ADDR64 ( hccparams1 ); xhci->csz_shift = XHCI_HCCPARAMS1_CSZ_SHIFT ( hccparams1 ); xhci->xecp = (XHCI_HCCPARAMS1_XECP ( hccparams1 )); @@ -252,7 +258,9 @@ static void xhci_init ( struct xhci_host *xhci, void *regs ) { xhci->name, (xhci->addr64 ? 64 : 32) ); /* Read page size */ - pagesize = readl ( xhci->op + XHCI_OP_PAGESIZE ); +// pagesize = readl ( xhci->op + XHCI_OP_PAGESIZE ); + pagesize = readl ( xhci->op_addr + XHCI_OP_PAGESIZE ); + xhci->pagesize = XHCI_PAGESIZE ( pagesize ); USB_ASSERT ( xhci->pagesize != 0 ); USB_ASSERT ( ( ( xhci->pagesize ) & ( xhci->pagesize - 1 ) ) == 0 );