cx25821-sram.h 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. /*
  2. * Driver for the Conexant CX25821 PCIe bridge
  3. *
  4. * Copyright (C) 2009 Conexant Systems Inc.
  5. * Authors <shu.lin@conexant.com>, <hiep.huynh@conexant.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. *
  16. * GNU General Public License for more details.
  17. */
  18. #ifndef __ATHENA_SRAM_H__
  19. #define __ATHENA_SRAM_H__
  20. /* #define RX_SRAM_START_SIZE = 0; // Start of reserved SRAM */
  21. #define VID_CMDS_SIZE 80 /* Video CMDS size in bytes */
  22. #define AUDIO_CMDS_SIZE 80 /* AUDIO CMDS size in bytes */
  23. #define MBIF_CMDS_SIZE 80 /* MBIF CMDS size in bytes */
  24. /* #define RX_SRAM_POOL_START_SIZE = 0; // Start of useable RX SRAM for buffers */
  25. #define VID_IQ_SIZE 64 /* VID instruction queue size in bytes */
  26. #define MBIF_IQ_SIZE 64
  27. #define AUDIO_IQ_SIZE 64 /* AUD instruction queue size in bytes */
  28. #define VID_CDT_SIZE 64 /* VID cluster descriptor table size in bytes */
  29. #define MBIF_CDT_SIZE 64 /* MBIF/HBI cluster descriptor table size in bytes */
  30. #define AUDIO_CDT_SIZE 48 /* AUD cluster descriptor table size in bytes */
  31. /* #define RX_SRAM_POOL_FREE_SIZE = 16; // Start of available RX SRAM */
  32. /* #define RX_SRAM_END_SIZE = 0; // End of RX SRAM */
  33. /* #define TX_SRAM_POOL_START_SIZE = 0; // Start of transmit pool SRAM */
  34. /* #define MSI_DATA_SIZE = 64; // Reserved (MSI Data, RISC working stora */
  35. #define VID_CLUSTER_SIZE 1440 /* VID cluster data line */
  36. #define AUDIO_CLUSTER_SIZE 128 /* AUDIO cluster data line */
  37. #define MBIF_CLUSTER_SIZE 1440 /* MBIF/HBI cluster data line */
  38. /* #define TX_SRAM_POOL_FREE_SIZE = 704; // Start of available TX SRAM */
  39. /* #define TX_SRAM_END_SIZE = 0; // End of TX SRAM */
  40. /* Receive SRAM */
  41. #define RX_SRAM_START 0x10000
  42. #define VID_A_DOWN_CMDS 0x10000
  43. #define VID_B_DOWN_CMDS 0x10050
  44. #define VID_C_DOWN_CMDS 0x100A0
  45. #define VID_D_DOWN_CMDS 0x100F0
  46. #define VID_E_DOWN_CMDS 0x10140
  47. #define VID_F_DOWN_CMDS 0x10190
  48. #define VID_G_DOWN_CMDS 0x101E0
  49. #define VID_H_DOWN_CMDS 0x10230
  50. #define VID_A_UP_CMDS 0x10280
  51. #define VID_B_UP_CMDS 0x102D0
  52. #define VID_C_UP_CMDS 0x10320
  53. #define VID_D_UP_CMDS 0x10370
  54. #define VID_E_UP_CMDS 0x103C0
  55. #define VID_F_UP_CMDS 0x10410
  56. #define VID_I_UP_CMDS 0x10460
  57. #define VID_J_UP_CMDS 0x104B0
  58. #define AUD_A_DOWN_CMDS 0x10500
  59. #define AUD_B_DOWN_CMDS 0x10550
  60. #define AUD_C_DOWN_CMDS 0x105A0
  61. #define AUD_D_DOWN_CMDS 0x105F0
  62. #define AUD_A_UP_CMDS 0x10640
  63. #define AUD_B_UP_CMDS 0x10690
  64. #define AUD_C_UP_CMDS 0x106E0
  65. #define AUD_E_UP_CMDS 0x10730
  66. #define MBIF_A_DOWN_CMDS 0x10780
  67. #define MBIF_B_DOWN_CMDS 0x107D0
  68. #define DMA_SCRATCH_PAD 0x10820 /* Scratch pad area from 0x10820 to 0x10B40 */
  69. /* #define RX_SRAM_POOL_START = 0x105B0; */
  70. #define VID_A_IQ 0x11000
  71. #define VID_B_IQ 0x11040
  72. #define VID_C_IQ 0x11080
  73. #define VID_D_IQ 0x110C0
  74. #define VID_E_IQ 0x11100
  75. #define VID_F_IQ 0x11140
  76. #define VID_G_IQ 0x11180
  77. #define VID_H_IQ 0x111C0
  78. #define VID_I_IQ 0x11200
  79. #define VID_J_IQ 0x11240
  80. #define AUD_A_IQ 0x11280
  81. #define AUD_B_IQ 0x112C0
  82. #define AUD_C_IQ 0x11300
  83. #define AUD_D_IQ 0x11340
  84. #define AUD_E_IQ 0x11380
  85. #define MBIF_A_IQ 0x11000
  86. #define MBIF_B_IQ 0x110C0
  87. #define VID_A_CDT 0x10C00
  88. #define VID_B_CDT 0x10C40
  89. #define VID_C_CDT 0x10C80
  90. #define VID_D_CDT 0x10CC0
  91. #define VID_E_CDT 0x10D00
  92. #define VID_F_CDT 0x10D40
  93. #define VID_G_CDT 0x10D80
  94. #define VID_H_CDT 0x10DC0
  95. #define VID_I_CDT 0x10E00
  96. #define VID_J_CDT 0x10E40
  97. #define AUD_A_CDT 0x10E80
  98. #define AUD_B_CDT 0x10EB0
  99. #define AUD_C_CDT 0x10EE0
  100. #define AUD_D_CDT 0x10F10
  101. #define AUD_E_CDT 0x10F40
  102. #define MBIF_A_CDT 0x10C00
  103. #define MBIF_B_CDT 0x10CC0
  104. /* Cluster Buffer for RX */
  105. #define VID_A_UP_CLUSTER_1 0x11400
  106. #define VID_A_UP_CLUSTER_2 0x119A0
  107. #define VID_A_UP_CLUSTER_3 0x11F40
  108. #define VID_A_UP_CLUSTER_4 0x124E0
  109. #define VID_B_UP_CLUSTER_1 0x12A80
  110. #define VID_B_UP_CLUSTER_2 0x13020
  111. #define VID_B_UP_CLUSTER_3 0x135C0
  112. #define VID_B_UP_CLUSTER_4 0x13B60
  113. #define VID_C_UP_CLUSTER_1 0x14100
  114. #define VID_C_UP_CLUSTER_2 0x146A0
  115. #define VID_C_UP_CLUSTER_3 0x14C40
  116. #define VID_C_UP_CLUSTER_4 0x151E0
  117. #define VID_D_UP_CLUSTER_1 0x15780
  118. #define VID_D_UP_CLUSTER_2 0x15D20
  119. #define VID_D_UP_CLUSTER_3 0x162C0
  120. #define VID_D_UP_CLUSTER_4 0x16860
  121. #define VID_E_UP_CLUSTER_1 0x16E00
  122. #define VID_E_UP_CLUSTER_2 0x173A0
  123. #define VID_E_UP_CLUSTER_3 0x17940
  124. #define VID_E_UP_CLUSTER_4 0x17EE0
  125. #define VID_F_UP_CLUSTER_1 0x18480
  126. #define VID_F_UP_CLUSTER_2 0x18A20
  127. #define VID_F_UP_CLUSTER_3 0x18FC0
  128. #define VID_F_UP_CLUSTER_4 0x19560
  129. #define VID_I_UP_CLUSTER_1 0x19B00
  130. #define VID_I_UP_CLUSTER_2 0x1A0A0
  131. #define VID_I_UP_CLUSTER_3 0x1A640
  132. #define VID_I_UP_CLUSTER_4 0x1ABE0
  133. #define VID_J_UP_CLUSTER_1 0x1B180
  134. #define VID_J_UP_CLUSTER_2 0x1B720
  135. #define VID_J_UP_CLUSTER_3 0x1BCC0
  136. #define VID_J_UP_CLUSTER_4 0x1C260
  137. #define AUD_A_UP_CLUSTER_1 0x1C800
  138. #define AUD_A_UP_CLUSTER_2 0x1C880
  139. #define AUD_A_UP_CLUSTER_3 0x1C900
  140. #define AUD_B_UP_CLUSTER_1 0x1C980
  141. #define AUD_B_UP_CLUSTER_2 0x1CA00
  142. #define AUD_B_UP_CLUSTER_3 0x1CA80
  143. #define AUD_C_UP_CLUSTER_1 0x1CB00
  144. #define AUD_C_UP_CLUSTER_2 0x1CB80
  145. #define AUD_C_UP_CLUSTER_3 0x1CC00
  146. #define AUD_E_UP_CLUSTER_1 0x1CC80
  147. #define AUD_E_UP_CLUSTER_2 0x1CD00
  148. #define AUD_E_UP_CLUSTER_3 0x1CD80
  149. #define RX_SRAM_POOL_FREE 0x1CE00
  150. #define RX_SRAM_END 0x1D000
  151. /* Free Receive SRAM 144 Bytes */
  152. /* Transmit SRAM */
  153. #define TX_SRAM_POOL_START 0x00000
  154. #define VID_A_DOWN_CLUSTER_1 0x00040
  155. #define VID_A_DOWN_CLUSTER_2 0x005E0
  156. #define VID_A_DOWN_CLUSTER_3 0x00B80
  157. #define VID_A_DOWN_CLUSTER_4 0x01120
  158. #define VID_B_DOWN_CLUSTER_1 0x016C0
  159. #define VID_B_DOWN_CLUSTER_2 0x01C60
  160. #define VID_B_DOWN_CLUSTER_3 0x02200
  161. #define VID_B_DOWN_CLUSTER_4 0x027A0
  162. #define VID_C_DOWN_CLUSTER_1 0x02D40
  163. #define VID_C_DOWN_CLUSTER_2 0x032E0
  164. #define VID_C_DOWN_CLUSTER_3 0x03880
  165. #define VID_C_DOWN_CLUSTER_4 0x03E20
  166. #define VID_D_DOWN_CLUSTER_1 0x043C0
  167. #define VID_D_DOWN_CLUSTER_2 0x04960
  168. #define VID_D_DOWN_CLUSTER_3 0x04F00
  169. #define VID_D_DOWN_CLUSTER_4 0x054A0
  170. #define VID_E_DOWN_CLUSTER_1 0x05a40
  171. #define VID_E_DOWN_CLUSTER_2 0x05FE0
  172. #define VID_E_DOWN_CLUSTER_3 0x06580
  173. #define VID_E_DOWN_CLUSTER_4 0x06B20
  174. #define VID_F_DOWN_CLUSTER_1 0x070C0
  175. #define VID_F_DOWN_CLUSTER_2 0x07660
  176. #define VID_F_DOWN_CLUSTER_3 0x07C00
  177. #define VID_F_DOWN_CLUSTER_4 0x081A0
  178. #define VID_G_DOWN_CLUSTER_1 0x08740
  179. #define VID_G_DOWN_CLUSTER_2 0x08CE0
  180. #define VID_G_DOWN_CLUSTER_3 0x09280
  181. #define VID_G_DOWN_CLUSTER_4 0x09820
  182. #define VID_H_DOWN_CLUSTER_1 0x09DC0
  183. #define VID_H_DOWN_CLUSTER_2 0x0A360
  184. #define VID_H_DOWN_CLUSTER_3 0x0A900
  185. #define VID_H_DOWN_CLUSTER_4 0x0AEA0
  186. #define AUD_A_DOWN_CLUSTER_1 0x0B500
  187. #define AUD_A_DOWN_CLUSTER_2 0x0B580
  188. #define AUD_A_DOWN_CLUSTER_3 0x0B600
  189. #define AUD_B_DOWN_CLUSTER_1 0x0B680
  190. #define AUD_B_DOWN_CLUSTER_2 0x0B700
  191. #define AUD_B_DOWN_CLUSTER_3 0x0B780
  192. #define AUD_C_DOWN_CLUSTER_1 0x0B800
  193. #define AUD_C_DOWN_CLUSTER_2 0x0B880
  194. #define AUD_C_DOWN_CLUSTER_3 0x0B900
  195. #define AUD_D_DOWN_CLUSTER_1 0x0B980
  196. #define AUD_D_DOWN_CLUSTER_2 0x0BA00
  197. #define AUD_D_DOWN_CLUSTER_3 0x0BA80
  198. #define TX_SRAM_POOL_FREE 0x0BB00
  199. #define TX_SRAM_END 0x0C000
  200. #define BYTES_TO_DWORDS(bcount) ((bcount) >> 2)
  201. #define BYTES_TO_QWORDS(bcount) ((bcount) >> 3)
  202. #define BYTES_TO_OWORDS(bcount) ((bcount) >> 4)
  203. #define VID_IQ_SIZE_DW BYTES_TO_DWORDS(VID_IQ_SIZE)
  204. #define VID_CDT_SIZE_QW BYTES_TO_QWORDS(VID_CDT_SIZE)
  205. #define VID_CLUSTER_SIZE_OW BYTES_TO_OWORDS(VID_CLUSTER_SIZE)
  206. #define AUDIO_IQ_SIZE_DW BYTES_TO_DWORDS(AUDIO_IQ_SIZE)
  207. #define AUDIO_CDT_SIZE_QW BYTES_TO_QWORDS(AUDIO_CDT_SIZE)
  208. #define AUDIO_CLUSTER_SIZE_QW BYTES_TO_QWORDS(AUDIO_CLUSTER_SIZE)
  209. #define MBIF_IQ_SIZE_DW BYTES_TO_DWORDS(MBIF_IQ_SIZE)
  210. #define MBIF_CDT_SIZE_QW BYTES_TO_QWORDS(MBIF_CDT_SIZE)
  211. #define MBIF_CLUSTER_SIZE_OW BYTES_TO_OWORDS(MBIF_CLUSTER_SIZE)
  212. #endif