fix(port/dwc2/usb_dc_dwc2): invalid cache before all read setup
Signed-off-by: sakumisu <1203593632@qq.com>
This commit is contained in:
@@ -341,6 +341,8 @@ static void dwc2_ep0_start_read_setup(uint8_t busid, uint8_t *psetup)
|
|||||||
USB_OTG_OUTEP(0U)->DOEPTSIZ |= USB_OTG_DOEPTSIZ_STUPCNT;
|
USB_OTG_OUTEP(0U)->DOEPTSIZ |= USB_OTG_DOEPTSIZ_STUPCNT;
|
||||||
|
|
||||||
if (g_dwc2_udc[busid].user_params.device_dma_enable) {
|
if (g_dwc2_udc[busid].user_params.device_dma_enable) {
|
||||||
|
usb_dcache_invalidate((uintptr_t)&g_dwc2_udc[busid].setup, USB_ALIGN_UP(8, CONFIG_USB_ALIGN_SIZE));
|
||||||
|
|
||||||
USB_OTG_OUTEP(0U)->DOEPDMA = (uint32_t)psetup;
|
USB_OTG_OUTEP(0U)->DOEPDMA = (uint32_t)psetup;
|
||||||
/* EP enable */
|
/* EP enable */
|
||||||
USB_OTG_OUTEP(0U)->DOEPCTL |= USB_OTG_DOEPCTL_EPENA | USB_OTG_DOEPCTL_USBAEP;
|
USB_OTG_OUTEP(0U)->DOEPCTL |= USB_OTG_DOEPCTL_EPENA | USB_OTG_DOEPCTL_USBAEP;
|
||||||
@@ -830,7 +832,6 @@ int usbd_ep_set_stall(uint8_t busid, const uint8_t ep)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((ep_idx == 0) && g_dwc2_udc[busid].user_params.device_dma_enable) {
|
if ((ep_idx == 0) && g_dwc2_udc[busid].user_params.device_dma_enable) {
|
||||||
usb_dcache_invalidate((uintptr_t)&g_dwc2_udc[busid].setup, USB_ALIGN_UP(8, CONFIG_USB_ALIGN_SIZE));
|
|
||||||
dwc2_ep0_start_read_setup(busid, (uint8_t *)&g_dwc2_udc[busid].setup);
|
dwc2_ep0_start_read_setup(busid, (uint8_t *)&g_dwc2_udc[busid].setup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user