From bf0945b5ff2f59e8dd796e47478662d1e406ad19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Fr=C3=B6schle?= Date: Tue, 30 Jul 2013 19:19:14 +0000 Subject: [PATCH] memcpy() with Coldfire DMA started --- sources/spidma.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sources/spidma.c b/sources/spidma.c index 1f79f6c..f2eed3f 100644 --- a/sources/spidma.c +++ b/sources/spidma.c @@ -7,11 +7,24 @@ #include "spidma.h" #include +#include "mcd_initiators.h" #include "bas_printf.h" extern char _SYS_SRAM[]; #define SYS_SRAM &_SYS_SRAM[0] +void *dma_memcpy(void *dst, void *src, size_t n) +{ + int ret; + + ret = MCD_startDma(0, src, 1, dst, 1, n, 1, DMA_ALWAYS, 0, MCD_SINGLE_DMA, 0); + __asm__ __volatile__("move.w sr,d0\n\t" + "stop #0x270\n\t" + "move.w d0,sr": : :); /* halt CPU until DMA finished */ + + return dst; +} + int spidma_init(void) { int res;