dma.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * linux/include/asm-arm/arch-pxa/dma.h
  3. *
  4. * Author: Nicolas Pitre
  5. * Created: Jun 15, 2001
  6. * Copyright: MontaVista Software, Inc.
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #ifndef __ASM_ARCH_DMA_H
  13. #define __ASM_ARCH_DMA_H
  14. #define MAX_DMA_ADDRESS 0xffffffff
  15. /* No DMA as the rest of the world see it */
  16. #define MAX_DMA_CHANNELS 0
  17. /*
  18. * Descriptor structure for PXA's DMA engine
  19. * Note: this structure must always be aligned to a 16-byte boundary.
  20. */
  21. typedef struct pxa_dma_desc {
  22. volatile u32 ddadr; /* Points to the next descriptor + flags */
  23. volatile u32 dsadr; /* DSADR value for the current transfer */
  24. volatile u32 dtadr; /* DTADR value for the current transfer */
  25. volatile u32 dcmd; /* DCMD value for the current transfer */
  26. } pxa_dma_desc;
  27. #if defined(CONFIG_PXA27x)
  28. #define PXA_DMA_CHANNELS 32
  29. #define PXA_DMA_NBCH(prio) ((prio == DMA_PRIO_LOW) ? 16 : 8)
  30. typedef enum {
  31. DMA_PRIO_HIGH = 0,
  32. DMA_PRIO_MEDIUM = 8,
  33. DMA_PRIO_LOW = 16
  34. } pxa_dma_prio;
  35. #elif defined(CONFIG_PXA25x)
  36. #define PXA_DMA_CHANNELS 16
  37. #define PXA_DMA_NBCH(prio) ((prio == DMA_PRIO_LOW) ? 8 : 4)
  38. typedef enum {
  39. DMA_PRIO_HIGH = 0,
  40. DMA_PRIO_MEDIUM = 4,
  41. DMA_PRIO_LOW = 8
  42. } pxa_dma_prio;
  43. #endif
  44. /*
  45. * DMA registration
  46. */
  47. int pxa_request_dma (char *name,
  48. pxa_dma_prio prio,
  49. void (*irq_handler)(int, void *, struct pt_regs *),
  50. void *data);
  51. void pxa_free_dma (int dma_ch);
  52. #endif /* _ASM_ARCH_DMA_H */