ca0132_regs.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  1. /*
  2. * HD audio interface patch for Creative CA0132 chip.
  3. * CA0132 registers defines.
  4. *
  5. * Copyright (c) 2011, Creative Technology Ltd.
  6. *
  7. * This driver 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 driver 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. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. */
  21. #ifndef __CA0132_REGS_H
  22. #define __CA0132_REGS_H
  23. #define DSP_CHIP_OFFSET 0x100000
  24. #define DSP_DBGCNTL_MODULE_OFFSET 0xE30
  25. #define DSP_DBGCNTL_INST_OFFSET \
  26. (DSP_CHIP_OFFSET + DSP_DBGCNTL_MODULE_OFFSET)
  27. #define DSP_DBGCNTL_EXEC_LOBIT 0x0
  28. #define DSP_DBGCNTL_EXEC_HIBIT 0x3
  29. #define DSP_DBGCNTL_EXEC_MASK 0xF
  30. #define DSP_DBGCNTL_SS_LOBIT 0x4
  31. #define DSP_DBGCNTL_SS_HIBIT 0x7
  32. #define DSP_DBGCNTL_SS_MASK 0xF0
  33. #define DSP_DBGCNTL_STATE_LOBIT 0xA
  34. #define DSP_DBGCNTL_STATE_HIBIT 0xD
  35. #define DSP_DBGCNTL_STATE_MASK 0x3C00
  36. #define XRAM_CHIP_OFFSET 0x0
  37. #define XRAM_XRAM_CHANNEL_COUNT 0xE000
  38. #define XRAM_XRAM_MODULE_OFFSET 0x0
  39. #define XRAM_XRAM_CHAN_INCR 4
  40. #define XRAM_XRAM_INST_OFFSET(_chan) \
  41. (XRAM_CHIP_OFFSET + XRAM_XRAM_MODULE_OFFSET + \
  42. (_chan * XRAM_XRAM_CHAN_INCR))
  43. #define YRAM_CHIP_OFFSET 0x40000
  44. #define YRAM_YRAM_CHANNEL_COUNT 0x8000
  45. #define YRAM_YRAM_MODULE_OFFSET 0x0
  46. #define YRAM_YRAM_CHAN_INCR 4
  47. #define YRAM_YRAM_INST_OFFSET(_chan) \
  48. (YRAM_CHIP_OFFSET + YRAM_YRAM_MODULE_OFFSET + \
  49. (_chan * YRAM_YRAM_CHAN_INCR))
  50. #define UC_CHIP_OFFSET 0x80000
  51. #define UC_UC_CHANNEL_COUNT 0x10000
  52. #define UC_UC_MODULE_OFFSET 0x0
  53. #define UC_UC_CHAN_INCR 4
  54. #define UC_UC_INST_OFFSET(_chan) \
  55. (UC_CHIP_OFFSET + UC_UC_MODULE_OFFSET + \
  56. (_chan * UC_UC_CHAN_INCR))
  57. #define AXRAM_CHIP_OFFSET 0x3C000
  58. #define AXRAM_AXRAM_CHANNEL_COUNT 0x1000
  59. #define AXRAM_AXRAM_MODULE_OFFSET 0x0
  60. #define AXRAM_AXRAM_CHAN_INCR 4
  61. #define AXRAM_AXRAM_INST_OFFSET(_chan) \
  62. (AXRAM_CHIP_OFFSET + AXRAM_AXRAM_MODULE_OFFSET + \
  63. (_chan * AXRAM_AXRAM_CHAN_INCR))
  64. #define AYRAM_CHIP_OFFSET 0x78000
  65. #define AYRAM_AYRAM_CHANNEL_COUNT 0x1000
  66. #define AYRAM_AYRAM_MODULE_OFFSET 0x0
  67. #define AYRAM_AYRAM_CHAN_INCR 4
  68. #define AYRAM_AYRAM_INST_OFFSET(_chan) \
  69. (AYRAM_CHIP_OFFSET + AYRAM_AYRAM_MODULE_OFFSET + \
  70. (_chan * AYRAM_AYRAM_CHAN_INCR))
  71. #define DSPDMAC_CHIP_OFFSET 0x110000
  72. #define DSPDMAC_DMA_CFG_CHANNEL_COUNT 12
  73. #define DSPDMAC_DMACFG_MODULE_OFFSET 0xF00
  74. #define DSPDMAC_DMACFG_CHAN_INCR 0x10
  75. #define DSPDMAC_DMACFG_INST_OFFSET(_chan) \
  76. (DSPDMAC_CHIP_OFFSET + DSPDMAC_DMACFG_MODULE_OFFSET + \
  77. (_chan * DSPDMAC_DMACFG_CHAN_INCR))
  78. #define DSPDMAC_DMACFG_DBADR_LOBIT 0x0
  79. #define DSPDMAC_DMACFG_DBADR_HIBIT 0x10
  80. #define DSPDMAC_DMACFG_DBADR_MASK 0x1FFFF
  81. #define DSPDMAC_DMACFG_LP_LOBIT 0x11
  82. #define DSPDMAC_DMACFG_LP_HIBIT 0x11
  83. #define DSPDMAC_DMACFG_LP_MASK 0x20000
  84. #define DSPDMAC_DMACFG_AINCR_LOBIT 0x12
  85. #define DSPDMAC_DMACFG_AINCR_HIBIT 0x12
  86. #define DSPDMAC_DMACFG_AINCR_MASK 0x40000
  87. #define DSPDMAC_DMACFG_DWR_LOBIT 0x13
  88. #define DSPDMAC_DMACFG_DWR_HIBIT 0x13
  89. #define DSPDMAC_DMACFG_DWR_MASK 0x80000
  90. #define DSPDMAC_DMACFG_AJUMP_LOBIT 0x14
  91. #define DSPDMAC_DMACFG_AJUMP_HIBIT 0x17
  92. #define DSPDMAC_DMACFG_AJUMP_MASK 0xF00000
  93. #define DSPDMAC_DMACFG_AMODE_LOBIT 0x18
  94. #define DSPDMAC_DMACFG_AMODE_HIBIT 0x19
  95. #define DSPDMAC_DMACFG_AMODE_MASK 0x3000000
  96. #define DSPDMAC_DMACFG_LK_LOBIT 0x1A
  97. #define DSPDMAC_DMACFG_LK_HIBIT 0x1A
  98. #define DSPDMAC_DMACFG_LK_MASK 0x4000000
  99. #define DSPDMAC_DMACFG_AICS_LOBIT 0x1B
  100. #define DSPDMAC_DMACFG_AICS_HIBIT 0x1F
  101. #define DSPDMAC_DMACFG_AICS_MASK 0xF8000000
  102. #define DSPDMAC_DMACFG_LP_SINGLE 0
  103. #define DSPDMAC_DMACFG_LP_LOOPING 1
  104. #define DSPDMAC_DMACFG_AINCR_XANDY 0
  105. #define DSPDMAC_DMACFG_AINCR_XORY 1
  106. #define DSPDMAC_DMACFG_DWR_DMA_RD 0
  107. #define DSPDMAC_DMACFG_DWR_DMA_WR 1
  108. #define DSPDMAC_DMACFG_AMODE_LINEAR 0
  109. #define DSPDMAC_DMACFG_AMODE_RSV1 1
  110. #define DSPDMAC_DMACFG_AMODE_WINTLV 2
  111. #define DSPDMAC_DMACFG_AMODE_GINTLV 3
  112. #define DSPDMAC_DSP_ADR_OFS_CHANNEL_COUNT 12
  113. #define DSPDMAC_DSPADROFS_MODULE_OFFSET 0xF04
  114. #define DSPDMAC_DSPADROFS_CHAN_INCR 0x10
  115. #define DSPDMAC_DSPADROFS_INST_OFFSET(_chan) \
  116. (DSPDMAC_CHIP_OFFSET + DSPDMAC_DSPADROFS_MODULE_OFFSET + \
  117. (_chan * DSPDMAC_DSPADROFS_CHAN_INCR))
  118. #define DSPDMAC_DSPADROFS_COFS_LOBIT 0x0
  119. #define DSPDMAC_DSPADROFS_COFS_HIBIT 0xF
  120. #define DSPDMAC_DSPADROFS_COFS_MASK 0xFFFF
  121. #define DSPDMAC_DSPADROFS_BOFS_LOBIT 0x10
  122. #define DSPDMAC_DSPADROFS_BOFS_HIBIT 0x1F
  123. #define DSPDMAC_DSPADROFS_BOFS_MASK 0xFFFF0000
  124. #define DSPDMAC_DSP_ADR_WOFS_CHANNEL_COUNT 12
  125. #define DSPDMAC_DSPADRWOFS_MODULE_OFFSET 0xF04
  126. #define DSPDMAC_DSPADRWOFS_CHAN_INCR 0x10
  127. #define DSPDMAC_DSPADRWOFS_INST_OFFSET(_chan) \
  128. (DSPDMAC_CHIP_OFFSET + DSPDMAC_DSPADRWOFS_MODULE_OFFSET + \
  129. (_chan * DSPDMAC_DSPADRWOFS_CHAN_INCR))
  130. #define DSPDMAC_DSPADRWOFS_WCOFS_LOBIT 0x0
  131. #define DSPDMAC_DSPADRWOFS_WCOFS_HIBIT 0xA
  132. #define DSPDMAC_DSPADRWOFS_WCOFS_MASK 0x7FF
  133. #define DSPDMAC_DSPADRWOFS_WCBFR_LOBIT 0xB
  134. #define DSPDMAC_DSPADRWOFS_WCBFR_HIBIT 0xF
  135. #define DSPDMAC_DSPADRWOFS_WCBFR_MASK 0xF800
  136. #define DSPDMAC_DSPADRWOFS_WBOFS_LOBIT 0x10
  137. #define DSPDMAC_DSPADRWOFS_WBOFS_HIBIT 0x1A
  138. #define DSPDMAC_DSPADRWOFS_WBOFS_MASK 0x7FF0000
  139. #define DSPDMAC_DSPADRWOFS_WBBFR_LOBIT 0x1B
  140. #define DSPDMAC_DSPADRWOFS_WBBFR_HIBIT 0x1F
  141. #define DSPDMAC_DSPADRWOFS_WBBFR_MASK 0xF8000000
  142. #define DSPDMAC_DSP_ADR_GOFS_CHANNEL_COUNT 12
  143. #define DSPDMAC_DSPADRGOFS_MODULE_OFFSET 0xF04
  144. #define DSPDMAC_DSPADRGOFS_CHAN_INCR 0x10
  145. #define DSPDMAC_DSPADRGOFS_INST_OFFSET(_chan) \
  146. (DSPDMAC_CHIP_OFFSET + DSPDMAC_DSPADRGOFS_MODULE_OFFSET + \
  147. (_chan * DSPDMAC_DSPADRGOFS_CHAN_INCR))
  148. #define DSPDMAC_DSPADRGOFS_GCOFS_LOBIT 0x0
  149. #define DSPDMAC_DSPADRGOFS_GCOFS_HIBIT 0x9
  150. #define DSPDMAC_DSPADRGOFS_GCOFS_MASK 0x3FF
  151. #define DSPDMAC_DSPADRGOFS_GCS_LOBIT 0xA
  152. #define DSPDMAC_DSPADRGOFS_GCS_HIBIT 0xC
  153. #define DSPDMAC_DSPADRGOFS_GCS_MASK 0x1C00
  154. #define DSPDMAC_DSPADRGOFS_GCBFR_LOBIT 0xD
  155. #define DSPDMAC_DSPADRGOFS_GCBFR_HIBIT 0xF
  156. #define DSPDMAC_DSPADRGOFS_GCBFR_MASK 0xE000
  157. #define DSPDMAC_DSPADRGOFS_GBOFS_LOBIT 0x10
  158. #define DSPDMAC_DSPADRGOFS_GBOFS_HIBIT 0x19
  159. #define DSPDMAC_DSPADRGOFS_GBOFS_MASK 0x3FF0000
  160. #define DSPDMAC_DSPADRGOFS_GBS_LOBIT 0x1A
  161. #define DSPDMAC_DSPADRGOFS_GBS_HIBIT 0x1C
  162. #define DSPDMAC_DSPADRGOFS_GBS_MASK 0x1C000000
  163. #define DSPDMAC_DSPADRGOFS_GBBFR_LOBIT 0x1D
  164. #define DSPDMAC_DSPADRGOFS_GBBFR_HIBIT 0x1F
  165. #define DSPDMAC_DSPADRGOFS_GBBFR_MASK 0xE0000000
  166. #define DSPDMAC_XFR_CNT_CHANNEL_COUNT 12
  167. #define DSPDMAC_XFRCNT_MODULE_OFFSET 0xF08
  168. #define DSPDMAC_XFRCNT_CHAN_INCR 0x10
  169. #define DSPDMAC_XFRCNT_INST_OFFSET(_chan) \
  170. (DSPDMAC_CHIP_OFFSET + DSPDMAC_XFRCNT_MODULE_OFFSET + \
  171. (_chan * DSPDMAC_XFRCNT_CHAN_INCR))
  172. #define DSPDMAC_XFRCNT_CCNT_LOBIT 0x0
  173. #define DSPDMAC_XFRCNT_CCNT_HIBIT 0xF
  174. #define DSPDMAC_XFRCNT_CCNT_MASK 0xFFFF
  175. #define DSPDMAC_XFRCNT_BCNT_LOBIT 0x10
  176. #define DSPDMAC_XFRCNT_BCNT_HIBIT 0x1F
  177. #define DSPDMAC_XFRCNT_BCNT_MASK 0xFFFF0000
  178. #define DSPDMAC_IRQ_CNT_CHANNEL_COUNT 12
  179. #define DSPDMAC_IRQCNT_MODULE_OFFSET 0xF0C
  180. #define DSPDMAC_IRQCNT_CHAN_INCR 0x10
  181. #define DSPDMAC_IRQCNT_INST_OFFSET(_chan) \
  182. (DSPDMAC_CHIP_OFFSET + DSPDMAC_IRQCNT_MODULE_OFFSET + \
  183. (_chan * DSPDMAC_IRQCNT_CHAN_INCR))
  184. #define DSPDMAC_IRQCNT_CICNT_LOBIT 0x0
  185. #define DSPDMAC_IRQCNT_CICNT_HIBIT 0xF
  186. #define DSPDMAC_IRQCNT_CICNT_MASK 0xFFFF
  187. #define DSPDMAC_IRQCNT_BICNT_LOBIT 0x10
  188. #define DSPDMAC_IRQCNT_BICNT_HIBIT 0x1F
  189. #define DSPDMAC_IRQCNT_BICNT_MASK 0xFFFF0000
  190. #define DSPDMAC_AUD_CHSEL_CHANNEL_COUNT 12
  191. #define DSPDMAC_AUDCHSEL_MODULE_OFFSET 0xFC0
  192. #define DSPDMAC_AUDCHSEL_CHAN_INCR 0x4
  193. #define DSPDMAC_AUDCHSEL_INST_OFFSET(_chan) \
  194. (DSPDMAC_CHIP_OFFSET + DSPDMAC_AUDCHSEL_MODULE_OFFSET + \
  195. (_chan * DSPDMAC_AUDCHSEL_CHAN_INCR))
  196. #define DSPDMAC_AUDCHSEL_ACS_LOBIT 0x0
  197. #define DSPDMAC_AUDCHSEL_ACS_HIBIT 0x1F
  198. #define DSPDMAC_AUDCHSEL_ACS_MASK 0xFFFFFFFF
  199. #define DSPDMAC_CHNLSTART_MODULE_OFFSET 0xFF0
  200. #define DSPDMAC_CHNLSTART_INST_OFFSET \
  201. (DSPDMAC_CHIP_OFFSET + DSPDMAC_CHNLSTART_MODULE_OFFSET)
  202. #define DSPDMAC_CHNLSTART_EN_LOBIT 0x0
  203. #define DSPDMAC_CHNLSTART_EN_HIBIT 0xB
  204. #define DSPDMAC_CHNLSTART_EN_MASK 0xFFF
  205. #define DSPDMAC_CHNLSTART_VAI1_LOBIT 0xC
  206. #define DSPDMAC_CHNLSTART_VAI1_HIBIT 0xF
  207. #define DSPDMAC_CHNLSTART_VAI1_MASK 0xF000
  208. #define DSPDMAC_CHNLSTART_DIS_LOBIT 0x10
  209. #define DSPDMAC_CHNLSTART_DIS_HIBIT 0x1B
  210. #define DSPDMAC_CHNLSTART_DIS_MASK 0xFFF0000
  211. #define DSPDMAC_CHNLSTART_VAI2_LOBIT 0x1C
  212. #define DSPDMAC_CHNLSTART_VAI2_HIBIT 0x1F
  213. #define DSPDMAC_CHNLSTART_VAI2_MASK 0xF0000000
  214. #define DSPDMAC_CHNLSTATUS_MODULE_OFFSET 0xFF4
  215. #define DSPDMAC_CHNLSTATUS_INST_OFFSET \
  216. (DSPDMAC_CHIP_OFFSET + DSPDMAC_CHNLSTATUS_MODULE_OFFSET)
  217. #define DSPDMAC_CHNLSTATUS_ISC_LOBIT 0x0
  218. #define DSPDMAC_CHNLSTATUS_ISC_HIBIT 0xB
  219. #define DSPDMAC_CHNLSTATUS_ISC_MASK 0xFFF
  220. #define DSPDMAC_CHNLSTATUS_AOO_LOBIT 0xC
  221. #define DSPDMAC_CHNLSTATUS_AOO_HIBIT 0xC
  222. #define DSPDMAC_CHNLSTATUS_AOO_MASK 0x1000
  223. #define DSPDMAC_CHNLSTATUS_AOU_LOBIT 0xD
  224. #define DSPDMAC_CHNLSTATUS_AOU_HIBIT 0xD
  225. #define DSPDMAC_CHNLSTATUS_AOU_MASK 0x2000
  226. #define DSPDMAC_CHNLSTATUS_AIO_LOBIT 0xE
  227. #define DSPDMAC_CHNLSTATUS_AIO_HIBIT 0xE
  228. #define DSPDMAC_CHNLSTATUS_AIO_MASK 0x4000
  229. #define DSPDMAC_CHNLSTATUS_AIU_LOBIT 0xF
  230. #define DSPDMAC_CHNLSTATUS_AIU_HIBIT 0xF
  231. #define DSPDMAC_CHNLSTATUS_AIU_MASK 0x8000
  232. #define DSPDMAC_CHNLSTATUS_IEN_LOBIT 0x10
  233. #define DSPDMAC_CHNLSTATUS_IEN_HIBIT 0x1B
  234. #define DSPDMAC_CHNLSTATUS_IEN_MASK 0xFFF0000
  235. #define DSPDMAC_CHNLSTATUS_VAI0_LOBIT 0x1C
  236. #define DSPDMAC_CHNLSTATUS_VAI0_HIBIT 0x1F
  237. #define DSPDMAC_CHNLSTATUS_VAI0_MASK 0xF0000000
  238. #define DSPDMAC_CHNLPROP_MODULE_OFFSET 0xFF8
  239. #define DSPDMAC_CHNLPROP_INST_OFFSET \
  240. (DSPDMAC_CHIP_OFFSET + DSPDMAC_CHNLPROP_MODULE_OFFSET)
  241. #define DSPDMAC_CHNLPROP_DCON_LOBIT 0x0
  242. #define DSPDMAC_CHNLPROP_DCON_HIBIT 0xB
  243. #define DSPDMAC_CHNLPROP_DCON_MASK 0xFFF
  244. #define DSPDMAC_CHNLPROP_FFS_LOBIT 0xC
  245. #define DSPDMAC_CHNLPROP_FFS_HIBIT 0xC
  246. #define DSPDMAC_CHNLPROP_FFS_MASK 0x1000
  247. #define DSPDMAC_CHNLPROP_NAJ_LOBIT 0xD
  248. #define DSPDMAC_CHNLPROP_NAJ_HIBIT 0xD
  249. #define DSPDMAC_CHNLPROP_NAJ_MASK 0x2000
  250. #define DSPDMAC_CHNLPROP_ENH_LOBIT 0xE
  251. #define DSPDMAC_CHNLPROP_ENH_HIBIT 0xE
  252. #define DSPDMAC_CHNLPROP_ENH_MASK 0x4000
  253. #define DSPDMAC_CHNLPROP_MSPCE_LOBIT 0x10
  254. #define DSPDMAC_CHNLPROP_MSPCE_HIBIT 0x1B
  255. #define DSPDMAC_CHNLPROP_MSPCE_MASK 0xFFF0000
  256. #define DSPDMAC_CHNLPROP_AC_LOBIT 0x1C
  257. #define DSPDMAC_CHNLPROP_AC_HIBIT 0x1F
  258. #define DSPDMAC_CHNLPROP_AC_MASK 0xF0000000
  259. #define DSPDMAC_ACTIVE_MODULE_OFFSET 0xFFC
  260. #define DSPDMAC_ACTIVE_INST_OFFSET \
  261. (DSPDMAC_CHIP_OFFSET + DSPDMAC_ACTIVE_MODULE_OFFSET)
  262. #define DSPDMAC_ACTIVE_AAR_LOBIT 0x0
  263. #define DSPDMAC_ACTIVE_AAR_HIBIT 0xB
  264. #define DSPDMAC_ACTIVE_AAR_MASK 0xFFF
  265. #define DSPDMAC_ACTIVE_WFR_LOBIT 0xC
  266. #define DSPDMAC_ACTIVE_WFR_HIBIT 0x17
  267. #define DSPDMAC_ACTIVE_WFR_MASK 0xFFF000
  268. #define DSP_AUX_MEM_BASE 0xE000
  269. #define INVALID_CHIP_ADDRESS (~0U)
  270. #define X_SIZE (XRAM_XRAM_CHANNEL_COUNT * XRAM_XRAM_CHAN_INCR)
  271. #define Y_SIZE (YRAM_YRAM_CHANNEL_COUNT * YRAM_YRAM_CHAN_INCR)
  272. #define AX_SIZE (AXRAM_AXRAM_CHANNEL_COUNT * AXRAM_AXRAM_CHAN_INCR)
  273. #define AY_SIZE (AYRAM_AYRAM_CHANNEL_COUNT * AYRAM_AYRAM_CHAN_INCR)
  274. #define UC_SIZE (UC_UC_CHANNEL_COUNT * UC_UC_CHAN_INCR)
  275. #define XEXT_SIZE (X_SIZE + AX_SIZE)
  276. #define YEXT_SIZE (Y_SIZE + AY_SIZE)
  277. #define U64K 0x10000UL
  278. #define X_END (XRAM_CHIP_OFFSET + X_SIZE)
  279. #define X_EXT (XRAM_CHIP_OFFSET + XEXT_SIZE)
  280. #define AX_END (XRAM_CHIP_OFFSET + U64K*4)
  281. #define Y_END (YRAM_CHIP_OFFSET + Y_SIZE)
  282. #define Y_EXT (YRAM_CHIP_OFFSET + YEXT_SIZE)
  283. #define AY_END (YRAM_CHIP_OFFSET + U64K*4)
  284. #define UC_END (UC_CHIP_OFFSET + UC_SIZE)
  285. #define X_RANGE_MAIN(a, s) \
  286. (((a)+((s)-1)*XRAM_XRAM_CHAN_INCR < X_END))
  287. #define X_RANGE_AUX(a, s) \
  288. (((a) >= X_END) && ((a)+((s)-1)*XRAM_XRAM_CHAN_INCR < AX_END))
  289. #define X_RANGE_EXT(a, s) \
  290. (((a)+((s)-1)*XRAM_XRAM_CHAN_INCR < X_EXT))
  291. #define X_RANGE_ALL(a, s) \
  292. (((a)+((s)-1)*XRAM_XRAM_CHAN_INCR < AX_END))
  293. #define Y_RANGE_MAIN(a, s) \
  294. (((a) >= YRAM_CHIP_OFFSET) && \
  295. ((a)+((s)-1)*YRAM_YRAM_CHAN_INCR < Y_END))
  296. #define Y_RANGE_AUX(a, s) \
  297. (((a) >= Y_END) && \
  298. ((a)+((s)-1)*YRAM_YRAM_CHAN_INCR < AY_END))
  299. #define Y_RANGE_EXT(a, s) \
  300. (((a) >= YRAM_CHIP_OFFSET) && \
  301. ((a)+((s)-1)*YRAM_YRAM_CHAN_INCR < Y_EXT))
  302. #define Y_RANGE_ALL(a, s) \
  303. (((a) >= YRAM_CHIP_OFFSET) && \
  304. ((a)+((s)-1)*YRAM_YRAM_CHAN_INCR < AY_END))
  305. #define UC_RANGE(a, s) \
  306. (((a) >= UC_CHIP_OFFSET) && \
  307. ((a)+((s)-1)*UC_UC_CHAN_INCR < UC_END))
  308. #define X_OFF(a) \
  309. (((a) - XRAM_CHIP_OFFSET) / XRAM_XRAM_CHAN_INCR)
  310. #define AX_OFF(a) \
  311. (((a) % (AXRAM_AXRAM_CHANNEL_COUNT * \
  312. AXRAM_AXRAM_CHAN_INCR)) / AXRAM_AXRAM_CHAN_INCR)
  313. #define Y_OFF(a) \
  314. (((a) - YRAM_CHIP_OFFSET) / YRAM_YRAM_CHAN_INCR)
  315. #define AY_OFF(a) \
  316. (((a) % (AYRAM_AYRAM_CHANNEL_COUNT * \
  317. AYRAM_AYRAM_CHAN_INCR)) / AYRAM_AYRAM_CHAN_INCR)
  318. #define UC_OFF(a) (((a) - UC_CHIP_OFFSET) / UC_UC_CHAN_INCR)
  319. #define X_EXT_MAIN_SIZE(a) (XRAM_XRAM_CHANNEL_COUNT - X_OFF(a))
  320. #define X_EXT_AUX_SIZE(a, s) ((s) - X_EXT_MAIN_SIZE(a))
  321. #define Y_EXT_MAIN_SIZE(a) (YRAM_YRAM_CHANNEL_COUNT - Y_OFF(a))
  322. #define Y_EXT_AUX_SIZE(a, s) ((s) - Y_EXT_MAIN_SIZE(a))
  323. #endif