diff --git a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/class/hub/usbh_hub.c b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/class/hub/usbh_hub.c index b3edd9419..fb14a72ea 100644 --- a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/class/hub/usbh_hub.c +++ b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/class/hub/usbh_hub.c @@ -23,6 +23,7 @@ Modification: rndis uses naive_mmap to assign virtual and physical addresses and #include "usb_def.h" #include "usyscall.h" +extern void xhci_dump_port_status_debug(int id); //Debugging function #define DEV_FORMAT "/usb%d/hub%d" @@ -696,8 +697,9 @@ static void usbh_hub_thread(void *argument) usb_hc_init(usb->id); while (1) { USB_LOG_DBG("wait event of mq@%p \r\n", usb->hub_mq); - ret = usb_osal_mq_recv(usb->hub_mq, (void *)&hub, 0x7fffffff); + ret = usb_osal_mq_recv(usb->hub_mq, (void *)&hub, 10000); if (ret <= 0) { + xhci_dump_port_status_debug(usb->id); continue; } USB_LOG_DBG("handle event of hub@%p \r\n", hub); 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 536e90929..45f5a9145 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 @@ -666,8 +666,6 @@ int xhci_probe ( struct xhci_host *xhci, unsigned long baseaddr ) { port->protocol = xhci_port_protocol ( xhci, i ); } - xhci_dump(xhci); - return error; err_reset: @@ -1271,6 +1269,8 @@ int xhci_open ( struct xhci_host *xhci ) { /* Start controller */ xhci_run ( xhci ); + xhci_dump(xhci); + return 0; xhci_stop ( xhci ); @@ -3072,6 +3072,19 @@ void xhci_dump(struct xhci_host *xhci){ /* Dump Port status */ void xhci_dump_port_status(uint32_t port, uint32_t portsc) { + USB_LOG_DBG("XHCI port %d portsc %08x\n", port, portsc ); +} +//Debugging function +void xhci_dump_port_status_debug(int id) { + uint32_t portsc; + struct usbh_bus *bus = usbh_get_bus_of_index(id); + struct xhci_host *xhci = (struct xhci_host *)bus->priv; + + USB_LOG_DBG("xhci_status_debug xhci->op_addr + port1 = %08lx\n", xhci->op_addr + XHCI_OP_PORTSC ( 1 )); + portsc = readl ( xhci->op_addr + XHCI_OP_PORTSC ( 1 ) ); + USB_LOG_DBG("xhci_status_debug port=1 portsc=%08x\n", portsc); + portsc = readl ( xhci->op_addr + XHCI_OP_PORTSC ( 2 ) ); + USB_LOG_DBG("xhci_status_debug port=2 portsc=%08x\n", portsc); } /* Dump input context */