diff --git a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/dwc3/dwc3.c b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/dwc3/dwc3.c index e733ee7ab..17c2c4fbd 100644 --- a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/dwc3/dwc3.c +++ b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/dwc3/dwc3.c @@ -108,6 +108,11 @@ int dwc3_alloc_scratch_buffers(struct dwc3 *dwc){ return 0; len = dwc->nr_scratch * DWC3_SCRATCHBUF_SIZE; + + vir_addr = USB_MEM_VIRADDR_ALLOC; + phy_addr = 0; + dwc->scratchbuf = (void *)vir_addr; + ret = naive_mmap(&vir_addr, &phy_addr, len, true); if(ret != 0){ @@ -115,7 +120,7 @@ int dwc3_alloc_scratch_buffers(struct dwc3 *dwc){ ret = -ENOMEM; } - dwc->scratchbuf = (void *)vir_addr; + dwc->scratch_addr = phy_addr; return ret; diff --git a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/dwc3/dwc3.h b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/dwc3/dwc3.h index f047e94c3..b4e6b06cd 100644 --- a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/dwc3/dwc3.h +++ b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/dwc3/dwc3.h @@ -896,6 +896,8 @@ int dwc3_setup_scratch_buffers(struct dwc3 *dwc); int dwc3_alloc_event_buffers(struct dwc3 *dwc, uint32_t length); +struct dwc3_event_buffer *dwc3_alloc_one_event_buffer(struct dwc3 *dwc, unsigned length); + void dwc3_free_event_buffers(struct dwc3 *dwc); int dwc3_event_buffers_setup(struct dwc3 *dwc);