/arch/arm/mach-fsm/include/mach/qdsp5v2/lpa_hw.h

https://bitbucket.org/sammyz/iscream_thunderc-2.6.35-rebase · C++ Header · 252 lines · 175 code · 27 blank · 50 comment · 0 complexity · ae6c9177f46e28cace2a9610e8d2158e MD5 · raw file

  1. /* Copyright (c) 2009, Code Aurora Forum. All rights reserved.
  2. *
  3. * Redistribution and use in source and binary forms, with or without
  4. * modification, are permitted provided that the following conditions are
  5. * met:
  6. * * Redistributions of source code must retain the above copyright
  7. * notice, this list of conditions and the following disclaimer.
  8. * * Redistributions in binary form must reproduce the above
  9. * copyright notice, this list of conditions and the following
  10. * disclaimer in the documentation and/or other materials provided
  11. * with the distribution.
  12. * * Neither the name of Code Aurora Forum, Inc. nor the names of its
  13. * contributors may be used to endorse or promote products derived
  14. * from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
  17. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  18. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
  19. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
  20. * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  21. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  22. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
  23. * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  24. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
  25. * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
  26. * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. *
  28. */
  29. #ifndef __MACH_QDSP5_V2_LPA_HW_H__
  30. #define __MACH_QDSP5_V2_LPA_HW_H__
  31. #define LPA_MAX_BUF_SIZE 0x30000
  32. /* LPA Output config registers */
  33. enum {
  34. LPA_OBUF_CONTROL = 0x00000000,
  35. LPA_OBUF_CODEC = 0x00000004,
  36. LPA_OBUF_HLB_MIN_ADDR = 0x00000008,
  37. LPA_OBUF_HLB_MAX_ADDR = 0x0000000C,
  38. LPA_OBUF_HLB_WPTR = 0x00000010,
  39. LPA_OBUF_HLB_VOLUME_CONTROL = 0x00000014,
  40. LPA_OBUF_LLB_MIN_ADDR = 0x00000018,
  41. LPA_OBUF_LLB_MAX_ADDR = 0x0000001C,
  42. LPA_OBUF_SB_MIN_ADDR = 0x00000020,
  43. LPA_OBUF_SB_MAX_ADDR = 0x00000024,
  44. LPA_OBUF_INTR_ENABLE = 0x00000028,
  45. LPA_OBUF_INTR_STATUS = 0x0000002C,
  46. LPA_OBUF_WMARK_ASSIGN = 0x00000030,
  47. LPA_OBUF_WMARK_0_LLB = 0x00000034,
  48. LPA_OBUF_WMARK_1_LLB = 0x00000038,
  49. LPA_OBUF_WMARK_2_LLB = 0x0000003C,
  50. LPA_OBUF_WMARK_3_LLB = 0x00000040,
  51. LPA_OBUF_WMARK_HLB = 0x00000044,
  52. LPA_OBUF_WMARK_SB = 0x00000048,
  53. LPA_OBUF_RDPTR_LLB = 0x0000004C,
  54. LPA_OBUF_RDPTR_HLB = 0x00000050,
  55. LPA_OBUF_WRPTR_SB = 0x00000054,
  56. LPA_OBUF_UTC_CONFIG = 0x00000058,
  57. LPA_OBUF_UTC_INTR_LOW = 0x0000005C,
  58. LPA_OBUF_UTC_INTR_HIGH = 0x00000060,
  59. LPA_OBUF_UTC_LOW = 0x00000064,
  60. LPA_OBUF_UTC_HIGH = 0x00000068,
  61. LPA_OBUF_MISR = 0x0000006C,
  62. LPA_OBUF_STATUS = 0x00000070,
  63. LPA_OBUF_ACK = 0x00000074,
  64. LPA_OBUF_MEMORY_CONTROL = 0x00000078,
  65. LPA_OBUF_MEMORY_STATUS = 0x0000007C,
  66. LPA_OBUF_MEMORY_TIME_CONTROL = 0x00000080,
  67. LPA_OBUF_ACC_LV = 0x00000084,
  68. LPA_OBUF_ACC_HV = 0x0000008c,
  69. LPA_OBUF_RESETS = 0x00000090,
  70. LPA_OBUF_TESTBUS = 0x00000094,
  71. };
  72. /* OBUF_CODEC definition */
  73. #define LPA_OBUF_CODEC_RESERVED31_22_BMSK 0xffc00000
  74. #define LPA_OBUF_CODEC_RESERVED31_22_SHFT 0x16
  75. #define LPA_OBUF_CODEC_LOAD_BMSK 0x200000
  76. #define LPA_OBUF_CODEC_LOAD_SHFT 0x15
  77. #define LPA_OBUF_CODEC_CODEC_INTF_EN_BMSK 0x100000
  78. #define LPA_OBUF_CODEC_CODEC_INTF_EN_SHFT 0x14
  79. #define LPA_OBUF_CODEC_SAMP_BMSK 0xf0000
  80. #define LPA_OBUF_CODEC_SAMP_SHFT 0x10
  81. #define LPA_OBUF_CODEC_BITS_PER_CHAN_BMSK 0xc000
  82. #define LPA_OBUF_CODEC_BITS_PER_CHAN_SHFT 0xe
  83. #define LPA_OBUF_CODEC_RESERVED_13_7_BMSK 0x3f80
  84. #define LPA_OBUF_CODEC_RESERVED_13_7_SHFT 0x7
  85. #define LPA_OBUF_CODEC_INTF_BMSK 0x70
  86. #define LPA_OBUF_CODEC_INTF_SHFT 0x4
  87. #define LPA_OBUF_CODEC_NUM_CHAN_BMSK 0xf
  88. #define LPA_OBUF_CODEC_NUM_CHAN_SHFT 0
  89. /* OBUF_CONTROL definition */
  90. #define LPA_OBUF_CONTROL_RESERVED31_9_BMSK 0xfffffe00
  91. #define LPA_OBUF_CONTROL_RESERVED31_9_SHFT 0x9
  92. #define LPA_OBUF_CONTROL_TEST_EN_BMSK 0x100
  93. #define LPA_OBUF_CONTROL_TEST_EN_SHFT 0x8
  94. #define LPA_OBUF_CONTROL_LLB_CLR_CMD_BMSK 0x80
  95. #define LPA_OBUF_CONTROL_LLB_CLR_CMD_SHFT 0x7
  96. #define LPA_OBUF_CONTROL_SB_SAT_EN_BMSK 0x40
  97. #define LPA_OBUF_CONTROL_SB_SAT_EN_SHFT 0x6
  98. #define LPA_OBUF_CONTROL_LLB_SAT_EN_BMSK 0x20
  99. #define LPA_OBUF_CONTROL_LLB_SAT_EN_SHFT 0x5
  100. #define LPA_OBUF_CONTROL_RESERVED4_BMSK 0x10
  101. #define LPA_OBUF_CONTROL_RESERVED4_SHFT 0x4
  102. #define LPA_OBUF_CONTROL_LLB_ACC_EN_BMSK 0x8
  103. #define LPA_OBUF_CONTROL_LLB_ACC_EN_SHFT 0x3
  104. #define LPA_OBUF_CONTROL_HLB_EN_BMSK 0x4
  105. #define LPA_OBUF_CONTROL_HLB_EN_SHFT 0x2
  106. #define LPA_OBUF_CONTROL_LLB_EN_BMSK 0x2
  107. #define LPA_OBUF_CONTROL_LLB_EN_SHFT 0x1
  108. #define LPA_OBUF_CONTROL_SB_EN_BMSK 0x1
  109. #define LPA_OBUF_CONTROL_SB_EN_SHFT 0
  110. /* OBUF_RESET definition */
  111. #define LPA_OBUF_RESETS_MISR_RESET 0x1
  112. #define LPA_OBUF_RESETS_OVERALL_RESET 0x2
  113. /* OBUF_STATUS definition */
  114. #define LPA_OBUF_STATUS_RESET_DONE 0x80000
  115. #define LPA_OBUF_STATUS_LLB_CLR_BMSK 0x40000
  116. #define LPA_OBUF_STATUS_LLB_CLR_SHFT 0x12
  117. /* OBUF_HLB_MIN_ADDR definition */
  118. #define LPA_OBUF_HLB_MIN_ADDR_LOAD_BMSK 0x40000
  119. #define LPA_OBUF_HLB_MIN_ADDR_SEG_BMSK 0x3e000
  120. /* OBUF_HLB_MAX_ADDR definition */
  121. #define LPA_OBUF_HLB_MAX_ADDR_SEG_BMSK 0x3fff8
  122. /* OBUF_LLB_MIN_ADDR definition */
  123. #define LPA_OBUF_LLB_MIN_ADDR_LOAD_BMSK 0x40000
  124. #define LPA_OBUF_LLB_MIN_ADDR_SEG_BMSK 0x3e000
  125. /* OBUF_LLB_MAX_ADDR definition */
  126. #define LPA_OBUF_LLB_MAX_ADDR_SEG_BMSK 0x3ff8
  127. #define LPA_OBUF_LLB_MAX_ADDR_SEG_SHFT 0x3
  128. /* OBUF_SB_MIN_ADDR definition */
  129. #define LPA_OBUF_SB_MIN_ADDR_LOAD_BMSK 0x4000
  130. #define LPA_OBUF_SB_MIN_ADDR_SEG_BMSK 0x3e00
  131. /* OBUF_SB_MAX_ADDR definition */
  132. #define LPA_OBUF_SB_MAX_ADDR_SEG_BMSK 0x3ff8
  133. /* OBUF_MEMORY_CONTROL definition */
  134. #define LPA_OBUF_MEM_CTL_PWRUP_BMSK 0xfff
  135. #define LPA_OBUF_MEM_CTL_PWRUP_SHFT 0x0
  136. /* OBUF_INTR_ENABLE definition */
  137. #define LPA_OBUF_INTR_EN_BMSK 0x3
  138. /* OBUF_WMARK_ASSIGN definition */
  139. #define LPA_OBUF_WMARK_ASSIGN_BMSK 0xF
  140. #define LPA_OBUF_WMARK_ASSIGN_DONE 0xF
  141. /* OBUF_WMARK_n_LLB definition */
  142. #define LPA_OBUF_WMARK_n_LLB_ADDR(n) (0x00000034 + 0x4 * (n))
  143. #define LPA_OBUF_LLB_WMARK_CTRL_BMSK 0xc0000
  144. #define LPA_OBUF_LLB_WMARK_CTRL_SHFT 0x12
  145. #define LPA_OBUF_LLB_WMARK_MAP_BMSK 0xf00000
  146. #define LPA_OBUF_LLB_WMARK_MAP_SHFT 0x14
  147. /* OBUF_WMARK_SB definition */
  148. #define LPA_OBUF_SB_WMARK_CTRL_BMSK 0xc0000
  149. #define LPA_OBUF_SB_WMARK_CTRL_SHFT 0x12
  150. #define LPA_OBUF_SB_WMARK_MAP_BMSK 0xf00000
  151. #define LPA_OBUF_SB_WMARK_MAP_SHFT 0x14
  152. /* OBUF_WMARK_HLB definition */
  153. #define LPA_OBUF_HLB_WMARK_CTRL_BMSK 0xc0000
  154. #define LPA_OBUF_HLB_WMARK_CTRL_SHFT 0x12
  155. #define LPA_OBUF_HLB_WMARK_MAP_BMSK 0xf00000
  156. #define LPA_OBUF_HLB_WMARK_MAP_SHFT 0x14
  157. /* OBUF_UTC_CONFIG definition */
  158. #define LPA_OBUF_UTC_CONFIG_MAP_BMSK 0xf0
  159. #define LPA_OBUF_UTC_CONFIG_MAP_SHFT 0x4
  160. #define LPA_OBUF_UTC_CONFIG_EN_BMSK 0x1
  161. #define LPA_OBUF_UTC_CONFIG_EN_SHFT 0
  162. #define LPA_OBUF_UTC_CONFIG_NO_INTR 0xF
  163. /* OBUF_ACK definition */
  164. #define LPA_OBUF_ACK_RESET_DONE_BMSK 0x80000
  165. #define LPA_OBUF_ACK_RESET_DONE_SHFT 0x13
  166. enum {
  167. LPA_SAMPLE_RATE_8KHZ = 0x0000,
  168. LPA_SAMPLE_RATE_11P025KHZ = 0x0001,
  169. LPA_SAMPLE_RATE_16KHZ = 0x0002,
  170. LPA_SAMPLE_RATE_22P05KHZ = 0x0003,
  171. LPA_SAMPLE_RATE_32KHZ = 0x0004,
  172. LPA_SAMPLE_RATE_44P1KHZ = 0x0005,
  173. LPA_SAMPLE_RATE_48KHZ = 0x0006,
  174. LPA_SAMPLE_RATE_64KHZ = 0x0007,
  175. LPA_SAMPLE_RATE_96KHZ = 0x0008,
  176. };
  177. enum {
  178. LPA_BITS_PER_CHAN_16BITS = 0x0000,
  179. LPA_BITS_PER_CHAN_24BITS = 0x0001,
  180. LPA_BITS_PER_CHAN_32BITS = 0x0002,
  181. LPA_BITS_PER_CHAN_RESERVED = 0x0003,
  182. };
  183. enum {
  184. LPA_INTF_WB_CODEC = 0x0000,
  185. LPA_INTF_SDAC = 0x0001,
  186. LPA_INTF_MI2S = 0x0002,
  187. LPA_INTF_RESERVED = 0x0003,
  188. };
  189. enum {
  190. LPA_BUF_ID_HLB, /* HLB buffer */
  191. LPA_BUF_ID_LLB, /* LLB buffer */
  192. LPA_BUF_ID_SB, /* SB buffer */
  193. LPA_BUF_ID_UTC,
  194. };
  195. /* WB_CODEC & SDAC can only support 16bit mono/stereo.
  196. * MI2S can bit format and number of channel
  197. */
  198. enum {
  199. LPA_NUM_CHAN_MONO = 0x0000,
  200. LPA_NUM_CHAN_STEREO = 0x0001,
  201. LPA_NUM_CHAN_5P1 = 0x0002,
  202. LPA_NUM_CHAN_7P1 = 0x0003,
  203. LPA_NUM_CHAN_4_CHANNEL = 0x0004,
  204. };
  205. enum {
  206. LPA_WMARK_CTL_DISABLED = 0x0,
  207. LPA_WMARK_CTL_NON_BLOCK = 0x1,
  208. LPA_WMARK_CTL_ZERO_INSERT = 0x2,
  209. LPA_WMARK_CTL_RESERVED = 0x3
  210. };
  211. struct lpa_mem_bank_select {
  212. u32 b0:1; /*RAM bank 0 16KB=2Kx64(0) */
  213. u32 b1:1; /*RAM bank 1 16KB=2Kx64(0) */
  214. u32 b2:1; /*RAM bank 2 16KB=2Kx64(0) */
  215. u32 b3:1; /*RAM bank 3 16KB=2Kx64(0) */
  216. u32 b4:1; /*RAM bank 4 16KB=2Kx64(1) */
  217. u32 b5:1; /*RAM bank 5 16KB=2Kx64(1) */
  218. u32 b6:1; /*RAM bank 6 16KB=2Kx64(1) */
  219. u32 b7:1; /*RAM bank 7 16KB=2Kx64(1) */
  220. u32 b8:1; /*RAM bank 8 16KB=4Kx32(0) */
  221. u32 b9:1; /*RAM bank 9 16KB=4Kx32(1) */
  222. u32 b10:1; /*RAM bank 10 16KB=4Kx32(2) */
  223. u32 llb:1; /*RAM bank 11 16KB=4Kx32(3) */
  224. };
  225. #endif