summaryrefslogtreecommitdiffstats
path: root/bsps
diff options
context:
space:
mode:
authorChristian Mauderer <christian.mauderer@embedded-brains.de>2018-02-06 16:28:28 +0100
committerChristian Mauderer <christian.mauderer@embedded-brains.de>2018-02-12 14:25:02 +0100
commit6878519aea7a32eb1fa563ac8abbf62c44bfc819 (patch)
treedf1de380a517a0fa3f522a9103467dc9d21c07c2 /bsps
parentbsp/atsam: Allow to use a decoder for SPI CS. (diff)
downloadrtems-6878519aea7a32eb1fa563ac8abbf62c44bfc819.tar.bz2
bsp/atsam: Fix cache / DMA handling in SPI.
This patch fixes the cache handling for the atsam SPI driver. Note that this solution might doesn't have the best performance for small packets.
Diffstat (limited to 'bsps')
-rw-r--r--bsps/arm/atsam/headers.am1
-rw-r--r--bsps/arm/atsam/include/bsp/iocopy.h37
2 files changed, 38 insertions, 0 deletions
diff --git a/bsps/arm/atsam/headers.am b/bsps/arm/atsam/headers.am
index 1ec34a2e69..70473c7ea1 100644
--- a/bsps/arm/atsam/headers.am
+++ b/bsps/arm/atsam/headers.am
@@ -11,6 +11,7 @@ include_bsp_HEADERS += ../../../../../../bsps/arm/atsam/include/bsp/atsam-clock-
include_bsp_HEADERS += ../../../../../../bsps/arm/atsam/include/bsp/atsam-i2c.h
include_bsp_HEADERS += ../../../../../../bsps/arm/atsam/include/bsp/atsam-spi.h
include_bsp_HEADERS += ../../../../../../bsps/arm/atsam/include/bsp/i2c.h
+include_bsp_HEADERS += ../../../../../../bsps/arm/atsam/include/bsp/iocopy.h
include_bsp_HEADERS += ../../../../../../bsps/arm/atsam/include/bsp/irq.h
include_bsp_HEADERS += ../../../../../../bsps/arm/atsam/include/bsp/pin-config.h
include_bsp_HEADERS += ../../../../../../bsps/arm/atsam/include/bsp/power.h
diff --git a/bsps/arm/atsam/include/bsp/iocopy.h b/bsps/arm/atsam/include/bsp/iocopy.h
new file mode 100644
index 0000000000..27e374747e
--- /dev/null
+++ b/bsps/arm/atsam/include/bsp/iocopy.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2018 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Dornierstr. 4
+ * 82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifndef ATSAM_IOCOPY_H
+#define ATSAM_IOCOPY_H
+
+#include <rtems.h>
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/*
+ * Note: This functions are for copying from or to memory that is marked as
+ * Peripheral memory. In this regions a misaligned access is not allowed.
+ * Therefore memcopy would not work in all cases.
+ */
+void atsam_copy_to_io(void *dst, const void *src, size_t n);
+void atsam_copy_from_io(void *dst, const void *src, size_t n);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* ATSAM_IOCOPY_H */