cx23885-reg.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  1. /*
  2. * Driver for the Conexant CX23885 PCIe bridge
  3. *
  4. * Copyright (c) 2006 Steven Toth <stoth@linuxtv.org>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  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. *
  15. * GNU General Public License for more details.
  16. */
  17. #ifndef _CX23885_REG_H_
  18. #define _CX23885_REG_H_
  19. /*
  20. Address Map
  21. 0x00000000 -> 0x00009000 TX SRAM (Fifos)
  22. 0x00010000 -> 0x00013c00 RX SRAM CMDS + CDT
  23. EACH CMDS struct is 0x80 bytes long
  24. DMAx_PTR1 = 0x03040 address of first cluster
  25. DMAx_PTR2 = 0x10600 address of the CDT
  26. DMAx_CNT1 = cluster size in (bytes >> 4) -1
  27. DMAx_CNT2 = total cdt size for all entries >> 3
  28. Cluster Descriptor entry = 4 DWORDS
  29. DWORD 0 -> ptr to cluster
  30. DWORD 1 Reserved
  31. DWORD 2 Reserved
  32. DWORD 3 Reserved
  33. Channel manager Data Structure entry = 20 DWORD
  34. 0 IntialProgramCounterLow
  35. 1 IntialProgramCounterHigh
  36. 2 ClusterDescriptorTableBase
  37. 3 ClusterDescriptorTableSize
  38. 4 InstructionQueueBase
  39. 5 InstructionQueueSize
  40. ... Reserved
  41. 19 Reserved
  42. */
  43. /* Risc Instructions */
  44. #define RISC_CNT_INC 0x00010000
  45. #define RISC_CNT_RESET 0x00030000
  46. #define RISC_IRQ1 0x01000000
  47. #define RISC_IRQ2 0x02000000
  48. #define RISC_EOL 0x04000000
  49. #define RISC_SOL 0x08000000
  50. #define RISC_WRITE 0x10000000
  51. #define RISC_SKIP 0x20000000
  52. #define RISC_JUMP 0x70000000
  53. #define RISC_SYNC 0x80000000
  54. #define RISC_RESYNC 0x80008000
  55. #define RISC_READ 0x90000000
  56. #define RISC_WRITERM 0xB0000000
  57. #define RISC_WRITECM 0xC0000000
  58. #define RISC_WRITECR 0xD0000000
  59. #define RISC_WRITEC 0x50000000
  60. #define RISC_READC 0xA0000000
  61. /* Audio and Video Core */
  62. #define HOST_REG1 0x00000000
  63. #define HOST_REG2 0x00000001
  64. #define HOST_REG3 0x00000002
  65. /* Chip Configuration Registers */
  66. #define CHIP_CTRL 0x00000100
  67. #define AFE_CTRL 0x00000104
  68. #define VID_PLL_INT_POST 0x00000108
  69. #define VID_PLL_FRAC 0x0000010C
  70. #define AUX_PLL_INT_POST 0x00000110
  71. #define AUX_PLL_FRAC 0x00000114
  72. #define SYS_PLL_INT_POST 0x00000118
  73. #define SYS_PLL_FRAC 0x0000011C
  74. #define PIN_CTRL 0x00000120
  75. #define AUD_IO_CTRL 0x00000124
  76. #define AUD_LOCK1 0x00000128
  77. #define AUD_LOCK2 0x0000012C
  78. #define POWER_CTRL 0x00000130
  79. #define AFE_DIAG_CTRL1 0x00000134
  80. #define AFE_DIAG_CTRL3 0x0000013C
  81. #define PLL_DIAG_CTRL 0x00000140
  82. #define AFE_CLK_OUT_CTRL 0x00000144
  83. #define DLL1_DIAG_CTRL 0x0000015C
  84. /* GPIO[23:19] Output Enable */
  85. #define GPIO2_OUT_EN_REG 0x00000160
  86. /* GPIO[23:19] Data Registers */
  87. #define GPIO2 0x00000164
  88. #define IFADC_CTRL 0x00000180
  89. /* Infrared Remote Registers */
  90. #define IR_CNTRL_REG 0x00000200
  91. #define IR_TXCLK_REG 0x00000204
  92. #define IR_RXCLK_REG 0x00000208
  93. #define IR_CDUTY_REG 0x0000020C
  94. #define IR_STAT_REG 0x00000210
  95. #define IR_IRQEN_REG 0x00000214
  96. #define IR_FILTR_REG 0x00000218
  97. #define IR_FIFO_REG 0x0000023C
  98. /* Video Decoder Registers */
  99. #define MODE_CTRL 0x00000400
  100. #define OUT_CTRL1 0x00000404
  101. #define OUT_CTRL2 0x00000408
  102. #define GEN_STAT 0x0000040C
  103. #define INT_STAT_MASK 0x00000410
  104. #define LUMA_CTRL 0x00000414
  105. #define HSCALE_CTRL 0x00000418
  106. #define VSCALE_CTRL 0x0000041C
  107. #define CHROMA_CTRL 0x00000420
  108. #define VBI_LINE_CTRL1 0x00000424
  109. #define VBI_LINE_CTRL2 0x00000428
  110. #define VBI_LINE_CTRL3 0x0000042C
  111. #define VBI_LINE_CTRL4 0x00000430
  112. #define VBI_LINE_CTRL5 0x00000434
  113. #define VBI_FC_CFG 0x00000438
  114. #define VBI_MISC_CFG1 0x0000043C
  115. #define VBI_MISC_CFG2 0x00000440
  116. #define VBI_PAY1 0x00000444
  117. #define VBI_PAY2 0x00000448
  118. #define VBI_CUST1_CFG1 0x0000044C
  119. #define VBI_CUST1_CFG2 0x00000450
  120. #define VBI_CUST1_CFG3 0x00000454
  121. #define VBI_CUST2_CFG1 0x00000458
  122. #define VBI_CUST2_CFG2 0x0000045C
  123. #define VBI_CUST2_CFG3 0x00000460
  124. #define VBI_CUST3_CFG1 0x00000464
  125. #define VBI_CUST3_CFG2 0x00000468
  126. #define VBI_CUST3_CFG3 0x0000046C
  127. #define HORIZ_TIM_CTRL 0x00000470
  128. #define VERT_TIM_CTRL 0x00000474
  129. #define SRC_COMB_CFG 0x00000478
  130. #define CHROMA_VBIOFF_CFG 0x0000047C
  131. #define FIELD_COUNT 0x00000480
  132. #define MISC_TIM_CTRL 0x00000484
  133. #define DFE_CTRL1 0x00000488
  134. #define DFE_CTRL2 0x0000048C
  135. #define DFE_CTRL3 0x00000490
  136. #define PLL_CTRL 0x00000494
  137. #define HTL_CTRL 0x00000498
  138. #define COMB_CTRL 0x0000049C
  139. #define CRUSH_CTRL 0x000004A0
  140. #define SOFT_RST_CTRL 0x000004A4
  141. #define CX885_VERSION 0x000004B4
  142. #define VBI_PASS_CTRL 0x000004BC
  143. /* Audio Decoder Registers */
  144. /* 8051 Configuration */
  145. #define DL_CTL 0x00000800
  146. #define STD_DET_STATUS 0x00000804
  147. #define STD_DET_CTL 0x00000808
  148. #define DW8051_INT 0x0000080C
  149. #define GENERAL_CTL 0x00000810
  150. #define AAGC_CTL 0x00000814
  151. #define DEMATRIX_CTL 0x000008CC
  152. #define PATH1_CTL1 0x000008D0
  153. #define PATH1_VOL_CTL 0x000008D4
  154. #define PATH1_EQ_CTL 0x000008D8
  155. #define PATH1_SC_CTL 0x000008DC
  156. #define PATH2_CTL1 0x000008E0
  157. #define PATH2_VOL_CTL 0x000008E4
  158. #define PATH2_EQ_CTL 0x000008E8
  159. #define PATH2_SC_CTL 0x000008EC
  160. /* Sample Rate Converter */
  161. #define SRC_CTL 0x000008F0
  162. #define SRC_LF_COEF 0x000008F4
  163. #define SRC1_CTL 0x000008F8
  164. #define SRC2_CTL 0x000008FC
  165. #define SRC3_CTL 0x00000900
  166. #define SRC4_CTL 0x00000904
  167. #define SRC5_CTL 0x00000908
  168. #define SRC6_CTL 0x0000090C
  169. #define BAND_OUT_SEL 0x00000910
  170. #define I2S_N_CTL 0x00000914
  171. #define I2S_OUT_CTL 0x00000918
  172. #define AUTOCONFIG_REG 0x000009C4
  173. /* Audio ADC Registers */
  174. #define DSM_CTRL1 0x00000000
  175. #define DSM_CTRL2 0x00000001
  176. #define CHP_EN_CTRL 0x00000002
  177. #define CHP_CLK_CTRL1 0x00000004
  178. #define CHP_CLK_CTRL2 0x00000005
  179. #define BG_REF_CTRL 0x00000006
  180. #define SD2_SW_CTRL1 0x00000008
  181. #define SD2_SW_CTRL2 0x00000009
  182. #define SD2_BIAS_CTRL 0x0000000A
  183. #define AMP_BIAS_CTRL 0x0000000C
  184. #define CH_PWR_CTRL1 0x0000000E
  185. #define FLD_CH_SEL (1 << 3)
  186. #define CH_PWR_CTRL2 0x0000000F
  187. #define DSM_STATUS1 0x00000010
  188. #define DSM_STATUS2 0x00000011
  189. #define DIG_CTL1 0x00000012
  190. #define DIG_CTL2 0x00000013
  191. #define I2S_TX_CFG 0x0000001A
  192. #define DEV_CNTRL2 0x00040000
  193. #define PCI_MSK_IR (1 << 28)
  194. #define PCI_MSK_AV_CORE (1 << 27)
  195. #define PCI_MSK_GPIO1 (1 << 24)
  196. #define PCI_MSK_GPIO0 (1 << 23)
  197. #define PCI_MSK_APB_DMA (1 << 12)
  198. #define PCI_MSK_AL_WR (1 << 11)
  199. #define PCI_MSK_AL_RD (1 << 10)
  200. #define PCI_MSK_RISC_WR (1 << 9)
  201. #define PCI_MSK_RISC_RD (1 << 8)
  202. #define PCI_MSK_AUD_EXT (1 << 4)
  203. #define PCI_MSK_AUD_INT (1 << 3)
  204. #define PCI_MSK_VID_C (1 << 2)
  205. #define PCI_MSK_VID_B (1 << 1)
  206. #define PCI_MSK_VID_A 1
  207. #define PCI_INT_MSK 0x00040010
  208. #define PCI_INT_STAT 0x00040014
  209. #define PCI_INT_MSTAT 0x00040018
  210. #define VID_A_INT_MSK 0x00040020
  211. #define VID_A_INT_STAT 0x00040024
  212. #define VID_A_INT_MSTAT 0x00040028
  213. #define VID_A_INT_SSTAT 0x0004002C
  214. #define VID_B_INT_MSK 0x00040030
  215. #define VID_B_MSK_BAD_PKT (1 << 20)
  216. #define VID_B_MSK_VBI_OPC_ERR (1 << 17)
  217. #define VID_B_MSK_OPC_ERR (1 << 16)
  218. #define VID_B_MSK_VBI_SYNC (1 << 13)
  219. #define VID_B_MSK_SYNC (1 << 12)
  220. #define VID_B_MSK_VBI_OF (1 << 9)
  221. #define VID_B_MSK_OF (1 << 8)
  222. #define VID_B_MSK_VBI_RISCI2 (1 << 5)
  223. #define VID_B_MSK_RISCI2 (1 << 4)
  224. #define VID_B_MSK_VBI_RISCI1 (1 << 1)
  225. #define VID_B_MSK_RISCI1 1
  226. #define VID_B_INT_STAT 0x00040034
  227. #define VID_B_INT_MSTAT 0x00040038
  228. #define VID_B_INT_SSTAT 0x0004003C
  229. #define VID_B_MSK_BAD_PKT (1 << 20)
  230. #define VID_B_MSK_OPC_ERR (1 << 16)
  231. #define VID_B_MSK_SYNC (1 << 12)
  232. #define VID_B_MSK_OF (1 << 8)
  233. #define VID_B_MSK_RISCI2 (1 << 4)
  234. #define VID_B_MSK_RISCI1 1
  235. #define VID_C_MSK_BAD_PKT (1 << 20)
  236. #define VID_C_MSK_OPC_ERR (1 << 16)
  237. #define VID_C_MSK_SYNC (1 << 12)
  238. #define VID_C_MSK_OF (1 << 8)
  239. #define VID_C_MSK_RISCI2 (1 << 4)
  240. #define VID_C_MSK_RISCI1 1
  241. /* A superset for testing purposes */
  242. #define VID_BC_MSK_BAD_PKT (1 << 20)
  243. #define VID_BC_MSK_OPC_ERR (1 << 16)
  244. #define VID_BC_MSK_SYNC (1 << 12)
  245. #define VID_BC_MSK_OF (1 << 8)
  246. #define VID_BC_MSK_VBI_RISCI2 (1 << 5)
  247. #define VID_BC_MSK_RISCI2 (1 << 4)
  248. #define VID_BC_MSK_VBI_RISCI1 (1 << 1)
  249. #define VID_BC_MSK_RISCI1 1
  250. #define VID_C_INT_MSK 0x00040040
  251. #define VID_C_INT_STAT 0x00040044
  252. #define VID_C_INT_MSTAT 0x00040048
  253. #define VID_C_INT_SSTAT 0x0004004C
  254. #define AUDIO_INT_INT_MSK 0x00040050
  255. #define AUDIO_INT_INT_STAT 0x00040054
  256. #define AUDIO_INT_INT_MSTAT 0x00040058
  257. #define AUDIO_INT_INT_SSTAT 0x0004005C
  258. #define AUDIO_EXT_INT_MSK 0x00040060
  259. #define AUDIO_EXT_INT_STAT 0x00040064
  260. #define AUDIO_EXT_INT_MSTAT 0x00040068
  261. #define AUDIO_EXT_INT_SSTAT 0x0004006C
  262. /* Bits [7:0] set in both TC_REQ and TC_REQ_SET
  263. * indicate a stall in the RISC engine for a
  264. * particular rider traffic class. This causes
  265. * the 885 and 888 bridges (unknown about 887)
  266. * to become inoperable. Setting bits in
  267. * TC_REQ_SET resets the corresponding bits
  268. * in TC_REQ (and TC_REQ_SET) allowing
  269. * operation to continue.
  270. */
  271. #define TC_REQ 0x00040090
  272. #define TC_REQ_SET 0x00040094
  273. #define RDR_CFG0 0x00050000
  274. #define RDR_CFG1 0x00050004
  275. #define RDR_CFG2 0x00050008
  276. #define RDR_RDRCTL1 0x0005030c
  277. #define RDR_TLCTL0 0x00050318
  278. /* APB DMAC Current Buffer Pointer */
  279. #define DMA1_PTR1 0x00100000
  280. #define DMA2_PTR1 0x00100004
  281. #define DMA3_PTR1 0x00100008
  282. #define DMA4_PTR1 0x0010000C
  283. #define DMA5_PTR1 0x00100010
  284. #define DMA6_PTR1 0x00100014
  285. #define DMA7_PTR1 0x00100018
  286. #define DMA8_PTR1 0x0010001C
  287. /* APB DMAC Current Table Pointer */
  288. #define DMA1_PTR2 0x00100040
  289. #define DMA2_PTR2 0x00100044
  290. #define DMA3_PTR2 0x00100048
  291. #define DMA4_PTR2 0x0010004C
  292. #define DMA5_PTR2 0x00100050
  293. #define DMA6_PTR2 0x00100054
  294. #define DMA7_PTR2 0x00100058
  295. #define DMA8_PTR2 0x0010005C
  296. /* APB DMAC Buffer Limit */
  297. #define DMA1_CNT1 0x00100080
  298. #define DMA2_CNT1 0x00100084
  299. #define DMA3_CNT1 0x00100088
  300. #define DMA4_CNT1 0x0010008C
  301. #define DMA5_CNT1 0x00100090
  302. #define DMA6_CNT1 0x00100094
  303. #define DMA7_CNT1 0x00100098
  304. #define DMA8_CNT1 0x0010009C
  305. /* APB DMAC Table Size */
  306. #define DMA1_CNT2 0x001000C0
  307. #define DMA2_CNT2 0x001000C4
  308. #define DMA3_CNT2 0x001000C8
  309. #define DMA4_CNT2 0x001000CC
  310. #define DMA5_CNT2 0x001000D0
  311. #define DMA6_CNT2 0x001000D4
  312. #define DMA7_CNT2 0x001000D8
  313. #define DMA8_CNT2 0x001000DC
  314. /* Timer Counters */
  315. #define TM_CNT_LDW 0x00110000
  316. #define TM_CNT_UW 0x00110004
  317. #define TM_LMT_LDW 0x00110008
  318. #define TM_LMT_UW 0x0011000C
  319. /* GPIO */
  320. #define GP0_IO 0x00110010
  321. #define GPIO_ISM 0x00110014
  322. #define SOFT_RESET 0x0011001C
  323. /* GPIO (417 Microsoftcontroller) RW Data */
  324. #define MC417_RWD 0x00110020
  325. /* GPIO (417 Microsoftcontroller) Output Enable, Low Active */
  326. #define MC417_OEN 0x00110024
  327. #define MC417_CTL 0x00110028
  328. #define ALT_PIN_OUT_SEL 0x0011002C
  329. #define CLK_DELAY 0x00110048
  330. #define PAD_CTRL 0x0011004C
  331. /* Video A Interface */
  332. #define VID_A_GPCNT 0x00130020
  333. #define VBI_A_GPCNT 0x00130024
  334. #define VID_A_GPCNT_CTL 0x00130030
  335. #define VBI_A_GPCNT_CTL 0x00130034
  336. #define VID_A_DMA_CTL 0x00130040
  337. #define VID_A_VIP_CTRL 0x00130080
  338. #define VID_A_PIXEL_FRMT 0x00130084
  339. #define VID_A_VBI_CTRL 0x00130088
  340. /* Video B Interface */
  341. #define VID_B_DMA 0x00130100
  342. #define VBI_B_DMA 0x00130108
  343. #define VID_B_GPCNT 0x00130120
  344. #define VBI_B_GPCNT 0x00130124
  345. #define VID_B_GPCNT_CTL 0x00130134
  346. #define VBI_B_GPCNT_CTL 0x00130138
  347. #define VID_B_DMA_CTL 0x00130140
  348. #define VID_B_SRC_SEL 0x00130144
  349. #define VID_B_LNGTH 0x00130150
  350. #define VID_B_HW_SOP_CTL 0x00130154
  351. #define VID_B_GEN_CTL 0x00130158
  352. #define VID_B_BD_PKT_STATUS 0x0013015C
  353. #define VID_B_SOP_STATUS 0x00130160
  354. #define VID_B_FIFO_OVFL_STAT 0x00130164
  355. #define VID_B_VLD_MISC 0x00130168
  356. #define VID_B_TS_CLK_EN 0x0013016C
  357. #define VID_B_VIP_CTRL 0x00130180
  358. #define VID_B_PIXEL_FRMT 0x00130184
  359. /* Video C Interface */
  360. #define VID_C_DMA 0x00130200
  361. #define VBI_C_DMA 0x00130208
  362. #define VID_C_GPCNT 0x00130220
  363. #define VID_C_GPCNT_CTL 0x00130230
  364. #define VBI_C_GPCNT_CTL 0x00130234
  365. #define VID_C_DMA_CTL 0x00130240
  366. #define VID_C_LNGTH 0x00130250
  367. #define VID_C_HW_SOP_CTL 0x00130254
  368. #define VID_C_GEN_CTL 0x00130258
  369. #define VID_C_BD_PKT_STATUS 0x0013025C
  370. #define VID_C_SOP_STATUS 0x00130260
  371. #define VID_C_FIFO_OVFL_STAT 0x00130264
  372. #define VID_C_VLD_MISC 0x00130268
  373. #define VID_C_TS_CLK_EN 0x0013026C
  374. /* Internal Audio Interface */
  375. #define AUD_INT_A_GPCNT 0x00140020
  376. #define AUD_INT_B_GPCNT 0x00140024
  377. #define AUD_INT_A_GPCNT_CTL 0x00140030
  378. #define AUD_INT_B_GPCNT_CTL 0x00140034
  379. #define AUD_INT_DMA_CTL 0x00140040
  380. #define AUD_INT_A_LNGTH 0x00140050
  381. #define AUD_INT_B_LNGTH 0x00140054
  382. #define AUD_INT_A_MODE 0x00140058
  383. #define AUD_INT_B_MODE 0x0014005C
  384. /* External Audio Interface */
  385. #define AUD_EXT_DMA 0x00140100
  386. #define AUD_EXT_GPCNT 0x00140120
  387. #define AUD_EXT_GPCNT_CTL 0x00140130
  388. #define AUD_EXT_DMA_CTL 0x00140140
  389. #define AUD_EXT_LNGTH 0x00140150
  390. #define AUD_EXT_A_MODE 0x00140158
  391. /* I2C Bus 1 */
  392. #define I2C1_ADDR 0x00180000
  393. #define I2C1_WDATA 0x00180004
  394. #define I2C1_CTRL 0x00180008
  395. #define I2C1_RDATA 0x0018000C
  396. #define I2C1_STAT 0x00180010
  397. /* I2C Bus 2 */
  398. #define I2C2_ADDR 0x00190000
  399. #define I2C2_WDATA 0x00190004
  400. #define I2C2_CTRL 0x00190008
  401. #define I2C2_RDATA 0x0019000C
  402. #define I2C2_STAT 0x00190010
  403. /* I2C Bus 3 */
  404. #define I2C3_ADDR 0x001A0000
  405. #define I2C3_WDATA 0x001A0004
  406. #define I2C3_CTRL 0x001A0008
  407. #define I2C3_RDATA 0x001A000C
  408. #define I2C3_STAT 0x001A0010
  409. /* UART */
  410. #define UART_CTL 0x001B0000
  411. #define UART_BRD 0x001B0004
  412. #define UART_ISR 0x001B000C
  413. #define UART_CNT 0x001B0010
  414. #endif /* _CX23885_REG_H_ */