dma-plat.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* linux/arch/arm/plat-s3c64xx/include/plat/dma-plat.h
  2. *
  3. * Copyright 2009 Openmoko, Inc.
  4. * Copyright 2009 Simtec Electronics
  5. * Ben Dooks <ben@simtec.co.uk>
  6. * http://armlinux.simtec.co.uk/
  7. *
  8. * S3C64XX DMA core
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License version 2 as
  12. * published by the Free Software Foundation.
  13. */
  14. #define DMACH_LOW_LEVEL (1<<28) /* use this to specifiy hardware ch no */
  15. struct s3c64xx_dma_buff;
  16. /** s3c64xx_dma_buff - S3C64XX DMA buffer descriptor
  17. * @next: Pointer to next buffer in queue or ring.
  18. * @pw: Client provided identifier
  19. * @lli: Pointer to hardware descriptor this buffer is associated with.
  20. * @lli_dma: Hardare address of the descriptor.
  21. */
  22. struct s3c64xx_dma_buff {
  23. struct s3c64xx_dma_buff *next;
  24. void *pw;
  25. struct pl080s_lli *lli;
  26. dma_addr_t lli_dma;
  27. };
  28. struct s3c64xx_dmac;
  29. struct s3c2410_dma_chan {
  30. unsigned char number; /* number of this dma channel */
  31. unsigned char in_use; /* channel allocated */
  32. unsigned char bit; /* bit for enable/disable/etc */
  33. unsigned char hw_width;
  34. unsigned char peripheral;
  35. unsigned int flags;
  36. enum s3c2410_dmasrc source;
  37. dma_addr_t dev_addr;
  38. struct s3c2410_dma_client *client;
  39. struct s3c64xx_dmac *dmac; /* pointer to controller */
  40. void __iomem *regs;
  41. /* cdriver callbacks */
  42. s3c2410_dma_cbfn_t callback_fn; /* buffer done callback */
  43. s3c2410_dma_opfn_t op_fn; /* channel op callback */
  44. /* buffer list and information */
  45. struct s3c64xx_dma_buff *curr; /* current dma buffer */
  46. struct s3c64xx_dma_buff *next; /* next buffer to load */
  47. struct s3c64xx_dma_buff *end; /* end of queue */
  48. /* note, when channel is running in circular mode, curr is the
  49. * first buffer enqueued, end is the last and curr is where the
  50. * last buffer-done event is set-at. The buffers are not freed
  51. * and the last buffer hardware descriptor points back to the
  52. * first.
  53. */
  54. };
  55. #include <plat/dma-core.h>