From 3928cd46b7fd8b92629f4c502a7392c3adc5bbb3 Mon Sep 17 00:00:00 2001 From: xj Date: Thu, 1 Aug 2024 20:09:00 -0700 Subject: [PATCH] Replanting xhci_event_process function --- .../drivers/usb/components/port/xhci/xhci.c | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 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 5bca1de1a..8f169c1d4 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 @@ -2794,11 +2794,13 @@ static void xhci_host_controller ( struct xhci_host *xhci, void xhci_event_process(struct xhci_host *xhci) { struct xhci_ring *evts = xhci->evts; unsigned int evt_type; - uint32_t nidx; - uint32_t cs; - union xhci_trb *trb; - uint32_t control; - uint64_t erdp; + uint32_t nidx; + uint32_t cs; + union xhci_trb *trb; + uint32_t control; + uint64_t erdp; + uintptr_t evts_phy = xhci->evts_phy; + /* check and ack event */ for (;;) { @@ -2854,9 +2856,14 @@ void xhci_event_process(struct xhci_host *xhci) { evts->nidx = nidx; /* Update dequeue pointer if applicable */ - erdp = (uint64_t)(unsigned long)(evts->ring + nidx); - xhci_writeq ( xhci, (uintptr_t)( erdp ) | XHCI_RUN_ERDP_EHB, - xhci->run + XHCI_RUN_ERDP ( 0 ) ); +// erdp = (uint64_t)(unsigned long)(evts->ring + nidx); + erdp = (uint64_t)(unsigned long)(evts_phy + nidx * sizeof(union xhci_trb)); +#if 0 + xhci_writeq ( xhci, (uintptr_t)( erdp ) | XHCI_RUN_ERDP_EHB, + xhci->run + XHCI_RUN_ERDP ( 0 ) ); +#endif + xhci_writeq ( xhci, (uintptr_t)( erdp ) | XHCI_RUN_ERDP_EHB, + xhci->run_addr + XHCI_RUN_ERDP ( 0 ) ); } return;