[rtems-libbsd commit] busdma: Don't sync nocache memory on ARM

Christian Mauderer christianm at rtems.org
Fri Jul 31 06:32:44 UTC 2020


Module:    rtems-libbsd
Branch:    master
Commit:    beaacb5c3046a27a4835a2299fa2e9da0930dca4
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=beaacb5c3046a27a4835a2299fa2e9da0930dca4

Author:    Christian Mauderer <christian.mauderer at embedded-brains.de>
Date:      Wed May 27 10:08:01 2020 +0200

busdma: Don't sync nocache memory on ARM

The busdma shouldn't try to flush or invalidate cache in a nocache area.

---

 rtemsbsd/rtems/rtems-kernel-bus-dma.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/rtemsbsd/rtems/rtems-kernel-bus-dma.c b/rtemsbsd/rtems/rtems-kernel-bus-dma.c
index 4dc634f..bda4f3d 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>
 
@@ -400,6 +402,12 @@ 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;
+#ifdef __arm__
+	if (begin >= (uintptr_t)bsp_section_nocache_begin &&
+	    end <= (uintptr_t)bsp_section_nocachenoload_end) {
+		return;
+	}
+#endif
 
 	if ((map->flags & DMAMAP_CACHE_ALIGNED) != 0) {
 		begin &= ~CLMASK;



More information about the vc mailing list