summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mauderer <christian.mauderer@embedded-brains.de>2020-05-27 10:08:01 +0200
committerChristian Mauderer <christian.mauderer@embedded-brains.de>2020-07-29 11:19:14 +0200
commitbeaacb5c3046a27a4835a2299fa2e9da0930dca4 (patch)
tree8c0584218b0587fc8b47f0a4bed8f0814ab6a468
parentrtwn_usb: Make sure buffers are cache aligned (diff)
downloadrtems-libbsd-beaacb5c3046a27a4835a2299fa2e9da0930dca4.tar.bz2
busdma: Don't sync nocache memory on ARM
The busdma shouldn't try to flush or invalidate cache in a nocache area.
-rw-r--r--rtemsbsd/rtems/rtems-kernel-bus-dma.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/rtemsbsd/rtems/rtems-kernel-bus-dma.c b/rtemsbsd/rtems/rtems-kernel-bus-dma.c
index 4dc634f3..bda4f3d7 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;