• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/arch/cris/arch-v10/lib/
1/*
2 * memcpy for large blocks, using memory-memory DMA channels 6 and 7 in Etrax
3 */
4
5#include <asm/svinto.h>
6#include <asm/io.h>
7
8#define D(x)
9
10void *dma_memcpy(void *pdst,
11		 const void *psrc,
12		 unsigned int pn)
13{
14	static etrax_dma_descr indma, outdma;
15
16	D(printk(KERN_DEBUG "dma_memcpy %d bytes... ", pn));
17
18	indma.sw_len = outdma.sw_len = pn;
19	indma.ctrl = d_eol | d_eop;
20	outdma.ctrl = d_eol;
21	indma.buf = psrc;
22	outdma.buf = pdst;
23
24	*R_DMA_CH6_FIRST = &indma;
25	*R_DMA_CH7_FIRST = &outdma;
26	*R_DMA_CH6_CMD = IO_STATE(R_DMA_CH6_CMD, cmd, start);
27	*R_DMA_CH7_CMD = IO_STATE(R_DMA_CH7_CMD, cmd, start);
28
29	while (*R_DMA_CH7_CMD == 1)
30		/* wait for completion */;
31
32	D(printk(KERN_DEBUG "done\n"));
33}
34