From 9ce725944779d3cdefe2867f113f569d86531963 Mon Sep 17 00:00:00 2001 From: xj Date: Fri, 28 Jun 2024 04:32:00 -0700 Subject: [PATCH] Adding more USB hardware information for RK3568 --- .../drivers/usb/components/port/xhci/xhci.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) 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 41aa8200d..b91cc0f36 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 @@ -196,15 +196,26 @@ static void xhci_init ( struct xhci_host *xhci, void *regs ) { cap_vir_addr = usb_hc_get_register_vir_base(id); if(!mmap(cap_vir_addr, regs, USB3_ADDR_OFFSET_UPPER_BOUND, true)){ - + return; } - caplength = readb ( xhci->cap + XHCI_CAP_CAPLENGTH ); - rtsoff = readl ( xhci->cap + XHCI_CAP_RTSOFF ); - dboff = readl ( xhci->cap + XHCI_CAP_DBOFF ); + xhci->cap_addr = xhci->base_addr = cap_vir_addr; + +// caplength = readb ( xhci->cap + XHCI_CAP_CAPLENGTH ); + caplength = readb ( xhci->cap_addr + XHCI_CAP_CAPLENGTH ); +// rtsoff = readl ( xhci->cap + XHCI_CAP_RTSOFF ); + rtsoff = readl ( xhci->cap_addr + XHCI_CAP_RTSOFF ); + +// dboff = readl ( xhci->cap + XHCI_CAP_DBOFF ); + dboff = readl ( xhci->cap_addr + XHCI_CAP_DBOFF ); xhci->op = ( xhci->cap + caplength ); + xhci->op_addr = ( xhci->cap_addr + caplength ); + xhci->run = ( xhci->cap + rtsoff ); + xhci->run_addr = ( xhci->cap_addr + rtsoff ); + xhci->db = ( xhci->cap + dboff ); + 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);