[PATCH libbsd 07/11] bus-dma, imx: Don't sync nocache area.

Christian Mauderer christian.mauderer at embedded-brains.de
Thu Apr 2 14:42:41 UTC 2020


This area doesn't support all cache operations.

Update #3869.
---
 rtemsbsd/rtems/rtems-kernel-bus-dma.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/rtemsbsd/rtems/rtems-kernel-bus-dma.c b/rtemsbsd/rtems/rtems-kernel-bus-dma.c
index 8c15e92b..8674bef1 100644
--- a/rtemsbsd/rtems/rtems-kernel-bus-dma.c
+++ b/rtemsbsd/rtems/rtems-kernel-bus-dma.c
@@ -48,6 +48,8 @@
 #include <machine/rtems-bsd-kernel-space.h>
 #include <machine/rtems-bsd-cache.h>
 #include <machine/rtems-bsd-bus-dma.h>
+#include <bsp.h>
+#include <bsp/linker-symbols.h>
 
 #include <rtems/malloc.h>
 
@@ -396,6 +398,11 @@ bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op)
 	uintptr_t size = map->buffer_size;
 	uintptr_t begin = (uintptr_t) map->buffer_begin;
 	uintptr_t end = begin + size;
+#if defined(LIBBSP_ARM_IMX_BSP_H)
+	if (begin >= bsp_section_nocache_begin && end <= bsp_section_nocachenoload_end) {
+		return;
+	}
+#endif
 
 	if ((op & BUS_DMASYNC_PREWRITE) != 0 && (op & BUS_DMASYNC_PREREAD) == 0) {
 		rtems_cache_flush_multiple_data_lines((void *) begin, size);
-- 
2.16.4



More information about the devel mailing list