forked from xuos/xiuos
Adding more USB hardware information for RK3568
This commit is contained in:
parent
9ce7259447
commit
7c48797ecf
|
@ -218,7 +218,8 @@ static void xhci_init ( struct xhci_host *xhci, void *regs ) {
|
||||||
xhci->db_addr = ( xhci->cap_addr + dboff );
|
xhci->db_addr = ( xhci->cap_addr + dboff );
|
||||||
|
|
||||||
/* avoid access XHCI_REG_CAP_HCIVERSION = 0x2, unaligned memory */
|
/* 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",
|
USB_LOG_DBG("XHCI %s version %x cap %08lx op %08lx run %08lx db %08lx\n",
|
||||||
xhci->name, xhci->version, ( xhci->cap ),
|
xhci->name, xhci->version, ( xhci->cap ),
|
||||||
|
@ -230,7 +231,9 @@ static void xhci_init ( struct xhci_host *xhci, void *regs ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read structural parameters 1 */
|
/* 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->slots = XHCI_HCSPARAMS1_SLOTS ( hcsparams1 );
|
||||||
xhci->intrs = XHCI_HCSPARAMS1_INTRS ( hcsparams1 );
|
xhci->intrs = XHCI_HCSPARAMS1_INTRS ( hcsparams1 );
|
||||||
xhci->ports = XHCI_HCSPARAMS1_PORTS ( 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 );
|
xhci->name, xhci->slots, xhci->intrs, xhci->ports );
|
||||||
|
|
||||||
/* Read structural parameters 2 */
|
/* 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 );
|
xhci->scratch.count = XHCI_HCSPARAMS2_SCRATCHPADS ( hcsparams2 );
|
||||||
USB_LOG_DBG("XHCI %s needs %d scratchpads\n",
|
USB_LOG_DBG("XHCI %s needs %d scratchpads\n",
|
||||||
xhci->name, xhci->scratch.count );
|
xhci->name, xhci->scratch.count );
|
||||||
|
|
||||||
/* Read capability parameters 1 */
|
/* 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->addr64 = XHCI_HCCPARAMS1_ADDR64 ( hccparams1 );
|
||||||
xhci->csz_shift = XHCI_HCCPARAMS1_CSZ_SHIFT ( hccparams1 );
|
xhci->csz_shift = XHCI_HCCPARAMS1_CSZ_SHIFT ( hccparams1 );
|
||||||
xhci->xecp = (XHCI_HCCPARAMS1_XECP ( 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) );
|
xhci->name, (xhci->addr64 ? 64 : 32) );
|
||||||
|
|
||||||
/* Read page size */
|
/* 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 );
|
xhci->pagesize = XHCI_PAGESIZE ( pagesize );
|
||||||
USB_ASSERT ( xhci->pagesize != 0 );
|
USB_ASSERT ( xhci->pagesize != 0 );
|
||||||
USB_ASSERT ( ( ( xhci->pagesize ) & ( xhci->pagesize - 1 ) ) == 0 );
|
USB_ASSERT ( ( ( xhci->pagesize ) & ( xhci->pagesize - 1 ) ) == 0 );
|
||||||
|
|
Loading…
Reference in New Issue