dmaengine.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * Header for the new SH dmaengine driver
  3. *
  4. * Copyright (C) 2010 Guennadi Liakhovetski <g.liakhovetski@gmx.de>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef ASM_DMAENGINE_H
  11. #define ASM_DMAENGINE_H
  12. #include <asm/dma-register.h>
  13. #define SH_DMAC_MAX_CHANNELS 6
  14. enum sh_dmae_slave_chan_id {
  15. SHDMA_SLAVE_SCIF0_TX,
  16. SHDMA_SLAVE_SCIF0_RX,
  17. SHDMA_SLAVE_SCIF1_TX,
  18. SHDMA_SLAVE_SCIF1_RX,
  19. SHDMA_SLAVE_SCIF2_TX,
  20. SHDMA_SLAVE_SCIF2_RX,
  21. SHDMA_SLAVE_SCIF3_TX,
  22. SHDMA_SLAVE_SCIF3_RX,
  23. SHDMA_SLAVE_SCIF4_TX,
  24. SHDMA_SLAVE_SCIF4_RX,
  25. SHDMA_SLAVE_SCIF5_TX,
  26. SHDMA_SLAVE_SCIF5_RX,
  27. SHDMA_SLAVE_SIUA_TX,
  28. SHDMA_SLAVE_SIUA_RX,
  29. SHDMA_SLAVE_SIUB_TX,
  30. SHDMA_SLAVE_SIUB_RX,
  31. SHDMA_SLAVE_NUMBER, /* Must stay last */
  32. };
  33. struct sh_dmae_slave_config {
  34. enum sh_dmae_slave_chan_id slave_id;
  35. dma_addr_t addr;
  36. u32 chcr;
  37. char mid_rid;
  38. };
  39. struct sh_dmae_channel {
  40. unsigned int offset;
  41. unsigned int dmars;
  42. unsigned int dmars_bit;
  43. };
  44. struct sh_dmae_pdata {
  45. struct sh_dmae_slave_config *slave;
  46. int slave_num;
  47. struct sh_dmae_channel *channel;
  48. int channel_num;
  49. unsigned int ts_low_shift;
  50. unsigned int ts_low_mask;
  51. unsigned int ts_high_shift;
  52. unsigned int ts_high_mask;
  53. unsigned int *ts_shift;
  54. int ts_shift_num;
  55. u16 dmaor_init;
  56. };
  57. struct device;
  58. /* Used by slave DMA clients to request DMA to/from a specific peripheral */
  59. struct sh_dmae_slave {
  60. enum sh_dmae_slave_chan_id slave_id; /* Set by the platform */
  61. struct device *dma_dev; /* Set by the platform */
  62. struct sh_dmae_slave_config *config; /* Set by the driver */
  63. };
  64. #endif