mb93493-regs.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. /* mb93493-regs.h: MB93493 companion chip registers
  2. *
  3. * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the License, or (at your option) any later version.
  10. */
  11. #ifndef _ASM_MB93493_REGS_H
  12. #define _ASM_MB93493_REGS_H
  13. #include <asm/mb-regs.h>
  14. #include <asm/mb93493-irqs.h>
  15. #define __addr_MB93493(X) ((volatile unsigned long *)(__region_CS3 + (X)))
  16. #define __get_MB93493(X) ({ *(volatile unsigned long *)(__region_CS3 + (X)); })
  17. #define __set_MB93493(X,V) \
  18. do { \
  19. *(volatile unsigned long *)(__region_CS3 + (X)) = (V); mb(); \
  20. } while(0)
  21. #define __get_MB93493_STSR(X) __get_MB93493(0x3c0 + (X) * 4)
  22. #define __set_MB93493_STSR(X,V) __set_MB93493(0x3c0 + (X) * 4, (V))
  23. #define MB93493_STSR_EN
  24. #define __addr_MB93493_IQSR(X) __addr_MB93493(0x3d0 + (X) * 4)
  25. #define __get_MB93493_IQSR(X) __get_MB93493(0x3d0 + (X) * 4)
  26. #define __set_MB93493_IQSR(X,V) __set_MB93493(0x3d0 + (X) * 4, (V))
  27. #define __get_MB93493_DQSR(X) __get_MB93493(0x3e0 + (X) * 4)
  28. #define __set_MB93493_DQSR(X,V) __set_MB93493(0x3e0 + (X) * 4, (V))
  29. #define __get_MB93493_LBSER() __get_MB93493(0x3f0)
  30. #define __set_MB93493_LBSER(V) __set_MB93493(0x3f0, (V))
  31. #define MB93493_LBSER_VDC 0x00010000
  32. #define MB93493_LBSER_VCC 0x00020000
  33. #define MB93493_LBSER_AUDIO 0x00040000
  34. #define MB93493_LBSER_I2C_0 0x00080000
  35. #define MB93493_LBSER_I2C_1 0x00100000
  36. #define MB93493_LBSER_USB 0x00200000
  37. #define MB93493_LBSER_GPIO 0x00800000
  38. #define MB93493_LBSER_PCMCIA 0x01000000
  39. #define __get_MB93493_LBSR() __get_MB93493(0x3fc)
  40. #define __set_MB93493_LBSR(V) __set_MB93493(0x3fc, (V))
  41. /*
  42. * video display controller
  43. */
  44. #define __get_MB93493_VDC(X) __get_MB93493(MB93493_VDC_##X)
  45. #define __set_MB93493_VDC(X,V) __set_MB93493(MB93493_VDC_##X, (V))
  46. #define MB93493_VDC_RCURSOR 0x140 /* cursor position */
  47. #define MB93493_VDC_RCT1 0x144 /* cursor colour 1 */
  48. #define MB93493_VDC_RCT2 0x148 /* cursor colour 2 */
  49. #define MB93493_VDC_RHDC 0x150 /* horizontal display period */
  50. #define MB93493_VDC_RH_MARGINS 0x154 /* horizontal margin sizes */
  51. #define MB93493_VDC_RVDC 0x158 /* vertical display period */
  52. #define MB93493_VDC_RV_MARGINS 0x15c /* vertical margin sizes */
  53. #define MB93493_VDC_RC 0x170 /* VDC control */
  54. #define MB93493_VDC_RCLOCK 0x174 /* clock divider, DMA req delay */
  55. #define MB93493_VDC_RBLACK 0x178 /* black insert sizes */
  56. #define MB93493_VDC_RS 0x17c /* VDC status */
  57. #define __addr_MB93493_VDC_BCI(X) ({ (volatile unsigned long *)(__region_CS3 + 0x000 + (X)); })
  58. #define __addr_MB93493_VDC_TPO(X) (__region_CS3 + 0x1c0 + (X))
  59. #define VDC_TPO_WIDTH 32
  60. #define VDC_RC_DSR 0x00000080 /* VDC master reset */
  61. #define VDC_RS_IT 0x00060000 /* interrupt indicators */
  62. #define VDC_RS_IT_UNDERFLOW 0x00040000 /* - underflow event */
  63. #define VDC_RS_IT_VSYNC 0x00020000 /* - VSYNC event */
  64. #define VDC_RS_DFI 0x00010000 /* current interlace field number */
  65. #define VDC_RS_DFI_TOP 0x00000000 /* - top field */
  66. #define VDC_RS_DFI_BOTTOM 0x00010000 /* - bottom field */
  67. #define VDC_RS_DCSR 0x00000010 /* cursor state */
  68. #define VDC_RS_DCM 0x00000003 /* display mode */
  69. #define VDC_RS_DCM_DISABLED 0x00000000 /* - display disabled */
  70. #define VDC_RS_DCM_STOPPED 0x00000001 /* - VDC stopped */
  71. #define VDC_RS_DCM_FREERUNNING 0x00000002 /* - VDC free-running */
  72. #define VDC_RS_DCM_TRANSFERRING 0x00000003 /* - data being transferred to VDC */
  73. /*
  74. * video capture controller
  75. */
  76. #define __get_MB93493_VCC(X) __get_MB93493(MB93493_VCC_##X)
  77. #define __set_MB93493_VCC(X,V) __set_MB93493(MB93493_VCC_##X, (V))
  78. #define MB93493_VCC_RREDUCT 0x104 /* reduction rate */
  79. #define MB93493_VCC_RHY 0x108 /* horizontal brightness filter coefficients */
  80. #define MB93493_VCC_RHC 0x10c /* horizontal colour-difference filter coefficients */
  81. #define MB93493_VCC_RHSIZE 0x110 /* horizontal cycle sizes */
  82. #define MB93493_VCC_RHBC 0x114 /* horizontal back porch size */
  83. #define MB93493_VCC_RVCC 0x118 /* vertical capture period */
  84. #define MB93493_VCC_RVBC 0x11c /* vertical back porch period */
  85. #define MB93493_VCC_RV 0x120 /* vertical filter coefficients */
  86. #define MB93493_VCC_RDTS 0x128 /* DMA transfer size */
  87. #define MB93493_VCC_RDTS_4B 0x01000000 /* 4-byte transfer */
  88. #define MB93493_VCC_RDTS_32B 0x03000000 /* 32-byte transfer */
  89. #define MB93493_VCC_RDTS_SHIFT 24
  90. #define MB93493_VCC_RCC 0x130 /* VCC control */
  91. #define MB93493_VCC_RIS 0x134 /* VCC interrupt status */
  92. #define __addr_MB93493_VCC_TPI(X) (__region_CS3 + 0x180 + (X))
  93. #define VCC_RHSIZE_RHCC 0x000007ff
  94. #define VCC_RHSIZE_RHCC_SHIFT 0
  95. #define VCC_RHSIZE_RHTCC 0x0fff0000
  96. #define VCC_RHSIZE_RHTCC_SHIFT 16
  97. #define VCC_RVBC_RVBC 0x00003f00
  98. #define VCC_RVBC_RVBC_SHIFT 8
  99. #define VCC_RREDUCT_RHR 0x07ff0000
  100. #define VCC_RREDUCT_RHR_SHIFT 16
  101. #define VCC_RREDUCT_RVR 0x000007ff
  102. #define VCC_RREDUCT_RVR_SHIFT 0
  103. #define VCC_RCC_CE 0x00000001 /* VCC enable */
  104. #define VCC_RCC_CS 0x00000002 /* request video capture start */
  105. #define VCC_RCC_CPF 0x0000000c /* pixel format */
  106. #define VCC_RCC_CPF_YCBCR_16 0x00000000 /* - YCbCr 4:2:2 16-bit format */
  107. #define VCC_RCC_CPF_RGB 0x00000004 /* - RGB 4:4:4 format */
  108. #define VCC_RCC_CPF_YCBCR_24 0x00000008 /* - YCbCr 4:2:2 24-bit format */
  109. #define VCC_RCC_CPF_BT656 0x0000000c /* - ITU R-BT.656 format */
  110. #define VCC_RCC_CPF_SHIFT 2
  111. #define VCC_RCC_CSR 0x00000080 /* request reset */
  112. #define VCC_RCC_HSIP 0x00000100 /* HSYNC polarity */
  113. #define VCC_RCC_HSIP_LOACT 0x00000000 /* - low active */
  114. #define VCC_RCC_HSIP_HIACT 0x00000100 /* - high active */
  115. #define VCC_RCC_VSIP 0x00000200 /* VSYNC polarity */
  116. #define VCC_RCC_VSIP_LOACT 0x00000000 /* - low active */
  117. #define VCC_RCC_VSIP_HIACT 0x00000200 /* - high active */
  118. #define VCC_RCC_CIE 0x00000800 /* interrupt enable */
  119. #define VCC_RCC_CFP 0x00001000 /* RGB pixel packing */
  120. #define VCC_RCC_CFP_4TO3 0x00000000 /* - pack 4 pixels into 3 words */
  121. #define VCC_RCC_CFP_1TO1 0x00001000 /* - pack 1 pixel into 1 words */
  122. #define VCC_RCC_CSM 0x00006000 /* interlace specification */
  123. #define VCC_RCC_CSM_ONEPASS 0x00002000 /* - non-interlaced */
  124. #define VCC_RCC_CSM_INTERLACE 0x00004000 /* - interlaced */
  125. #define VCC_RCC_CSM_SHIFT 13
  126. #define VCC_RCC_ES 0x00008000 /* capture start polarity */
  127. #define VCC_RCC_ES_NEG 0x00000000 /* - negative edge */
  128. #define VCC_RCC_ES_POS 0x00008000 /* - positive edge */
  129. #define VCC_RCC_IFI 0x00080000 /* inferlace field evaluation reverse */
  130. #define VCC_RCC_FDTS 0x00300000 /* interlace field start */
  131. #define VCC_RCC_FDTS_3_8 0x00000000 /* - 3/8 of horizontal entire cycle */
  132. #define VCC_RCC_FDTS_1_4 0x00100000 /* - 1/4 of horizontal entire cycle */
  133. #define VCC_RCC_FDTS_7_16 0x00200000 /* - 7/16 of horizontal entire cycle */
  134. #define VCC_RCC_FDTS_SHIFT 20
  135. #define VCC_RCC_MOV 0x00400000 /* test bit - always set to 1 */
  136. #define VCC_RCC_STP 0x00800000 /* request video capture stop */
  137. #define VCC_RCC_TO 0x01000000 /* input during top-field only */
  138. #define VCC_RIS_VSYNC 0x01000000 /* VSYNC interrupt */
  139. #define VCC_RIS_OV 0x02000000 /* overflow interrupt */
  140. #define VCC_RIS_BOTTOM 0x08000000 /* interlace bottom field */
  141. #define VCC_RIS_STARTED 0x10000000 /* capture started */
  142. /*
  143. * I2C
  144. */
  145. #define MB93493_I2C_BSR 0x340 /* bus status */
  146. #define MB93493_I2C_BCR 0x344 /* bus control */
  147. #define MB93493_I2C_CCR 0x348 /* clock control */
  148. #define MB93493_I2C_ADR 0x34c /* address */
  149. #define MB93493_I2C_DTR 0x350 /* data */
  150. #define MB93493_I2C_BC2R 0x35c /* bus control 2 */
  151. #define __addr_MB93493_I2C(port,X) (__region_CS3 + MB93493_I2C_##X + ((port)*0x20))
  152. #define __get_MB93493_I2C(port,X) __get_MB93493(MB93493_I2C_##X + ((port)*0x20))
  153. #define __set_MB93493_I2C(port,X,V) __set_MB93493(MB93493_I2C_##X + ((port)*0x20), (V))
  154. #define I2C_BSR_BB (1 << 7)
  155. /*
  156. * audio controller (I2S) registers
  157. */
  158. #define __get_MB93493_I2S(X) __get_MB93493(MB93493_I2S_##X)
  159. #define __set_MB93493_I2S(X,V) __set_MB93493(MB93493_I2S_##X, (V))
  160. #define MB93493_I2S_ALDR 0x300 /* L-channel data */
  161. #define MB93493_I2S_ARDR 0x304 /* R-channel data */
  162. #define MB93493_I2S_APDR 0x308 /* 16-bit packed data */
  163. #define MB93493_I2S_AISTR 0x310 /* status */
  164. #define MB93493_I2S_AICR 0x314 /* control */
  165. #define __addr_MB93493_I2S_ALDR(X) (__region_CS3 + MB93493_I2S_ALDR + (X))
  166. #define __addr_MB93493_I2S_ARDR(X) (__region_CS3 + MB93493_I2S_ARDR + (X))
  167. #define __addr_MB93493_I2S_APDR(X) (__region_CS3 + MB93493_I2S_APDR + (X))
  168. #define __addr_MB93493_I2S_ADR(X) (__region_CS3 + 0x320 + (X))
  169. #define I2S_AISTR_OTST 0x00000003 /* status of output data transfer */
  170. #define I2S_AISTR_OTR 0x00000010 /* output transfer request pending */
  171. #define I2S_AISTR_OUR 0x00000020 /* output FIFO underrun detected */
  172. #define I2S_AISTR_OOR 0x00000040 /* output FIFO overrun detected */
  173. #define I2S_AISTR_ODS 0x00000100 /* output DMA transfer size */
  174. #define I2S_AISTR_ODE 0x00000400 /* output DMA transfer request enable */
  175. #define I2S_AISTR_OTRIE 0x00001000 /* output transfer request interrupt enable */
  176. #define I2S_AISTR_OURIE 0x00002000 /* output FIFO underrun interrupt enable */
  177. #define I2S_AISTR_OORIE 0x00004000 /* output FIFO overrun interrupt enable */
  178. #define I2S_AISTR__OUT_MASK 0x00007570
  179. #define I2S_AISTR_ITST 0x00030000 /* status of input data transfer */
  180. #define I2S_AISTR_ITST_SHIFT 16
  181. #define I2S_AISTR_ITR 0x00100000 /* input transfer request pending */
  182. #define I2S_AISTR_IUR 0x00200000 /* input FIFO underrun detected */
  183. #define I2S_AISTR_IOR 0x00400000 /* input FIFO overrun detected */
  184. #define I2S_AISTR_IDS 0x01000000 /* input DMA transfer size */
  185. #define I2S_AISTR_IDE 0x04000000 /* input DMA transfer request enable */
  186. #define I2S_AISTR_ITRIE 0x10000000 /* input transfer request interrupt enable */
  187. #define I2S_AISTR_IURIE 0x20000000 /* input FIFO underrun interrupt enable */
  188. #define I2S_AISTR_IORIE 0x40000000 /* input FIFO overrun interrupt enable */
  189. #define I2S_AISTR__IN_MASK 0x75700000
  190. #define I2S_AICR_MI 0x00000001 /* mono input requested */
  191. #define I2S_AICR_AMI 0x00000002 /* relation between LRCKI/FS1 and SDI */
  192. #define I2S_AICR_LRI 0x00000004 /* function of LRCKI pin */
  193. #define I2S_AICR_SDMI 0x00000070 /* format of input audio data */
  194. #define I2S_AICR_SDMI_SHIFT 4
  195. #define I2S_AICR_CLI 0x00000080 /* input FIFO clearing control */
  196. #define I2S_AICR_IM 0x00000300 /* input state control */
  197. #define I2S_AICR_IM_SHIFT 8
  198. #define I2S_AICR__IN_MASK 0x000003f7
  199. #define I2S_AICR_MO 0x00001000 /* mono output requested */
  200. #define I2S_AICR_AMO 0x00002000 /* relation between LRCKO/FS0 and SDO */
  201. #define I2S_AICR_AMO_SHIFT 13
  202. #define I2S_AICR_LRO 0x00004000 /* function of LRCKO pin */
  203. #define I2S_AICR_SDMO 0x00070000 /* format of output audio data */
  204. #define I2S_AICR_SDMO_SHIFT 16
  205. #define I2S_AICR_CLO 0x00080000 /* output FIFO clearing control */
  206. #define I2S_AICR_OM 0x00100000 /* output state control */
  207. #define I2S_AICR__OUT_MASK 0x001f7000
  208. #define I2S_AICR_DIV 0x03000000 /* frequency division rate */
  209. #define I2S_AICR_DIV_SHIFT 24
  210. #define I2S_AICR_FL 0x20000000 /* frame length */
  211. #define I2S_AICR_FS 0x40000000 /* frame sync method */
  212. #define I2S_AICR_ME 0x80000000 /* master enable */
  213. /*
  214. * PCMCIA
  215. */
  216. #define __addr_MB93493_PCMCIA(X) ((volatile unsigned long *)(__region_CS5 + (X)))
  217. /*
  218. * GPIO
  219. */
  220. #define __get_MB93493_GPIO_PDR(X) __get_MB93493(0x380 + (X) * 0xc0)
  221. #define __set_MB93493_GPIO_PDR(X,V) __set_MB93493(0x380 + (X) * 0xc0, (V))
  222. #define __get_MB93493_GPIO_GPDR(X) __get_MB93493(0x384 + (X) * 0xc0)
  223. #define __set_MB93493_GPIO_GPDR(X,V) __set_MB93493(0x384 + (X) * 0xc0, (V))
  224. #define __get_MB93493_GPIO_SIR(X) __get_MB93493(0x388 + (X) * 0xc0)
  225. #define __set_MB93493_GPIO_SIR(X,V) __set_MB93493(0x388 + (X) * 0xc0, (V))
  226. #define __get_MB93493_GPIO_SOR(X) __get_MB93493(0x38c + (X) * 0xc0)
  227. #define __set_MB93493_GPIO_SOR(X,V) __set_MB93493(0x38c + (X) * 0xc0, (V))
  228. #define __get_MB93493_GPIO_PDSR(X) __get_MB93493(0x390 + (X) * 0xc0)
  229. #define __set_MB93493_GPIO_PDSR(X,V) __set_MB93493(0x390 + (X) * 0xc0, (V))
  230. #define __get_MB93493_GPIO_PDCR(X) __get_MB93493(0x394 + (X) * 0xc0)
  231. #define __set_MB93493_GPIO_PDCR(X,V) __set_MB93493(0x394 + (X) * 0xc0, (V))
  232. #define __get_MB93493_GPIO_INTST(X) __get_MB93493(0x398 + (X) * 0xc0)
  233. #define __set_MB93493_GPIO_INTST(X,V) __set_MB93493(0x398 + (X) * 0xc0, (V))
  234. #define __get_MB93493_GPIO_IEHL(X) __get_MB93493(0x39c + (X) * 0xc0)
  235. #define __set_MB93493_GPIO_IEHL(X,V) __set_MB93493(0x39c + (X) * 0xc0, (V))
  236. #define __get_MB93493_GPIO_IELH(X) __get_MB93493(0x3a0 + (X) * 0xc0)
  237. #define __set_MB93493_GPIO_IELH(X,V) __set_MB93493(0x3a0 + (X) * 0xc0, (V))
  238. #endif /* _ASM_MB93493_REGS_H */