--- zzzz-none-000/linux-5.4.213/arch/arm/include/asm/cacheflush.h 2022-09-15 10:04:56.000000000 +0000 +++ alder-5690pro-762/linux-5.4.213/arch/arm/include/asm/cacheflush.h 2024-08-14 09:01:27.000000000 +0000 @@ -91,6 +91,21 @@ * DMA Cache Coherency * =================== * + * dma_inv_range(start, end) + * + * Invalidate (discard) the specified virtual address range. + * May not write back any entries. If 'start' or 'end' + * are not cache line aligned, those lines must be written + * back. + * - start - virtual start address + * - end - virtual end address + * + * dma_clean_range(start, end) + * + * Clean (write back) the specified virtual address range. + * - start - virtual start address + * - end - virtual end address + * * dma_flush_range(start, end) * * Clean and invalidate the specified virtual address range. @@ -112,7 +127,12 @@ void (*dma_map_area)(const void *, size_t, int); void (*dma_unmap_area)(const void *, size_t, int); + void (*dma_inv_range)(const void *, const void *); + void (*dma_inv_range_no_dsb)(const void *, const void *); + void (*dma_clean_range)(const void *, const void *); + void (*dma_clean_range_no_dsb)(const void *, const void *); void (*dma_flush_range)(const void *, const void *); + void (*dma_flush_range_no_dsb)(const void *, const void *); } __no_randomize_layout; /* @@ -137,7 +157,12 @@ * is visible to DMA, or data written by DMA to system memory is * visible to the CPU. */ +#define dmac_inv_range cpu_cache.dma_inv_range +#define dmac_inv_range_no_dsb cpu_cache.dma_inv_range_no_dsb +#define dmac_clean_range cpu_cache.dma_clean_range +#define dmac_clean_range_no_dsb cpu_cache.dma_clean_range_no_dsb #define dmac_flush_range cpu_cache.dma_flush_range +#define dmac_flush_range_no_dsb cpu_cache.dma_flush_range_no_dsb #else @@ -156,7 +181,12 @@ * is visible to DMA, or data written by DMA to system memory is * visible to the CPU. */ +extern void dmac_inv_range(const void *start, const void *end); +extern void dmac_inv_range_no_dsb(const void *start, const void *end); +extern void dmac_clean_range(const void *start, const void *end); +extern void dmac_clean_range_no_dsb(const void *start, const void *end); extern void dmac_flush_range(const void *, const void *); +extern void dmac_flush_range_no_dsb(const void *, const void *); #endif