0393-dmaengine-bcm2835-add-additional-defines-for-DMA-reg.patch 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. From 2fe3ede60d3b88bb94ee1a100b5e771567db0962 Mon Sep 17 00:00:00 2001
  2. From: Martin Sperl <kernel@martin.sperl.org>
  3. Date: Wed, 16 Mar 2016 12:24:57 -0700
  4. Subject: [PATCH] dmaengine: bcm2835: add additional defines for DMA-registers
  5. Add additional defines describing the DMA registers
  6. as well as adding some more documentation to those registers.
  7. Signed-off-by: Martin Sperl <kernel@martin.sperl.org>
  8. Reviewed-by: Eric Anholt <eric@anholt.net>
  9. Signed-off-by: Eric Anholt <eric@anholt.net>
  10. Signed-off-by: Vinod Koul <vinod.koul@intel.com>
  11. ---
  12. drivers/dma/bcm2835-dma.c | 57 ++++++++++++++++++++++++++++++++++++++++-------
  13. 1 file changed, 49 insertions(+), 8 deletions(-)
  14. --- a/drivers/dma/bcm2835-dma.c
  15. +++ b/drivers/dma/bcm2835-dma.c
  16. @@ -97,26 +97,67 @@ struct bcm2835_desc {
  17. #define BCM2835_DMA_CS 0x00
  18. #define BCM2835_DMA_ADDR 0x04
  19. +#define BCM2835_DMA_TI 0x08
  20. #define BCM2835_DMA_SOURCE_AD 0x0c
  21. #define BCM2835_DMA_DEST_AD 0x10
  22. -#define BCM2835_DMA_NEXTCB 0x1C
  23. +#define BCM2835_DMA_LEN 0x14
  24. +#define BCM2835_DMA_STRIDE 0x18
  25. +#define BCM2835_DMA_NEXTCB 0x1c
  26. +#define BCM2835_DMA_DEBUG 0x20
  27. /* DMA CS Control and Status bits */
  28. -#define BCM2835_DMA_ACTIVE BIT(0)
  29. -#define BCM2835_DMA_INT BIT(2)
  30. +#define BCM2835_DMA_ACTIVE BIT(0) /* activate the DMA */
  31. +#define BCM2835_DMA_END BIT(1) /* current CB has ended */
  32. +#define BCM2835_DMA_INT BIT(2) /* interrupt status */
  33. +#define BCM2835_DMA_DREQ BIT(3) /* DREQ state */
  34. #define BCM2835_DMA_ISPAUSED BIT(4) /* Pause requested or not active */
  35. #define BCM2835_DMA_ISHELD BIT(5) /* Is held by DREQ flow control */
  36. -#define BCM2835_DMA_ERR BIT(8)
  37. +#define BCM2835_DMA_WAITING_FOR_WRITES BIT(6) /* waiting for last
  38. + * AXI-write to ack
  39. + */
  40. +#define BCM2835_DMA_ERR BIT(8)
  41. +#define BCM2835_DMA_PRIORITY(x) ((x & 15) << 16) /* AXI priority */
  42. +#define BCM2835_DMA_PANIC_PRIORITY(x) ((x & 15) << 20) /* panic priority */
  43. +/* current value of TI.BCM2835_DMA_WAIT_RESP */
  44. +#define BCM2835_DMA_WAIT_FOR_WRITES BIT(28)
  45. +#define BCM2835_DMA_DIS_DEBUG BIT(29) /* disable debug pause signal */
  46. #define BCM2835_DMA_ABORT BIT(30) /* Stop current CB, go to next, WO */
  47. #define BCM2835_DMA_RESET BIT(31) /* WO, self clearing */
  48. +/* Transfer information bits - also bcm2835_cb.info field */
  49. #define BCM2835_DMA_INT_EN BIT(0)
  50. +#define BCM2835_DMA_TDMODE BIT(1) /* 2D-Mode */
  51. +#define BCM2835_DMA_WAIT_RESP BIT(3) /* wait for AXI-write to be acked */
  52. #define BCM2835_DMA_D_INC BIT(4)
  53. -#define BCM2835_DMA_D_DREQ BIT(6)
  54. +#define BCM2835_DMA_D_WIDTH BIT(5) /* 128bit writes if set */
  55. +#define BCM2835_DMA_D_DREQ BIT(6) /* enable DREQ for destination */
  56. +#define BCM2835_DMA_D_IGNORE BIT(7) /* ignore destination writes */
  57. #define BCM2835_DMA_S_INC BIT(8)
  58. -#define BCM2835_DMA_S_DREQ BIT(10)
  59. +#define BCM2835_DMA_S_WIDTH BIT(9) /* 128bit writes if set */
  60. +#define BCM2835_DMA_S_DREQ BIT(10) /* enable SREQ for source */
  61. +#define BCM2835_DMA_S_IGNORE BIT(11) /* ignore source reads - read 0 */
  62. +#define BCM2835_DMA_BURST_LENGTH(x) ((x & 15) << 12)
  63. +#define BCM2835_DMA_PER_MAP(x) ((x & 31) << 16) /* REQ source */
  64. +#define BCM2835_DMA_WAIT(x) ((x & 31) << 21) /* add DMA-wait cycles */
  65. +#define BCM2835_DMA_NO_WIDE_BURSTS BIT(26) /* no 2 beat write bursts */
  66. -#define BCM2835_DMA_PER_MAP(x) ((x) << 16)
  67. +/* debug register bits */
  68. +#define BCM2835_DMA_DEBUG_LAST_NOT_SET_ERR BIT(0)
  69. +#define BCM2835_DMA_DEBUG_FIFO_ERR BIT(1)
  70. +#define BCM2835_DMA_DEBUG_READ_ERR BIT(2)
  71. +#define BCM2835_DMA_DEBUG_OUTSTANDING_WRITES_SHIFT 4
  72. +#define BCM2835_DMA_DEBUG_OUTSTANDING_WRITES_BITS 4
  73. +#define BCM2835_DMA_DEBUG_ID_SHIFT 16
  74. +#define BCM2835_DMA_DEBUG_ID_BITS 9
  75. +#define BCM2835_DMA_DEBUG_STATE_SHIFT 16
  76. +#define BCM2835_DMA_DEBUG_STATE_BITS 9
  77. +#define BCM2835_DMA_DEBUG_VERSION_SHIFT 25
  78. +#define BCM2835_DMA_DEBUG_VERSION_BITS 3
  79. +#define BCM2835_DMA_DEBUG_LITE BIT(28)
  80. +
  81. +/* shared registers for all dma channels */
  82. +#define BCM2835_DMA_INT_STATUS 0xfe0
  83. +#define BCM2835_DMA_ENABLE 0xff0
  84. #define BCM2835_DMA_DATA_TYPE_S8 1
  85. #define BCM2835_DMA_DATA_TYPE_S16 2