busdma: Option to round to cache lines on sync

Some targets support only flushing or invalidating complete cache lines.
In this cases misaligned buffers might lead to unexpected results. This
patch adds a flag that allows drivers to signal to the bus dma driver
that it is OK to round a buffer to the next full cache line. That's for
example necessary if a driver wants to send out 14 byte via a USB DMA.
Only the driver knows whether these 14 bytes are located in an otherwise
unused cache line aligned buffer.
This commit is contained in:
Christian Mauderer
2020-04-02 16:42:43 +02:00
parent 7e5d93bb6b
commit 4820ccecc9
8 changed files with 81 additions and 0 deletions

View File

@@ -75,6 +75,9 @@ struct bus_dma_tag {
struct bus_dmamap {
void *buffer_begin;
bus_size_t buffer_size;
int flags;
/* OK to flush / invalidate the complete cache line */
#define DMAMAP_CACHE_ALIGNED (1 << 0)
};
int