cx25821-sram.h 9.7 KB

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