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 e0020f1e2..80157a736 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 @@ -674,6 +674,7 @@ err_reset: static int xhci_dcbaa_alloc ( struct xhci_host *xhci ) { size_t len; uintptr_t dcbaap; + uint64_t dcbaap_phy; int rc; /* Allocate and initialise structure. Must be at least @@ -683,6 +684,9 @@ static int xhci_dcbaa_alloc ( struct xhci_host *xhci ) { */ len = ( ( xhci->slots + 1 ) * sizeof ( xhci->dcbaa.context[0] ) ); xhci->dcbaa.context = usb_align(xhci_align ( len ), len); + + // + if ( ! xhci->dcbaa.context ) { USB_LOG_ERR("XHCI %s could not allocate DCBAA\n", xhci->name ); rc = -ENOMEM; diff --git a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/xhci.h b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/xhci.h index d701eb935..aead37d00 100644 --- a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/xhci.h +++ b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/xhci.h @@ -859,8 +859,12 @@ struct xhci_host { /** USB legacy support capability (if present and enabled) */ unsigned int legacy; - /** Device context base address array */ - void *phy_acbaa; + /* + * Device context base address array. + * + * dcbaa_addr holds the virtual address of the dcbaa, meanwhile acbaa keeps the value that should be writen to XHCI_OP_DCBAAP. + */ + void *dcbaa_addr; struct xhci_dcbaa dcbaa; /** Scratchpad buffer */