Modify xhci code to adapt to XIZI.

This commit is contained in:
songyanguang 2024-08-07 18:57:40 +08:00
parent 22b137f92f
commit c637a3d0bc
1 changed files with 6 additions and 3 deletions

View File

@ -319,7 +319,7 @@ static unsigned int xhci_extended_capability ( struct xhci_host *xhci,
*/ */
static void xhci_legacy_init ( struct xhci_host *xhci ) { static void xhci_legacy_init ( struct xhci_host *xhci ) {
unsigned int legacy; unsigned int legacy;
uint8_t bios; uint32_t bios;
/* Locate USB legacy support capability (if present) */ /* Locate USB legacy support capability (if present) */
legacy = xhci_extended_capability ( xhci, XHCI_XECP_ID_LEGACY, 0 ); legacy = xhci_extended_capability ( xhci, XHCI_XECP_ID_LEGACY, 0 );
@ -1633,7 +1633,7 @@ static void xhci_abort ( struct xhci_host *xhci ) {
/* Abort the command */ /* Abort the command */
USB_LOG_WRN("XHCI %s aborting command\n", xhci->name ); USB_LOG_WRN("XHCI %s aborting command\n", xhci->name );
xhci_writeq ( xhci, XHCI_CRCR_CA, xhci->op + XHCI_OP_CRCR ); xhci_writeq ( xhci, XHCI_CRCR_CA, xhci->op_addr + XHCI_OP_CRCR );
/* Allow time for command to abort */ /* Allow time for command to abort */
usb_osal_msleep ( XHCI_COMMAND_ABORT_DELAY_MS ); usb_osal_msleep ( XHCI_COMMAND_ABORT_DELAY_MS );
@ -1649,7 +1649,7 @@ static void xhci_abort ( struct xhci_host *xhci ) {
/* Reset the command ring control register */ /* Reset the command ring control register */
memset(xhci->cmds->ring, 0U, XHCI_RING_ITEMS * sizeof(union xhci_trb)); memset(xhci->cmds->ring, 0U, XHCI_RING_ITEMS * sizeof(union xhci_trb));
xhci_writeq ( xhci, ( (uint64_t)(uintptr_t)xhci->cmds | xhci->cmds->cs ), xhci->op + XHCI_OP_CRCR ); xhci_writeq ( xhci, ( (uint64_t)(uintptr_t)xhci->cmds | xhci->cmds->cs ), xhci->op_addr + XHCI_OP_CRCR );
} }
/** /**
@ -1837,7 +1837,9 @@ static int xhci_context ( struct xhci_host *xhci, struct xhci_slot *slot,
} }
err_command: err_command:
#if 0
usb_free ( input ); usb_free ( input );
#endif
err_alloc: err_alloc:
return rc; return rc;
} }
@ -2203,6 +2205,7 @@ static void xhci_configure_endpoint_input ( struct xhci_host *xhci,
/* Populate control context */ /* Populate control context */
control_ctx = input; control_ctx = input;
/* see XHCI.pdf page 119 */
control_ctx->add = CPU_TO_LE32 (( 1 << XHCI_CTX_SLOT ) | ( 1 << endpoint->ctx ) ); control_ctx->add = CPU_TO_LE32 (( 1 << XHCI_CTX_SLOT ) | ( 1 << endpoint->ctx ) );
control_ctx->drop = CPU_TO_LE32 (( 1 << XHCI_CTX_SLOT ) | ( 1 << endpoint->ctx ) ); control_ctx->drop = CPU_TO_LE32 (( 1 << XHCI_CTX_SLOT ) | ( 1 << endpoint->ctx ) );