edma.h 2.5 KB

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