From aedc9d86fc758400b040ab3566598efa7e665c2e Mon Sep 17 00:00:00 2001 From: xj Date: Wed, 3 Jul 2024 01:19:52 -0700 Subject: [PATCH] update dcbaa functions --- .../services/drivers/usb/components/port/xhci/xhci.c | 4 ++++ .../services/drivers/usb/components/port/xhci/xhci.h | 8 ++++++-- 2 files changed, 10 insertions(+), 2 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 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 */