usb_busdma: Add USB_NEED_BUSDMA_COHERENT_ALLOC

Some BSPs have a cache-coherent memory area, however, it should not be
used for the USB controller.
This commit is contained in:
Sebastian Huber
2020-04-14 15:55:33 +02:00
committed by Christian Mauderer
parent 0444b24bf9
commit bd7af5fcee
2 changed files with 9 additions and 0 deletions

View File

@@ -584,7 +584,11 @@ usb_pc_alloc_mem(struct usb_page_cache *pc, struct usb_page *pg,
}
/* allocate memory */
if (bus_dmamem_alloc(
#if !defined(__rtems__) || USB_NEED_BUSDMA_COHERENT_ALLOC
utag->tag, &ptr, (BUS_DMA_WAITOK | BUS_DMA_COHERENT), &map)) {
#else /* __rtems__ */
utag->tag, &ptr, BUS_DMA_WAITOK, &map)) {
#endif /* __rtems__ */
goto error;
}
/* setup page cache */