dmacopy.c 871 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * memcpy for large blocks, using memory-memory DMA channels 6 and 7 in Etrax
  3. */
  4. #include <asm/svinto.h>
  5. #include <asm/io.h>
  6. #define D(x)
  7. void *dma_memcpy(void *pdst,
  8. const void *psrc,
  9. unsigned int pn)
  10. {
  11. static etrax_dma_descr indma, outdma;
  12. D(printk(KERN_DEBUG "dma_memcpy %d bytes... ", pn));
  13. #if 0
  14. *R_GEN_CONFIG = genconfig_shadow =
  15. (genconfig_shadow & ~0x3c0000) |
  16. IO_STATE(R_GEN_CONFIG, dma6, intdma7) |
  17. IO_STATE(R_GEN_CONFIG, dma7, intdma6);
  18. #endif
  19. indma.sw_len = outdma.sw_len = pn;
  20. indma.ctrl = d_eol | d_eop;
  21. outdma.ctrl = d_eol;
  22. indma.buf = psrc;
  23. outdma.buf = pdst;
  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. while (*R_DMA_CH7_CMD == 1)
  29. /* wait for completion */;
  30. D(printk(KERN_DEBUG "done\n"));
  31. }