From 4170e41ab7a82d13cc0a380212a011016a73c4ef Mon Sep 17 00:00:00 2001 From: xj Date: Thu, 8 Aug 2024 20:03:37 -0700 Subject: [PATCH] Add interrupt processing functions --- .../usb/components/port/xhci/usb_hc_xhci.c | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/usb_hc_xhci.c b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/usb_hc_xhci.c index f52dcb11c..9d5d72de4 100644 --- a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/usb_hc_xhci.c +++ b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/usb_hc_xhci.c @@ -1029,6 +1029,31 @@ int xhci_usbh_kill_urb(struct usbh_urb *urb){ void XHCI_USBH_IRQHandler(void *param){ + intptr_t id; + struct xhci_host *xhci; + struct xhci_endpoint *work_pipe; + uint32_t usbsts; + uint32_t runtime; + + id = (intptr_t)param; + + if(id < 0 || id >= CONFIG_USBHOST_XHCI_NUM){ + return; + } + + xhci = &xhci_host[id]; + USB_ASSERT(xhci); + + /* clear interrupt status */ + usbsts = readl ( xhci->op_addr + XHCI_OP_USBSTS ); + usbsts |= XHCI_USBSTS_EINT; + writel(usbsts, xhci->op_addr + XHCI_OP_USBSTS); + + /* ack interrupt */ + runtime = readl(xhci->run_addr + XHCI_RUN_IR_IMAN ( 0 )); + runtime |= XHCI_RUN_IR_IMAN_IP; + writel (runtime, xhci->run_addr + XHCI_RUN_IR_IMAN ( 0 )); + (void)xhci_event_process(xhci); }