Add interrupt processing functions

This commit is contained in:
xj 2024-08-08 20:03:37 -07:00
parent cd35c4e733
commit 4170e41ab7
1 changed files with 25 additions and 0 deletions

View File

@ -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);
}