dma.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. /*
  15. * Descriptor structure for PXA's DMA engine
  16. * Note: this structure must always be aligned to a 16-byte boundary.
  17. */
  18. typedef struct pxa_dma_desc {
  19. volatile u32 ddadr; /* Points to the next descriptor + flags */
  20. volatile u32 dsadr; /* DSADR value for the current transfer */
  21. volatile u32 dtadr; /* DTADR value for the current transfer */
  22. volatile u32 dcmd; /* DCMD value for the current transfer */
  23. } pxa_dma_desc;
  24. #if defined(CONFIG_PXA27x)
  25. #define PXA_DMA_CHANNELS 32
  26. #define PXA_DMA_NBCH(prio) ((prio == DMA_PRIO_LOW) ? 16 : 8)
  27. typedef enum {
  28. DMA_PRIO_HIGH = 0,
  29. DMA_PRIO_MEDIUM = 8,
  30. DMA_PRIO_LOW = 16
  31. } pxa_dma_prio;
  32. #elif defined(CONFIG_PXA25x)
  33. #define PXA_DMA_CHANNELS 16
  34. #define PXA_DMA_NBCH(prio) ((prio == DMA_PRIO_LOW) ? 8 : 4)
  35. typedef enum {
  36. DMA_PRIO_HIGH = 0,
  37. DMA_PRIO_MEDIUM = 4,
  38. DMA_PRIO_LOW = 8
  39. } pxa_dma_prio;
  40. #endif
  41. /*
  42. * DMA registration
  43. */
  44. int pxa_request_dma (char *name,
  45. pxa_dma_prio prio,
  46. void (*irq_handler)(int, void *, struct pt_regs *),
  47. void *data);
  48. void pxa_free_dma (int dma_ch);
  49. #endif /* _ASM_ARCH_DMA_H */