edma.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. * TI EDMA definitions
  3. *
  4. * Copyright (C) 2006-2013 Texas Instruments.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License as published by the
  8. * Free Software Foundation; either version 2 of the License, or (at your
  9. * option) any later version.
  10. */
  11. /*
  12. * This EDMA3 programming framework exposes two basic kinds of resource:
  13. *
  14. * Channel Triggers transfers, usually from a hardware event but
  15. * also manually or by "chaining" from DMA completions.
  16. * Each channel is coupled to a Parameter RAM (PaRAM) slot.
  17. *
  18. * Slot Each PaRAM slot holds a DMA transfer descriptor (PaRAM
  19. * "set"), source and destination addresses, a link to a
  20. * next PaRAM slot (if any), options for the transfer, and
  21. * instructions for updating those addresses. There are
  22. * more than twice as many slots as event channels.
  23. *
  24. * Each PaRAM set describes a sequence of transfers, either for one large
  25. * buffer or for several discontiguous smaller buffers. An EDMA transfer
  26. * is driven only from a channel, which performs the transfers specified
  27. * in its PaRAM slot until there are no more transfers. When that last
  28. * transfer completes, the "link" field may be used to reload the channel's
  29. * PaRAM slot with a new transfer descriptor.
  30. *
  31. * The EDMA Channel Controller (CC) maps requests from channels into physical
  32. * Transfer Controller (TC) requests when the channel triggers (by hardware
  33. * or software events, or by chaining). The two physical DMA channels provided
  34. * by the TCs are thus shared by many logical channels.
  35. *
  36. * DaVinci hardware also has a "QDMA" mechanism which is not currently
  37. * supported through this interface. (DSP firmware uses it though.)
  38. */
  39. #ifndef EDMA_H_
  40. #define EDMA_H_
  41. enum dma_event_q {
  42. EVENTQ_0 = 0,
  43. EVENTQ_1 = 1,
  44. EVENTQ_2 = 2,
  45. EVENTQ_3 = 3,
  46. EVENTQ_DEFAULT = -1
  47. };
  48. #define EDMA_CTLR_CHAN(ctlr, chan) (((ctlr) << 16) | (chan))
  49. #define EDMA_CTLR(i) ((i) >> 16)
  50. #define EDMA_CHAN_SLOT(i) ((i) & 0xffff)
  51. #define EDMA_FILTER_PARAM(ctlr, chan) ((int[]) { EDMA_CTLR_CHAN(ctlr, chan) })
  52. struct edma_rsv_info {
  53. const s16 (*rsv_chans)[2];
  54. const s16 (*rsv_slots)[2];
  55. };
  56. struct dma_slave_map;
  57. /* platform_data for EDMA driver */
  58. struct edma_soc_info {
  59. /*
  60. * Default queue is expected to be a low-priority queue.
  61. * This way, long transfers on the default queue started
  62. * by the codec engine will not cause audio defects.
  63. */
  64. enum dma_event_q default_queue;
  65. /* Resource reservation for other cores */
  66. struct edma_rsv_info *rsv;
  67. /* List of channels allocated for memcpy, terminated with -1 */
  68. s32 *memcpy_channels;
  69. s8 (*queue_priority_mapping)[2];
  70. const s16 (*xbar_chans)[2];
  71. const struct dma_slave_map *slave_map;
  72. int slavecnt;
  73. };
  74. #endif