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 00116df51..3ac56007c 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,6 +666,8 @@ int xhci_probe ( struct xhci_host *xhci, unsigned long baseaddr ) { port->protocol = xhci_port_protocol ( xhci, i ); } + xhci_dump(xhci); + return error; err_reset: @@ -2977,6 +2979,56 @@ void xhci_event_process(struct xhci_host *xhci) { } +/* Dump host controller registers */ +void xhci_dump(struct xhci_host *xhci){ + unsigned int offset; + unsigned int i; + unsigned int interrupter; + + for ( offset = 0 ; offset < 0x20 ; offset += 0x10 ) { + printf("%08lx: %08lx: ", xhci->cap_addr + offset, xhci->cap + offset ); + for ( i = 0 ; i < 0x10 ; i += 0x04 ) { + printf("%08x ", readl ( xhci->cap_addr + offset + i) ); + } + printf("\n"); + } + printf("\n"); + + for ( offset = 0 ; offset < 0x3c ; offset += 0x10 ) { + printf("%08lx: %08lx: ", xhci->op_addr + offset, xhci->op + offset ); + for ( i = 0 ; i < 0x10 ; i += 0x04 ) { + printf("%08x ", readl ( xhci->op_addr + offset + i) ); + } + printf("\n"); + } + for ( offset = XHCI_OP_PORTSC ( 1 ) ; offset <= XHCI_OP_PORTSC ( xhci->ports ) ; offset += 0x10 ) { + printf("%08lx: %08lx: ", xhci->op_addr + offset, xhci->op + offset ); + for ( i = 0 ; i < 0x10 ; i += 0x04 ) { + printf("%08x ", readl ( xhci->op_addr + offset + i) ); + } + printf("\n"); + } + printf("\n"); + + printf("%08lx: %08lx: ", xhci->run_addr, xhci->run); + printf("%08x ", readl ( xhci->run_addr) ); + printf("\n"); + interrupter = 1; + for ( offset = 0x20 ; offset < 0x20 + (32 * interrupter) ; offset += 0x10 ) { + printf("%08lx: %08lx: ", xhci->run_addr + offset, xhci->run + offset ); + for ( i = 0 ; i < 0x10 ; i += 0x04 ) { + printf("%08x ", readl ( xhci->run_addr + offset + i) ); + } + printf("\n"); + } + printf("\n"); + + printf("%08lx: %08lx: ", xhci->db_addr, xhci->db); + printf("%08x ", readl ( xhci->db_addr) ); + printf("\n"); + printf("\n"); +} + /* Dump Port status */ void xhci_dump_port_status(uint32_t port, uint32_t portsc) { }