snd_ps3_reg.h 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891
  1. /*
  2. * Audio support for PS3
  3. * Copyright (C) 2007 Sony Computer Entertainment Inc.
  4. * Copyright 2006, 2007 Sony Corporation
  5. * All rights reserved.
  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
  9. * as published by the Free Software Foundation; version 2 of the License.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. */
  20. /*
  21. * interrupt / configure registers
  22. */
  23. #define PS3_AUDIO_INTR_0 (0x00000100)
  24. #define PS3_AUDIO_INTR_EN_0 (0x00000140)
  25. #define PS3_AUDIO_CONFIG (0x00000200)
  26. /*
  27. * DMAC registers
  28. * n:0..9
  29. */
  30. #define PS3_AUDIO_DMAC_REGBASE(x) (0x0000210 + 0x20 * (x))
  31. #define PS3_AUDIO_KICK(n) (PS3_AUDIO_DMAC_REGBASE(n) + 0x00)
  32. #define PS3_AUDIO_SOURCE(n) (PS3_AUDIO_DMAC_REGBASE(n) + 0x04)
  33. #define PS3_AUDIO_DEST(n) (PS3_AUDIO_DMAC_REGBASE(n) + 0x08)
  34. #define PS3_AUDIO_DMASIZE(n) (PS3_AUDIO_DMAC_REGBASE(n) + 0x0C)
  35. /*
  36. * mute control
  37. */
  38. #define PS3_AUDIO_AX_MCTRL (0x00004000)
  39. #define PS3_AUDIO_AX_ISBP (0x00004004)
  40. #define PS3_AUDIO_AX_AOBP (0x00004008)
  41. #define PS3_AUDIO_AX_IC (0x00004010)
  42. #define PS3_AUDIO_AX_IE (0x00004014)
  43. #define PS3_AUDIO_AX_IS (0x00004018)
  44. /*
  45. * three wire serial
  46. * n:0..3
  47. */
  48. #define PS3_AUDIO_AO_MCTRL (0x00006000)
  49. #define PS3_AUDIO_AO_3WMCTRL (0x00006004)
  50. #define PS3_AUDIO_AO_3WCTRL(n) (0x00006200 + 0x200 * (n))
  51. /*
  52. * S/PDIF
  53. * n:0..1
  54. * x:0..11
  55. * y:0..5
  56. */
  57. #define PS3_AUDIO_AO_SPD_REGBASE(n) (0x00007200 + 0x200 * (n))
  58. #define PS3_AUDIO_AO_SPDCTRL(n) \
  59. (PS3_AUDIO_AO_SPD_REGBASE(n) + 0x00)
  60. #define PS3_AUDIO_AO_SPDUB(n, x) \
  61. (PS3_AUDIO_AO_SPD_REGBASE(n) + 0x04 + 0x04 * (x))
  62. #define PS3_AUDIO_AO_SPDCS(n, y) \
  63. (PS3_AUDIO_AO_SPD_REGBASE(n) + 0x34 + 0x04 * (y))
  64. /*
  65. PS3_AUDIO_INTR_0 register tells an interrupt handler which audio
  66. DMA channel triggered the interrupt. The interrupt status for a channel
  67. can be cleared by writing a '1' to the corresponding bit. A new interrupt
  68. cannot be generated until the previous interrupt has been cleared.
  69. Note that the status reported by PS3_AUDIO_INTR_0 is independent of the
  70. value of PS3_AUDIO_INTR_EN_0.
  71. 31 24 23 16 15 8 7 0
  72. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  73. |0 0 0 0 0 0 0 0 0 0 0 0 0|C|0|C|0|C|0|C|0|C|0|C|0|C|0|C|0|C|0|C| INTR_0
  74. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  75. */
  76. #define PS3_AUDIO_INTR_0_CHAN(n) (1 << ((n) * 2))
  77. #define PS3_AUDIO_INTR_0_CHAN9 PS3_AUDIO_INTR_0_CHAN(9)
  78. #define PS3_AUDIO_INTR_0_CHAN8 PS3_AUDIO_INTR_0_CHAN(8)
  79. #define PS3_AUDIO_INTR_0_CHAN7 PS3_AUDIO_INTR_0_CHAN(7)
  80. #define PS3_AUDIO_INTR_0_CHAN6 PS3_AUDIO_INTR_0_CHAN(6)
  81. #define PS3_AUDIO_INTR_0_CHAN5 PS3_AUDIO_INTR_0_CHAN(5)
  82. #define PS3_AUDIO_INTR_0_CHAN4 PS3_AUDIO_INTR_0_CHAN(4)
  83. #define PS3_AUDIO_INTR_0_CHAN3 PS3_AUDIO_INTR_0_CHAN(3)
  84. #define PS3_AUDIO_INTR_0_CHAN2 PS3_AUDIO_INTR_0_CHAN(2)
  85. #define PS3_AUDIO_INTR_0_CHAN1 PS3_AUDIO_INTR_0_CHAN(1)
  86. #define PS3_AUDIO_INTR_0_CHAN0 PS3_AUDIO_INTR_0_CHAN(0)
  87. /*
  88. The PS3_AUDIO_INTR_EN_0 register specifies which DMA channels can generate
  89. an interrupt to the PU. Each bit of PS3_AUDIO_INTR_EN_0 is ANDed with the
  90. corresponding bit in PS3_AUDIO_INTR_0. The resulting bits are OR'd together
  91. to generate the Audio interrupt.
  92. 31 24 23 16 15 8 7 0
  93. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  94. |0 0 0 0 0 0 0 0 0 0 0 0 0|C|0|C|0|C|0|C|0|C|0|C|0|C|0|C|0|C|0|C| INTR_EN_0
  95. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  96. Bit assignments are same as PS3_AUDIO_INTR_0
  97. */
  98. /*
  99. PS3_AUDIO_CONFIG
  100. 31 24 23 16 15 8 7 0
  101. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  102. |0 0 0 0 0 0 0 0|0 0 0 0 0 0 0 0|0 0 0 0 0 0 0 C|0 0 0 0 0 0 0 0| CONFIG
  103. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  104. */
  105. /* The CLEAR field cancels all pending transfers, and stops any running DMA
  106. transfers. Any interrupts associated with the canceled transfers
  107. will occur as if the transfer had finished.
  108. Since this bit is designed to recover from DMA related issues
  109. which are caused by unpredictable situations, it is preferred to wait
  110. for normal DMA transfer end without using this bit.
  111. */
  112. #define PS3_AUDIO_CONFIG_CLEAR (1 << 8) /* RWIVF */
  113. /*
  114. PS3_AUDIO_AX_MCTRL: Audio Port Mute Control Register
  115. 31 24 23 16 15 8 7 0
  116. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  117. |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0|A|A|A|0 0 0 0 0 0 0|S|S|A|A|A|A| AX_MCTRL
  118. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  119. */
  120. /* 3 Wire Audio Serial Output Channel Mutes (0..3) */
  121. #define PS3_AUDIO_AX_MCTRL_ASOMT(n) (1 << (3 - (n))) /* RWIVF */
  122. #define PS3_AUDIO_AX_MCTRL_ASO3MT (1 << 0) /* RWIVF */
  123. #define PS3_AUDIO_AX_MCTRL_ASO2MT (1 << 1) /* RWIVF */
  124. #define PS3_AUDIO_AX_MCTRL_ASO1MT (1 << 2) /* RWIVF */
  125. #define PS3_AUDIO_AX_MCTRL_ASO0MT (1 << 3) /* RWIVF */
  126. /* S/PDIF mutes (0,1)*/
  127. #define PS3_AUDIO_AX_MCTRL_SPOMT(n) (1 << (5 - (n))) /* RWIVF */
  128. #define PS3_AUDIO_AX_MCTRL_SPO1MT (1 << 4) /* RWIVF */
  129. #define PS3_AUDIO_AX_MCTRL_SPO0MT (1 << 5) /* RWIVF */
  130. /* All 3 Wire Serial Outputs Mute */
  131. #define PS3_AUDIO_AX_MCTRL_AASOMT (1 << 13) /* RWIVF */
  132. /* All S/PDIF Mute */
  133. #define PS3_AUDIO_AX_MCTRL_ASPOMT (1 << 14) /* RWIVF */
  134. /* All Audio Outputs Mute */
  135. #define PS3_AUDIO_AX_MCTRL_AAOMT (1 << 15) /* RWIVF */
  136. /*
  137. S/PDIF Outputs Buffer Read/Write Pointer Register
  138. 31 24 23 16 15 8 7 0
  139. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  140. |0 0 0 0 0 0 0 0|0|SPO0B|0|SPO1B|0 0 0 0 0 0 0 0|0|SPO0B|0|SPO1B| AX_ISBP
  141. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  142. */
  143. /*
  144. S/PDIF Output Channel Read Buffer Numbers
  145. Buffer number is value of field.
  146. Indicates current read access buffer ID from Audio Data
  147. Transfer controller of S/PDIF Output
  148. */
  149. #define PS3_AUDIO_AX_ISBP_SPOBRN_MASK(n) (0x7 << 4 * (1 - (n))) /* R-IUF */
  150. #define PS3_AUDIO_AX_ISBP_SPO1BRN_MASK (0x7 << 0) /* R-IUF */
  151. #define PS3_AUDIO_AX_ISBP_SPO0BRN_MASK (0x7 << 4) /* R-IUF */
  152. /*
  153. S/PDIF Output Channel Buffer Write Numbers
  154. Indicates current write access buffer ID from bus master.
  155. */
  156. #define PS3_AUDIO_AX_ISBP_SPOBWN_MASK(n) (0x7 << 4 * (5 - (n))) /* R-IUF */
  157. #define PS3_AUDIO_AX_ISBP_SPO1BWN_MASK (0x7 << 16) /* R-IUF */
  158. #define PS3_AUDIO_AX_ISBP_SPO0BWN_MASK (0x7 << 20) /* R-IUF */
  159. /*
  160. 3 Wire Audio Serial Outputs Buffer Read/Write
  161. Pointer Register
  162. Buffer number is value of field
  163. 31 24 23 16 15 8 7 0
  164. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  165. |0|ASO0B|0|ASO1B|0|ASO2B|0|ASO3B|0|ASO0B|0|ASO1B|0|ASO2B|0|ASO3B| AX_AOBP
  166. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  167. */
  168. /*
  169. 3 Wire Audio Serial Output Channel Buffer Read Numbers
  170. Indicates current read access buffer Id from Audio Data Transfer
  171. Controller of 3 Wire Audio Serial Output Channels
  172. */
  173. #define PS3_AUDIO_AX_AOBP_ASOBRN_MASK(n) (0x7 << 4 * (3 - (n))) /* R-IUF */
  174. #define PS3_AUDIO_AX_AOBP_ASO3BRN_MASK (0x7 << 0) /* R-IUF */
  175. #define PS3_AUDIO_AX_AOBP_ASO2BRN_MASK (0x7 << 4) /* R-IUF */
  176. #define PS3_AUDIO_AX_AOBP_ASO1BRN_MASK (0x7 << 8) /* R-IUF */
  177. #define PS3_AUDIO_AX_AOBP_ASO0BRN_MASK (0x7 << 12) /* R-IUF */
  178. /*
  179. 3 Wire Audio Serial Output Channel Buffer Write Numbers
  180. Indicates current write access buffer ID from bus master.
  181. */
  182. #define PS3_AUDIO_AX_AOBP_ASOBWN_MASK(n) (0x7 << 4 * (7 - (n))) /* R-IUF */
  183. #define PS3_AUDIO_AX_AOBP_ASO3BWN_MASK (0x7 << 16) /* R-IUF */
  184. #define PS3_AUDIO_AX_AOBP_ASO2BWN_MASK (0x7 << 20) /* R-IUF */
  185. #define PS3_AUDIO_AX_AOBP_ASO1BWN_MASK (0x7 << 24) /* R-IUF */
  186. #define PS3_AUDIO_AX_AOBP_ASO0BWN_MASK (0x7 << 28) /* R-IUF */
  187. /*
  188. Audio Port Interrupt Condition Register
  189. For the fields in this register, the following values apply:
  190. 0 = Interrupt is generated every interrupt event.
  191. 1 = Interrupt is generated every 2 interrupt events.
  192. 2 = Interrupt is generated every 4 interrupt events.
  193. 3 = Reserved
  194. 31 24 23 16 15 8 7 0
  195. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  196. |0 0 0 0 0 0 0 0|0 0|SPO|0 0|SPO|0 0|AAS|0 0 0 0 0 0 0 0 0 0 0 0| AX_IC
  197. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  198. */
  199. /*
  200. All 3-Wire Audio Serial Outputs Interrupt Mode
  201. Configures the Interrupt and Signal Notification
  202. condition of all 3-wire Audio Serial Outputs.
  203. */
  204. #define PS3_AUDIO_AX_IC_AASOIMD_MASK (0x3 << 12) /* RWIVF */
  205. #define PS3_AUDIO_AX_IC_AASOIMD_EVERY1 (0x0 << 12) /* RWI-V */
  206. #define PS3_AUDIO_AX_IC_AASOIMD_EVERY2 (0x1 << 12) /* RW--V */
  207. #define PS3_AUDIO_AX_IC_AASOIMD_EVERY4 (0x2 << 12) /* RW--V */
  208. /*
  209. S/PDIF Output Channel Interrupt Modes
  210. Configures the Interrupt and signal Notification
  211. conditions of S/PDIF output channels.
  212. */
  213. #define PS3_AUDIO_AX_IC_SPO1IMD_MASK (0x3 << 16) /* RWIVF */
  214. #define PS3_AUDIO_AX_IC_SPO1IMD_EVERY1 (0x0 << 16) /* RWI-V */
  215. #define PS3_AUDIO_AX_IC_SPO1IMD_EVERY2 (0x1 << 16) /* RW--V */
  216. #define PS3_AUDIO_AX_IC_SPO1IMD_EVERY4 (0x2 << 16) /* RW--V */
  217. #define PS3_AUDIO_AX_IC_SPO0IMD_MASK (0x3 << 20) /* RWIVF */
  218. #define PS3_AUDIO_AX_IC_SPO0IMD_EVERY1 (0x0 << 20) /* RWI-V */
  219. #define PS3_AUDIO_AX_IC_SPO0IMD_EVERY2 (0x1 << 20) /* RW--V */
  220. #define PS3_AUDIO_AX_IC_SPO0IMD_EVERY4 (0x2 << 20) /* RW--V */
  221. /*
  222. Audio Port interrupt Enable Register
  223. Configures whether to enable or disable each Interrupt Generation.
  224. 31 24 23 16 15 8 7 0
  225. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  226. |0 0 0 0 0 0 0 0|S|S|0 0|A|A|A|A|0 0 0 0|S|S|0 0|S|S|0 0|A|A|A|A| AX_IE
  227. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  228. */
  229. /*
  230. 3 Wire Audio Serial Output Channel Buffer Underflow
  231. Interrupt Enables
  232. Select enable/disable of Buffer Underflow Interrupts for
  233. 3-Wire Audio Serial Output Channels
  234. DISABLED=Interrupt generation disabled.
  235. */
  236. #define PS3_AUDIO_AX_IE_ASOBUIE(n) (1 << (3 - (n))) /* RWIVF */
  237. #define PS3_AUDIO_AX_IE_ASO3BUIE (1 << 0) /* RWIVF */
  238. #define PS3_AUDIO_AX_IE_ASO2BUIE (1 << 1) /* RWIVF */
  239. #define PS3_AUDIO_AX_IE_ASO1BUIE (1 << 2) /* RWIVF */
  240. #define PS3_AUDIO_AX_IE_ASO0BUIE (1 << 3) /* RWIVF */
  241. /* S/PDIF Output Channel Buffer Underflow Interrupt Enables */
  242. #define PS3_AUDIO_AX_IE_SPOBUIE(n) (1 << (7 - (n))) /* RWIVF */
  243. #define PS3_AUDIO_AX_IE_SPO1BUIE (1 << 6) /* RWIVF */
  244. #define PS3_AUDIO_AX_IE_SPO0BUIE (1 << 7) /* RWIVF */
  245. /* S/PDIF Output Channel One Block Transfer Completion Interrupt Enables */
  246. #define PS3_AUDIO_AX_IE_SPOBTCIE(n) (1 << (11 - (n))) /* RWIVF */
  247. #define PS3_AUDIO_AX_IE_SPO1BTCIE (1 << 10) /* RWIVF */
  248. #define PS3_AUDIO_AX_IE_SPO0BTCIE (1 << 11) /* RWIVF */
  249. /* 3-Wire Audio Serial Output Channel Buffer Empty Interrupt Enables */
  250. #define PS3_AUDIO_AX_IE_ASOBEIE(n) (1 << (19 - (n))) /* RWIVF */
  251. #define PS3_AUDIO_AX_IE_ASO3BEIE (1 << 16) /* RWIVF */
  252. #define PS3_AUDIO_AX_IE_ASO2BEIE (1 << 17) /* RWIVF */
  253. #define PS3_AUDIO_AX_IE_ASO1BEIE (1 << 18) /* RWIVF */
  254. #define PS3_AUDIO_AX_IE_ASO0BEIE (1 << 19) /* RWIVF */
  255. /* S/PDIF Output Channel Buffer Empty Interrupt Enables */
  256. #define PS3_AUDIO_AX_IE_SPOBEIE(n) (1 << (23 - (n))) /* RWIVF */
  257. #define PS3_AUDIO_AX_IE_SPO1BEIE (1 << 22) /* RWIVF */
  258. #define PS3_AUDIO_AX_IE_SPO0BEIE (1 << 23) /* RWIVF */
  259. /*
  260. Audio Port Interrupt Status Register
  261. Indicates Interrupt status, which interrupt has occurred, and can clear
  262. each interrupt in this register.
  263. Writing 1b to a field containing 1b clears field and de-asserts interrupt.
  264. Writing 0b to a field has no effect.
  265. Field vaules are the following:
  266. 0 - Interrupt hasn't occurred.
  267. 1 - Interrupt has occurred.
  268. 31 24 23 16 15 8 7 0
  269. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  270. |0 0 0 0 0 0 0 0|S|S|0 0|A|A|A|A|0 0 0 0|S|S|0 0|S|S|0 0|A|A|A|A| AX_IS
  271. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  272. Bit assignment are same as AX_IE
  273. */
  274. /*
  275. Audio Output Master Control Register
  276. Configures Master Clock and other master Audio Output Settings
  277. 31 24 23 16 15 8 7 0
  278. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  279. |0|SCKSE|0|SCKSE| MR0 | MR1 |MCL|MCL|0 0 0 0|0 0 0 0 0 0 0 0| AO_MCTRL
  280. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  281. */
  282. /*
  283. MCLK Output Control
  284. Controls mclko[1] output.
  285. 0 - Disable output (fixed at High)
  286. 1 - Output clock produced by clock selected
  287. with scksel1 by mr1
  288. 2 - Reserved
  289. 3 - Reserved
  290. */
  291. #define PS3_AUDIO_AO_MCTRL_MCLKC1_MASK (0x3 << 12) /* RWIVF */
  292. #define PS3_AUDIO_AO_MCTRL_MCLKC1_DISABLED (0x0 << 12) /* RWI-V */
  293. #define PS3_AUDIO_AO_MCTRL_MCLKC1_ENABLED (0x1 << 12) /* RW--V */
  294. #define PS3_AUDIO_AO_MCTRL_MCLKC1_RESVD2 (0x2 << 12) /* RW--V */
  295. #define PS3_AUDIO_AO_MCTRL_MCLKC1_RESVD3 (0x3 << 12) /* RW--V */
  296. /*
  297. MCLK Output Control
  298. Controls mclko[0] output.
  299. 0 - Disable output (fixed at High)
  300. 1 - Output clock produced by clock selected
  301. with SCKSEL0 by MR0
  302. 2 - Reserved
  303. 3 - Reserved
  304. */
  305. #define PS3_AUDIO_AO_MCTRL_MCLKC0_MASK (0x3 << 14) /* RWIVF */
  306. #define PS3_AUDIO_AO_MCTRL_MCLKC0_DISABLED (0x0 << 14) /* RWI-V */
  307. #define PS3_AUDIO_AO_MCTRL_MCLKC0_ENABLED (0x1 << 14) /* RW--V */
  308. #define PS3_AUDIO_AO_MCTRL_MCLKC0_RESVD2 (0x2 << 14) /* RW--V */
  309. #define PS3_AUDIO_AO_MCTRL_MCLKC0_RESVD3 (0x3 << 14) /* RW--V */
  310. /*
  311. Master Clock Rate 1
  312. Sets the divide ration of Master Clock1 (clock output from
  313. mclko[1] for the input clock selected by scksel1.
  314. */
  315. #define PS3_AUDIO_AO_MCTRL_MR1_MASK (0xf << 16)
  316. #define PS3_AUDIO_AO_MCTRL_MR1_DEFAULT (0x0 << 16) /* RWI-V */
  317. /*
  318. Master Clock Rate 0
  319. Sets the divide ratio of Master Clock0 (clock output from
  320. mclko[0] for the input clock selected by scksel0).
  321. */
  322. #define PS3_AUDIO_AO_MCTRL_MR0_MASK (0xf << 20) /* RWIVF */
  323. #define PS3_AUDIO_AO_MCTRL_MR0_DEFAULT (0x0 << 20) /* RWI-V */
  324. /*
  325. System Clock Select 0/1
  326. Selects the system clock to be used as Master Clock 0/1
  327. Input the system clock that is appropriate for the sampling
  328. rate.
  329. */
  330. #define PS3_AUDIO_AO_MCTRL_SCKSEL1_MASK (0x7 << 24) /* RWIVF */
  331. #define PS3_AUDIO_AO_MCTRL_SCKSEL1_DEFAULT (0x2 << 24) /* RWI-V */
  332. #define PS3_AUDIO_AO_MCTRL_SCKSEL0_MASK (0x7 << 28) /* RWIVF */
  333. #define PS3_AUDIO_AO_MCTRL_SCKSEL0_DEFAULT (0x2 << 28) /* RWI-V */
  334. /*
  335. 3-Wire Audio Output Master Control Register
  336. Configures clock, 3-Wire Audio Serial Output Enable, and
  337. other 3-Wire Audio Serial Output Master Settings
  338. 31 24 23 16 15 8 7 0
  339. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  340. |A|A|A|A|0 0 0|A| ASOSR |0 0 0 0|A|A|A|A|A|A|0|1|0 0 0 0 0 0 0 0| AO_3WMCTRL
  341. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  342. */
  343. /*
  344. LRCKO Polarity
  345. 0 - Reserved
  346. 1 - default
  347. */
  348. #define PS3_AUDIO_AO_3WMCTRL_ASOPLRCK (1 << 8) /* RWIVF */
  349. #define PS3_AUDIO_AO_3WMCTRL_ASOPLRCK_DEFAULT (1 << 8) /* RW--V */
  350. /* LRCK Output Disable */
  351. #define PS3_AUDIO_AO_3WMCTRL_ASOLRCKD (1 << 10) /* RWIVF */
  352. #define PS3_AUDIO_AO_3WMCTRL_ASOLRCKD_ENABLED (0 << 10) /* RW--V */
  353. #define PS3_AUDIO_AO_3WMCTRL_ASOLRCKD_DISABLED (1 << 10) /* RWI-V */
  354. /* Bit Clock Output Disable */
  355. #define PS3_AUDIO_AO_3WMCTRL_ASOBCLKD (1 << 11) /* RWIVF */
  356. #define PS3_AUDIO_AO_3WMCTRL_ASOBCLKD_ENABLED (0 << 11) /* RW--V */
  357. #define PS3_AUDIO_AO_3WMCTRL_ASOBCLKD_DISABLED (1 << 11) /* RWI-V */
  358. /*
  359. 3-Wire Audio Serial Output Channel 0-3 Operational
  360. Status. Each bit becomes 1 after each 3-Wire Audio
  361. Serial Output Channel N is in action by setting 1 to
  362. asoen.
  363. Each bit becomes 0 after each 3-Wire Audio Serial Output
  364. Channel N is out of action by setting 0 to asoen.
  365. */
  366. #define PS3_AUDIO_AO_3WMCTRL_ASORUN(n) (1 << (15 - (n))) /* R-IVF */
  367. #define PS3_AUDIO_AO_3WMCTRL_ASORUN_STOPPED(n) (0 << (15 - (n))) /* R-I-V */
  368. #define PS3_AUDIO_AO_3WMCTRL_ASORUN_RUNNING(n) (1 << (15 - (n))) /* R---V */
  369. #define PS3_AUDIO_AO_3WMCTRL_ASORUN0 \
  370. PS3_AUDIO_AO_3WMCTRL_ASORUN(0)
  371. #define PS3_AUDIO_AO_3WMCTRL_ASORUN0_STOPPED \
  372. PS3_AUDIO_AO_3WMCTRL_ASORUN_STOPPED(0)
  373. #define PS3_AUDIO_AO_3WMCTRL_ASORUN0_RUNNING \
  374. PS3_AUDIO_AO_3WMCTRL_ASORUN_RUNNING(0)
  375. #define PS3_AUDIO_AO_3WMCTRL_ASORUN1 \
  376. PS3_AUDIO_AO_3WMCTRL_ASORUN(1)
  377. #define PS3_AUDIO_AO_3WMCTRL_ASORUN1_STOPPED \
  378. PS3_AUDIO_AO_3WMCTRL_ASORUN_STOPPED(1)
  379. #define PS3_AUDIO_AO_3WMCTRL_ASORUN1_RUNNING \
  380. PS3_AUDIO_AO_3WMCTRL_ASORUN_RUNNING(1)
  381. #define PS3_AUDIO_AO_3WMCTRL_ASORUN2 \
  382. PS3_AUDIO_AO_3WMCTRL_ASORUN(2)
  383. #define PS3_AUDIO_AO_3WMCTRL_ASORUN2_STOPPED \
  384. PS3_AUDIO_AO_3WMCTRL_ASORUN_STOPPED(2)
  385. #define PS3_AUDIO_AO_3WMCTRL_ASORUN2_RUNNING \
  386. PS3_AUDIO_AO_3WMCTRL_ASORUN_RUNNING(2)
  387. #define PS3_AUDIO_AO_3WMCTRL_ASORUN3 \
  388. PS3_AUDIO_AO_3WMCTRL_ASORUN(3)
  389. #define PS3_AUDIO_AO_3WMCTRL_ASORUN3_STOPPED \
  390. PS3_AUDIO_AO_3WMCTRL_ASORUN_STOPPED(3)
  391. #define PS3_AUDIO_AO_3WMCTRL_ASORUN3_RUNNING \
  392. PS3_AUDIO_AO_3WMCTRL_ASORUN_RUNNING(3)
  393. /*
  394. Sampling Rate
  395. Specifies the divide ratio of the bit clock (clock output
  396. from bclko) used by the 3-wire Audio Output Clock, which
  397. is applied to the master clock selected by mcksel.
  398. Data output is synchronized with this clock.
  399. */
  400. #define PS3_AUDIO_AO_3WMCTRL_ASOSR_MASK (0xf << 20) /* RWIVF */
  401. #define PS3_AUDIO_AO_3WMCTRL_ASOSR_DIV2 (0x1 << 20) /* RWI-V */
  402. #define PS3_AUDIO_AO_3WMCTRL_ASOSR_DIV4 (0x2 << 20) /* RW--V */
  403. #define PS3_AUDIO_AO_3WMCTRL_ASOSR_DIV8 (0x4 << 20) /* RW--V */
  404. #define PS3_AUDIO_AO_3WMCTRL_ASOSR_DIV12 (0x6 << 20) /* RW--V */
  405. /*
  406. Master Clock Select
  407. 0 - Master Clock 0
  408. 1 - Master Clock 1
  409. */
  410. #define PS3_AUDIO_AO_3WMCTRL_ASOMCKSEL (1 << 24) /* RWIVF */
  411. #define PS3_AUDIO_AO_3WMCTRL_ASOMCKSEL_CLK0 (0 << 24) /* RWI-V */
  412. #define PS3_AUDIO_AO_3WMCTRL_ASOMCKSEL_CLK1 (1 << 24) /* RW--V */
  413. /*
  414. Enables and disables 4ch 3-Wire Audio Serial Output
  415. operation. Each Bit from 0 to 3 corresponds to an
  416. output channel, which means that each output channel
  417. can be enabled or disabled individually. When
  418. multiple channels are enabled at the same time, output
  419. operations are performed in synchronization.
  420. Bit 0 - Output Channel 0 (SDOUT[0])
  421. Bit 1 - Output Channel 1 (SDOUT[1])
  422. Bit 2 - Output Channel 2 (SDOUT[2])
  423. Bit 3 - Output Channel 3 (SDOUT[3])
  424. */
  425. #define PS3_AUDIO_AO_3WMCTRL_ASOEN(n) (1 << (31 - (n))) /* RWIVF */
  426. #define PS3_AUDIO_AO_3WMCTRL_ASOEN_DISABLED(n) (0 << (31 - (n))) /* RWI-V */
  427. #define PS3_AUDIO_AO_3WMCTRL_ASOEN_ENABLED(n) (1 << (31 - (n))) /* RW--V */
  428. #define PS3_AUDIO_AO_3WMCTRL_ASOEN0 \
  429. PS3_AUDIO_AO_3WMCTRL_ASOEN(0) /* RWIVF */
  430. #define PS3_AUDIO_AO_3WMCTRL_ASOEN0_DISABLED \
  431. PS3_AUDIO_AO_3WMCTRL_ASOEN_DISABLED(0) /* RWI-V */
  432. #define PS3_AUDIO_AO_3WMCTRL_ASOEN0_ENABLED \
  433. PS3_AUDIO_AO_3WMCTRL_ASOEN_ENABLED(0) /* RW--V */
  434. #define PS3_AUDIO_A1_3WMCTRL_ASOEN0 \
  435. PS3_AUDIO_AO_3WMCTRL_ASOEN(1) /* RWIVF */
  436. #define PS3_AUDIO_A1_3WMCTRL_ASOEN0_DISABLED \
  437. PS3_AUDIO_AO_3WMCTRL_ASOEN_DISABLED(1) /* RWI-V */
  438. #define PS3_AUDIO_A1_3WMCTRL_ASOEN0_ENABLED \
  439. PS3_AUDIO_AO_3WMCTRL_ASOEN_ENABLED(1) /* RW--V */
  440. #define PS3_AUDIO_A2_3WMCTRL_ASOEN0 \
  441. PS3_AUDIO_AO_3WMCTRL_ASOEN(2) /* RWIVF */
  442. #define PS3_AUDIO_A2_3WMCTRL_ASOEN0_DISABLED \
  443. PS3_AUDIO_AO_3WMCTRL_ASOEN_DISABLED(2) /* RWI-V */
  444. #define PS3_AUDIO_A2_3WMCTRL_ASOEN0_ENABLED \
  445. PS3_AUDIO_AO_3WMCTRL_ASOEN_ENABLED(2) /* RW--V */
  446. #define PS3_AUDIO_A3_3WMCTRL_ASOEN0 \
  447. PS3_AUDIO_AO_3WMCTRL_ASOEN(3) /* RWIVF */
  448. #define PS3_AUDIO_A3_3WMCTRL_ASOEN0_DISABLED \
  449. PS3_AUDIO_AO_3WMCTRL_ASOEN_DISABLED(3) /* RWI-V */
  450. #define PS3_AUDIO_A3_3WMCTRL_ASOEN0_ENABLED \
  451. PS3_AUDIO_AO_3WMCTRL_ASOEN_ENABLED(3) /* RW--V */
  452. /*
  453. 3-Wire Audio Serial output Channel 0-3 Control Register
  454. Configures settings for 3-Wire Serial Audio Output Channel 0-3
  455. 31 24 23 16 15 8 7 0
  456. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  457. |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0|A|0 0 0 0|A|0|ASO|0 0 0|0|0|0|0|0| AO_3WCTRL
  458. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  459. */
  460. /*
  461. Data Bit Mode
  462. Specifies the number of data bits
  463. 0 - 16 bits
  464. 1 - reserved
  465. 2 - 20 bits
  466. 3 - 24 bits
  467. */
  468. #define PS3_AUDIO_AO_3WCTRL_ASODB_MASK (0x3 << 8) /* RWIVF */
  469. #define PS3_AUDIO_AO_3WCTRL_ASODB_16BIT (0x0 << 8) /* RWI-V */
  470. #define PS3_AUDIO_AO_3WCTRL_ASODB_RESVD (0x1 << 8) /* RWI-V */
  471. #define PS3_AUDIO_AO_3WCTRL_ASODB_20BIT (0x2 << 8) /* RW--V */
  472. #define PS3_AUDIO_AO_3WCTRL_ASODB_24BIT (0x3 << 8) /* RW--V */
  473. /*
  474. Data Format Mode
  475. Specifies the data format where (LSB side or MSB) the data(in 20 bit
  476. or 24 bit resolution mode) is put in a 32 bit field.
  477. 0 - Data put on LSB side
  478. 1 - Data put on MSB side
  479. */
  480. #define PS3_AUDIO_AO_3WCTRL_ASODF (1 << 11) /* RWIVF */
  481. #define PS3_AUDIO_AO_3WCTRL_ASODF_LSB (0 << 11) /* RWI-V */
  482. #define PS3_AUDIO_AO_3WCTRL_ASODF_MSB (1 << 11) /* RW--V */
  483. /*
  484. Buffer Reset
  485. Performs buffer reset. Writing 1 to this bit initializes the
  486. corresponding 3-Wire Audio Output buffers(both L and R).
  487. */
  488. #define PS3_AUDIO_AO_3WCTRL_ASOBRST (1 << 16) /* CWIVF */
  489. #define PS3_AUDIO_AO_3WCTRL_ASOBRST_IDLE (0 << 16) /* -WI-V */
  490. #define PS3_AUDIO_AO_3WCTRL_ASOBRST_RESET (1 << 16) /* -W--T */
  491. /*
  492. S/PDIF Audio Output Channel 0/1 Control Register
  493. Configures settings for S/PDIF Audio Output Channel 0/1.
  494. 31 24 23 16 15 8 7 0
  495. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  496. |S|0 0 0|S|0 0|S| SPOSR |0 0|SPO|0 0 0 0|S|0|SPO|0 0 0 0 0 0 0|S| AO_SPDCTRL
  497. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  498. */
  499. /*
  500. Buffer reset. Writing 1 to this bit initializes the
  501. corresponding S/PDIF output buffer pointer.
  502. */
  503. #define PS3_AUDIO_AO_SPDCTRL_SPOBRST (1 << 0) /* CWIVF */
  504. #define PS3_AUDIO_AO_SPDCTRL_SPOBRST_IDLE (0 << 0) /* -WI-V */
  505. #define PS3_AUDIO_AO_SPDCTRL_SPOBRST_RESET (1 << 0) /* -W--T */
  506. /*
  507. Data Bit Mode
  508. Specifies number of data bits
  509. 0 - 16 bits
  510. 1 - Reserved
  511. 2 - 20 bits
  512. 3 - 24 bits
  513. */
  514. #define PS3_AUDIO_AO_SPDCTRL_SPODB_MASK (0x3 << 8) /* RWIVF */
  515. #define PS3_AUDIO_AO_SPDCTRL_SPODB_16BIT (0x0 << 8) /* RWI-V */
  516. #define PS3_AUDIO_AO_SPDCTRL_SPODB_RESVD (0x1 << 8) /* RW--V */
  517. #define PS3_AUDIO_AO_SPDCTRL_SPODB_20BIT (0x2 << 8) /* RW--V */
  518. #define PS3_AUDIO_AO_SPDCTRL_SPODB_24BIT (0x3 << 8) /* RW--V */
  519. /*
  520. Data format Mode
  521. Specifies the data format, where (LSB side or MSB)
  522. the data(in 20 or 24 bit resolution) is put in the
  523. 32 bit field.
  524. 0 - LSB Side
  525. 1 - MSB Side
  526. */
  527. #define PS3_AUDIO_AO_SPDCTRL_SPODF (1 << 11) /* RWIVF */
  528. #define PS3_AUDIO_AO_SPDCTRL_SPODF_LSB (0 << 11) /* RWI-V */
  529. #define PS3_AUDIO_AO_SPDCTRL_SPODF_MSB (1 << 11) /* RW--V */
  530. /*
  531. Source Select
  532. Specifies the source of the S/PDIF output. When 0, output
  533. operation is controlled by 3wen[0] of AO_3WMCTRL register.
  534. The SR must have the same setting as the a0_3wmctrl reg.
  535. 0 - 3-Wire Audio OUT Ch0 Buffer
  536. 1 - S/PDIF buffer
  537. */
  538. #define PS3_AUDIO_AO_SPDCTRL_SPOSS_MASK (0x3 << 16) /* RWIVF */
  539. #define PS3_AUDIO_AO_SPDCTRL_SPOSS_3WEN (0x0 << 16) /* RWI-V */
  540. #define PS3_AUDIO_AO_SPDCTRL_SPOSS_SPDIF (0x1 << 16) /* RW--V */
  541. /*
  542. Sampling Rate
  543. Specifies the divide ratio of the bit clock (clock output
  544. from bclko) used by the S/PDIF Output Clock, which
  545. is applied to the master clock selected by mcksel.
  546. */
  547. #define PS3_AUDIO_AO_SPDCTRL_SPOSR (0xf << 20) /* RWIVF */
  548. #define PS3_AUDIO_AO_SPDCTRL_SPOSR_DIV2 (0x1 << 20) /* RWI-V */
  549. #define PS3_AUDIO_AO_SPDCTRL_SPOSR_DIV4 (0x2 << 20) /* RW--V */
  550. #define PS3_AUDIO_AO_SPDCTRL_SPOSR_DIV8 (0x4 << 20) /* RW--V */
  551. #define PS3_AUDIO_AO_SPDCTRL_SPOSR_DIV12 (0x6 << 20) /* RW--V */
  552. /*
  553. Master Clock Select
  554. 0 - Master Clock 0
  555. 1 - Master Clock 1
  556. */
  557. #define PS3_AUDIO_AO_SPDCTRL_SPOMCKSEL (1 << 24) /* RWIVF */
  558. #define PS3_AUDIO_AO_SPDCTRL_SPOMCKSEL_CLK0 (0 << 24) /* RWI-V */
  559. #define PS3_AUDIO_AO_SPDCTRL_SPOMCKSEL_CLK1 (1 << 24) /* RW--V */
  560. /*
  561. S/PDIF Output Channel Operational Status
  562. This bit becomes 1 after S/PDIF Output Channel is in
  563. action by setting 1 to spoen. This bit becomes 0
  564. after S/PDIF Output Channel is out of action by setting
  565. 0 to spoen.
  566. */
  567. #define PS3_AUDIO_AO_SPDCTRL_SPORUN (1 << 27) /* R-IVF */
  568. #define PS3_AUDIO_AO_SPDCTRL_SPORUN_STOPPED (0 << 27) /* R-I-V */
  569. #define PS3_AUDIO_AO_SPDCTRL_SPORUN_RUNNING (1 << 27) /* R---V */
  570. /*
  571. S/PDIF Audio Output Channel Output Enable
  572. Enables and disables output operation. This bit is used
  573. only when sposs = 1
  574. */
  575. #define PS3_AUDIO_AO_SPDCTRL_SPOEN (1 << 31) /* RWIVF */
  576. #define PS3_AUDIO_AO_SPDCTRL_SPOEN_DISABLED (0 << 31) /* RWI-V */
  577. #define PS3_AUDIO_AO_SPDCTRL_SPOEN_ENABLED (1 << 31) /* RW--V */
  578. /*
  579. S/PDIF Audio Output Channel Channel Status
  580. Setting Registers.
  581. Configures channel status bit settings for each block
  582. (192 bits).
  583. Output is performed from the MSB(AO_SPDCS0 register bit 31).
  584. The same value is added for subframes within the same frame.
  585. 31 24 23 16 15 8 7 0
  586. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  587. | SPOCS | AO_SPDCS
  588. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  589. S/PDIF Audio Output Channel User Bit Setting
  590. Configures user bit settings for each block (384 bits).
  591. Output is performed from the MSB(ao_spdub0 register bit 31).
  592. 31 24 23 16 15 8 7 0
  593. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  594. | SPOUB | AO_SPDUB
  595. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  596. */
  597. /*****************************************************************************
  598. *
  599. * DMAC register
  600. *
  601. *****************************************************************************/
  602. /*
  603. The PS3_AUDIO_KICK register is used to initiate a DMA transfer and monitor
  604. its status
  605. 31 24 23 16 15 8 7 0
  606. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  607. |0 0 0 0 0|STATU|0 0 0| EVENT |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0|R| KICK
  608. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  609. */
  610. /*
  611. The REQUEST field is written to ACTIVE to initiate a DMA request when EVENT
  612. occurs.
  613. It will return to the DONE state when the request is completed.
  614. The registers for a DMA channel should only be written if REQUEST is IDLE.
  615. */
  616. #define PS3_AUDIO_KICK_REQUEST (1 << 0) /* RWIVF */
  617. #define PS3_AUDIO_KICK_REQUEST_IDLE (0 << 0) /* RWI-V */
  618. #define PS3_AUDIO_KICK_REQUEST_ACTIVE (1 << 0) /* -W--T */
  619. /*
  620. *The EVENT field is used to set the event in which
  621. *the DMA request becomes active.
  622. */
  623. #define PS3_AUDIO_KICK_EVENT_MASK (0x1f << 16) /* RWIVF */
  624. #define PS3_AUDIO_KICK_EVENT_ALWAYS (0x00 << 16) /* RWI-V */
  625. #define PS3_AUDIO_KICK_EVENT_SERIALOUT0_EMPTY (0x01 << 16) /* RW--V */
  626. #define PS3_AUDIO_KICK_EVENT_SERIALOUT0_UNDERFLOW (0x02 << 16) /* RW--V */
  627. #define PS3_AUDIO_KICK_EVENT_SERIALOUT1_EMPTY (0x03 << 16) /* RW--V */
  628. #define PS3_AUDIO_KICK_EVENT_SERIALOUT1_UNDERFLOW (0x04 << 16) /* RW--V */
  629. #define PS3_AUDIO_KICK_EVENT_SERIALOUT2_EMPTY (0x05 << 16) /* RW--V */
  630. #define PS3_AUDIO_KICK_EVENT_SERIALOUT2_UNDERFLOW (0x06 << 16) /* RW--V */
  631. #define PS3_AUDIO_KICK_EVENT_SERIALOUT3_EMPTY (0x07 << 16) /* RW--V */
  632. #define PS3_AUDIO_KICK_EVENT_SERIALOUT3_UNDERFLOW (0x08 << 16) /* RW--V */
  633. #define PS3_AUDIO_KICK_EVENT_SPDIF0_BLOCKTRANSFERCOMPLETE \
  634. (0x09 << 16) /* RW--V */
  635. #define PS3_AUDIO_KICK_EVENT_SPDIF0_UNDERFLOW (0x0A << 16) /* RW--V */
  636. #define PS3_AUDIO_KICK_EVENT_SPDIF0_EMPTY (0x0B << 16) /* RW--V */
  637. #define PS3_AUDIO_KICK_EVENT_SPDIF1_BLOCKTRANSFERCOMPLETE \
  638. (0x0C << 16) /* RW--V */
  639. #define PS3_AUDIO_KICK_EVENT_SPDIF1_UNDERFLOW (0x0D << 16) /* RW--V */
  640. #define PS3_AUDIO_KICK_EVENT_SPDIF1_EMPTY (0x0E << 16) /* RW--V */
  641. #define PS3_AUDIO_KICK_EVENT_AUDIO_DMA(n) \
  642. ((0x13 + (n)) << 16) /* RW--V */
  643. #define PS3_AUDIO_KICK_EVENT_AUDIO_DMA0 (0x13 << 16) /* RW--V */
  644. #define PS3_AUDIO_KICK_EVENT_AUDIO_DMA1 (0x14 << 16) /* RW--V */
  645. #define PS3_AUDIO_KICK_EVENT_AUDIO_DMA2 (0x15 << 16) /* RW--V */
  646. #define PS3_AUDIO_KICK_EVENT_AUDIO_DMA3 (0x16 << 16) /* RW--V */
  647. #define PS3_AUDIO_KICK_EVENT_AUDIO_DMA4 (0x17 << 16) /* RW--V */
  648. #define PS3_AUDIO_KICK_EVENT_AUDIO_DMA5 (0x18 << 16) /* RW--V */
  649. #define PS3_AUDIO_KICK_EVENT_AUDIO_DMA6 (0x19 << 16) /* RW--V */
  650. #define PS3_AUDIO_KICK_EVENT_AUDIO_DMA7 (0x1A << 16) /* RW--V */
  651. #define PS3_AUDIO_KICK_EVENT_AUDIO_DMA8 (0x1B << 16) /* RW--V */
  652. #define PS3_AUDIO_KICK_EVENT_AUDIO_DMA9 (0x1C << 16) /* RW--V */
  653. /*
  654. The STATUS field can be used to monitor the progress of a DMA request.
  655. DONE indicates the previous request has completed.
  656. EVENT indicates that the DMA engine is waiting for the EVENT to occur.
  657. PENDING indicates that the DMA engine has not started processing this
  658. request, but the EVENT has occurred.
  659. DMA indicates that the data transfer is in progress.
  660. NOTIFY indicates that the notifier signalling end of transfer is being written.
  661. CLEAR indicated that the previous transfer was cleared.
  662. ERROR indicates the previous transfer requested an unsupported
  663. source/destination combination.
  664. */
  665. #define PS3_AUDIO_KICK_STATUS_MASK (0x7 << 24) /* R-IVF */
  666. #define PS3_AUDIO_KICK_STATUS_DONE (0x0 << 24) /* R-I-V */
  667. #define PS3_AUDIO_KICK_STATUS_EVENT (0x1 << 24) /* R---V */
  668. #define PS3_AUDIO_KICK_STATUS_PENDING (0x2 << 24) /* R---V */
  669. #define PS3_AUDIO_KICK_STATUS_DMA (0x3 << 24) /* R---V */
  670. #define PS3_AUDIO_KICK_STATUS_NOTIFY (0x4 << 24) /* R---V */
  671. #define PS3_AUDIO_KICK_STATUS_CLEAR (0x5 << 24) /* R---V */
  672. #define PS3_AUDIO_KICK_STATUS_ERROR (0x6 << 24) /* R---V */
  673. /*
  674. The PS3_AUDIO_SOURCE register specifies the source address for transfers.
  675. 31 24 23 16 15 8 7 0
  676. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  677. | START |0 0 0 0 0|TAR| SOURCE
  678. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  679. */
  680. /*
  681. The Audio DMA engine uses 128-byte transfers, thus the address must be aligned
  682. to a 128 byte boundary. The low seven bits are assumed to be 0.
  683. */
  684. #define PS3_AUDIO_SOURCE_START_MASK (0x01FFFFFF << 7) /* RWIUF */
  685. /*
  686. The TARGET field specifies the memory space containing the source address.
  687. */
  688. #define PS3_AUDIO_SOURCE_TARGET_MASK (3 << 0) /* RWIVF */
  689. #define PS3_AUDIO_SOURCE_TARGET_SYSTEM_MEMORY (2 << 0) /* RW--V */
  690. /*
  691. The PS3_AUDIO_DEST register specifies the destination address for transfers.
  692. 31 24 23 16 15 8 7 0
  693. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  694. | START |0 0 0 0 0|TAR| DEST
  695. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  696. */
  697. /*
  698. The Audio DMA engine uses 128-byte transfers, thus the address must be aligned
  699. to a 128 byte boundary. The low seven bits are assumed to be 0.
  700. */
  701. #define PS3_AUDIO_DEST_START_MASK (0x01FFFFFF << 7) /* RWIUF */
  702. /*
  703. The TARGET field specifies the memory space containing the destination address
  704. AUDIOFIFO = Audio WriteData FIFO,
  705. */
  706. #define PS3_AUDIO_DEST_TARGET_MASK (3 << 0) /* RWIVF */
  707. #define PS3_AUDIO_DEST_TARGET_AUDIOFIFO (1 << 0) /* RW--V */
  708. /*
  709. PS3_AUDIO_DMASIZE specifies the number of 128-byte blocks + 1 to transfer.
  710. So a value of 0 means 128-bytes will get transferred.
  711. 31 24 23 16 15 8 7 0
  712. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  713. |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0| BLOCKS | DMASIZE
  714. +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
  715. */
  716. #define PS3_AUDIO_DMASIZE_BLOCKS_MASK (0x7f << 0) /* RWIUF */
  717. /*
  718. * source/destination address for internal fifos
  719. */
  720. #define PS3_AUDIO_AO_3W_LDATA(n) (0x1000 + (0x100 * (n)))
  721. #define PS3_AUDIO_AO_3W_RDATA(n) (0x1080 + (0x100 * (n)))
  722. #define PS3_AUDIO_AO_SPD_DATA(n) (0x2000 + (0x400 * (n)))
  723. /*
  724. * field attiribute
  725. *
  726. * Read
  727. * ' ' = Other Information
  728. * '-' = Field is part of a write-only register
  729. * 'C' = Value read is always the same, constant value line follows (C)
  730. * 'R' = Value is read
  731. *
  732. * Write
  733. * ' ' = Other Information
  734. * '-' = Must not be written (D), value ignored when written (R,A,F)
  735. * 'W' = Can be written
  736. *
  737. * Internal State
  738. * ' ' = Other Information
  739. * '-' = No internal state
  740. * 'X' = Internal state, initial value is unknown
  741. * 'I' = Internal state, initial value is known and follows (I)
  742. *
  743. * Declaration/Size
  744. * ' ' = Other Information
  745. * '-' = Does Not Apply
  746. * 'V' = Type is void
  747. * 'U' = Type is unsigned integer
  748. * 'S' = Type is signed integer
  749. * 'F' = Type is IEEE floating point
  750. * '1' = Byte size (008)
  751. * '2' = Short size (016)
  752. * '3' = Three byte size (024)
  753. * '4' = Word size (032)
  754. * '8' = Double size (064)
  755. *
  756. * Define Indicator
  757. * ' ' = Other Information
  758. * 'D' = Device
  759. * 'M' = Memory
  760. * 'R' = Register
  761. * 'A' = Array of Registers
  762. * 'F' = Field
  763. * 'V' = Value
  764. * 'T' = Task
  765. */