acp.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. #ifndef __ACP_HW_H
  2. #define __ACP_HW_H
  3. #include "include/acp_2_2_d.h"
  4. #include "include/acp_2_2_sh_mask.h"
  5. #define ACP_PAGE_SIZE_4K_ENABLE 0x02
  6. #define ACP_PLAYBACK_PTE_OFFSET 10
  7. #define ACP_CAPTURE_PTE_OFFSET 0
  8. #define ACP_GARLIC_CNTL_DEFAULT 0x00000FB4
  9. #define ACP_ONION_CNTL_DEFAULT 0x00000FB4
  10. #define ACP_PHYSICAL_BASE 0x14000
  11. /* Playback SRAM address (as a destination in dma descriptor) */
  12. #define ACP_SHARED_RAM_BANK_1_ADDRESS 0x4002000
  13. /* Capture SRAM address (as a source in dma descriptor) */
  14. #define ACP_SHARED_RAM_BANK_5_ADDRESS 0x400A000
  15. #define ACP_DMA_RESET_TIME 10000
  16. #define ACP_CLOCK_EN_TIME_OUT_VALUE 0x000000FF
  17. #define ACP_SOFT_RESET_DONE_TIME_OUT_VALUE 0x000000FF
  18. #define ACP_DMA_COMPLETE_TIME_OUT_VALUE 0x000000FF
  19. #define ACP_SRAM_BASE_ADDRESS 0x4000000
  20. #define ACP_DAGB_GRP_SRAM_BASE_ADDRESS 0x4001000
  21. #define ACP_DAGB_GRP_SRBM_SRAM_BASE_OFFSET 0x1000
  22. #define ACP_INTERNAL_APERTURE_WINDOW_0_ADDRESS 0x00000000
  23. #define ACP_INTERNAL_APERTURE_WINDOW_4_ADDRESS 0x01800000
  24. #define TO_ACP_I2S_1 0x2
  25. #define TO_ACP_I2S_2 0x4
  26. #define FROM_ACP_I2S_1 0xa
  27. #define FROM_ACP_I2S_2 0xb
  28. #define ACP_TILE_ON_MASK 0x03
  29. #define ACP_TILE_OFF_MASK 0x02
  30. #define ACP_TILE_ON_RETAIN_REG_MASK 0x1f
  31. #define ACP_TILE_OFF_RETAIN_REG_MASK 0x20
  32. #define ACP_TILE_P1_MASK 0x3e
  33. #define ACP_TILE_P2_MASK 0x3d
  34. #define ACP_TILE_DSP0_MASK 0x3b
  35. #define ACP_TILE_DSP1_MASK 0x37
  36. #define ACP_TILE_DSP2_MASK 0x2f
  37. /* Playback DMA channels */
  38. #define SYSRAM_TO_ACP_CH_NUM 12
  39. #define ACP_TO_I2S_DMA_CH_NUM 13
  40. /* Capture DMA channels */
  41. #define ACP_TO_SYSRAM_CH_NUM 14
  42. #define I2S_TO_ACP_DMA_CH_NUM 15
  43. #define NUM_DSCRS_PER_CHANNEL 2
  44. #define PLAYBACK_START_DMA_DESCR_CH12 0
  45. #define PLAYBACK_END_DMA_DESCR_CH12 1
  46. #define PLAYBACK_START_DMA_DESCR_CH13 2
  47. #define PLAYBACK_END_DMA_DESCR_CH13 3
  48. #define CAPTURE_START_DMA_DESCR_CH14 4
  49. #define CAPTURE_END_DMA_DESCR_CH14 5
  50. #define CAPTURE_START_DMA_DESCR_CH15 6
  51. #define CAPTURE_END_DMA_DESCR_CH15 7
  52. enum acp_dma_priority_level {
  53. /* 0x0 Specifies the DMA channel is given normal priority */
  54. ACP_DMA_PRIORITY_LEVEL_NORMAL = 0x0,
  55. /* 0x1 Specifies the DMA channel is given high priority */
  56. ACP_DMA_PRIORITY_LEVEL_HIGH = 0x1,
  57. ACP_DMA_PRIORITY_LEVEL_FORCESIZE = 0xFF
  58. };
  59. struct audio_substream_data {
  60. struct page *pg;
  61. unsigned int order;
  62. u16 num_of_pages;
  63. u16 direction;
  64. uint64_t size;
  65. void __iomem *acp_mmio;
  66. };
  67. enum {
  68. ACP_TILE_P1 = 0,
  69. ACP_TILE_P2,
  70. ACP_TILE_DSP0,
  71. ACP_TILE_DSP1,
  72. ACP_TILE_DSP2,
  73. };
  74. enum {
  75. ACP_DMA_ATTRIBUTES_SHAREDMEM_TO_DAGB_ONION = 0x0,
  76. ACP_DMA_ATTRIBUTES_SHARED_MEM_TO_DAGB_GARLIC = 0x1,
  77. ACP_DMA_ATTRIBUTES_DAGB_ONION_TO_SHAREDMEM = 0x8,
  78. ACP_DMA_ATTRIBUTES_DAGB_GARLIC_TO_SHAREDMEM = 0x9,
  79. ACP_DMA_ATTRIBUTES_FORCE_SIZE = 0xF
  80. };
  81. typedef struct acp_dma_dscr_transfer {
  82. /* Specifies the source memory location for the DMA data transfer. */
  83. u32 src;
  84. /* Specifies the destination memory location to where the data will
  85. * be transferred.
  86. */
  87. u32 dest;
  88. /* Specifies the number of bytes need to be transferred
  89. * from source to destination memory.Transfer direction & IOC enable
  90. */
  91. u32 xfer_val;
  92. /* Reserved for future use */
  93. u32 reserved;
  94. } acp_dma_dscr_transfer_t;
  95. #endif /*__ACP_HW_H */