From ab573e238e9472f692ba1756027339c240dad552 Mon Sep 17 00:00:00 2001 From: xj Date: Fri, 5 Jul 2024 01:11:33 -0700 Subject: [PATCH] Implant scratchpad buffer functions --- .../services/drivers/usb/components/port/xhci/xhci.c | 3 ++- .../services/drivers/usb/components/port/xhci/xhci.h | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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 da275556a..abc84d67a 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 @@ -698,6 +698,7 @@ static int xhci_dcbaa_alloc ( struct xhci_host *xhci ) { } xhci->dcbaa_addr = dcbaap_addr; + xhci->dcbaa.context = (void *)dcbaap_phy; #if 0 if ( ! xhci->dcbaa.context ) { @@ -707,7 +708,7 @@ static int xhci_dcbaa_alloc ( struct xhci_host *xhci ) { } #endif - memset ( xhci->dcbaa.context, 0, len ); + memset ( (void *)xhci->dcbaa_addr, 0, len ); /* Program DCBAA pointer */ // dcbaap = (uintptr_t)( xhci->dcbaa.context ); 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 1d8403a4e..9c5a4b156 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 @@ -75,6 +75,12 @@ struct xhci_scratchpad { uintptr_t buffer; /** Scratchpad array */ uint64_t *array; + /* + * vir_addr: Vitual address array. It holds all the virtual address of the pages allocated to xHCI scratchpad buffer. + * array_phy: Physical address of array. + */ + uint64_t *vir_addr; + uintptr_t array_phy; }; /** An input control context */