zr36060.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. /*
  2. * Zoran ZR36060 basic configuration functions - header file
  3. *
  4. * Copyright (C) 2002 Laurent Pinchart <laurent.pinchart@skynet.be>
  5. *
  6. * $Id: zr36060.h,v 1.1.1.1.2.3 2003/01/14 21:18:47 rbultje Exp $
  7. *
  8. * ------------------------------------------------------------------------
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; either version 2 of the License, or
  13. * (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  23. *
  24. * ------------------------------------------------------------------------
  25. */
  26. #ifndef ZR36060_H
  27. #define ZR36060_H
  28. #include "videocodec.h"
  29. /* data stored for each zoran jpeg codec chip */
  30. struct zr36060 {
  31. char name[32];
  32. int num;
  33. /* io datastructure */
  34. struct videocodec *codec;
  35. // last coder status
  36. __u8 status;
  37. // actual coder setup
  38. int mode;
  39. __u16 width;
  40. __u16 height;
  41. __u16 bitrate_ctrl;
  42. __u32 total_code_vol;
  43. __u32 real_code_vol;
  44. __u16 max_block_vol;
  45. __u8 h_samp_ratio[8];
  46. __u8 v_samp_ratio[8];
  47. __u16 scalefact;
  48. __u16 dri;
  49. /* app/com marker data */
  50. struct jpeg_app_marker app;
  51. struct jpeg_com_marker com;
  52. };
  53. /* ZR36060 register addresses */
  54. #define ZR060_LOAD 0x000
  55. #define ZR060_CFSR 0x001
  56. #define ZR060_CIR 0x002
  57. #define ZR060_CMR 0x003
  58. #define ZR060_MBZ 0x004
  59. #define ZR060_MBCVR 0x005
  60. #define ZR060_MER 0x006
  61. #define ZR060_IMR 0x007
  62. #define ZR060_ISR 0x008
  63. #define ZR060_TCV_NET_HI 0x009
  64. #define ZR060_TCV_NET_MH 0x00a
  65. #define ZR060_TCV_NET_ML 0x00b
  66. #define ZR060_TCV_NET_LO 0x00c
  67. #define ZR060_TCV_DATA_HI 0x00d
  68. #define ZR060_TCV_DATA_MH 0x00e
  69. #define ZR060_TCV_DATA_ML 0x00f
  70. #define ZR060_TCV_DATA_LO 0x010
  71. #define ZR060_SF_HI 0x011
  72. #define ZR060_SF_LO 0x012
  73. #define ZR060_AF_HI 0x013
  74. #define ZR060_AF_M 0x014
  75. #define ZR060_AF_LO 0x015
  76. #define ZR060_ACV_HI 0x016
  77. #define ZR060_ACV_MH 0x017
  78. #define ZR060_ACV_ML 0x018
  79. #define ZR060_ACV_LO 0x019
  80. #define ZR060_ACT_HI 0x01a
  81. #define ZR060_ACT_MH 0x01b
  82. #define ZR060_ACT_ML 0x01c
  83. #define ZR060_ACT_LO 0x01d
  84. #define ZR060_ACV_TRUN_HI 0x01e
  85. #define ZR060_ACV_TRUN_MH 0x01f
  86. #define ZR060_ACV_TRUN_ML 0x020
  87. #define ZR060_ACV_TRUN_LO 0x021
  88. #define ZR060_IDR_DEV 0x022
  89. #define ZR060_IDR_REV 0x023
  90. #define ZR060_TCR_HI 0x024
  91. #define ZR060_TCR_LO 0x025
  92. #define ZR060_VCR 0x030
  93. #define ZR060_VPR 0x031
  94. #define ZR060_SR 0x032
  95. #define ZR060_BCR_Y 0x033
  96. #define ZR060_BCR_U 0x034
  97. #define ZR060_BCR_V 0x035
  98. #define ZR060_SGR_VTOTAL_HI 0x036
  99. #define ZR060_SGR_VTOTAL_LO 0x037
  100. #define ZR060_SGR_HTOTAL_HI 0x038
  101. #define ZR060_SGR_HTOTAL_LO 0x039
  102. #define ZR060_SGR_VSYNC 0x03a
  103. #define ZR060_SGR_HSYNC 0x03b
  104. #define ZR060_SGR_BVSTART 0x03c
  105. #define ZR060_SGR_BHSTART 0x03d
  106. #define ZR060_SGR_BVEND_HI 0x03e
  107. #define ZR060_SGR_BVEND_LO 0x03f
  108. #define ZR060_SGR_BHEND_HI 0x040
  109. #define ZR060_SGR_BHEND_LO 0x041
  110. #define ZR060_AAR_VSTART_HI 0x042
  111. #define ZR060_AAR_VSTART_LO 0x043
  112. #define ZR060_AAR_VEND_HI 0x044
  113. #define ZR060_AAR_VEND_LO 0x045
  114. #define ZR060_AAR_HSTART_HI 0x046
  115. #define ZR060_AAR_HSTART_LO 0x047
  116. #define ZR060_AAR_HEND_HI 0x048
  117. #define ZR060_AAR_HEND_LO 0x049
  118. #define ZR060_SWR_VSTART_HI 0x04a
  119. #define ZR060_SWR_VSTART_LO 0x04b
  120. #define ZR060_SWR_VEND_HI 0x04c
  121. #define ZR060_SWR_VEND_LO 0x04d
  122. #define ZR060_SWR_HSTART_HI 0x04e
  123. #define ZR060_SWR_HSTART_LO 0x04f
  124. #define ZR060_SWR_HEND_HI 0x050
  125. #define ZR060_SWR_HEND_LO 0x051
  126. #define ZR060_SOF_IDX 0x060
  127. #define ZR060_SOS_IDX 0x07a
  128. #define ZR060_DRI_IDX 0x0c0
  129. #define ZR060_DQT_IDX 0x0cc
  130. #define ZR060_DHT_IDX 0x1d4
  131. #define ZR060_APP_IDX 0x380
  132. #define ZR060_COM_IDX 0x3c0
  133. /* ZR36060 LOAD register bits */
  134. #define ZR060_LOAD_Load (1 << 7)
  135. #define ZR060_LOAD_SyncRst (1 << 0)
  136. /* ZR36060 Code FIFO Status register bits */
  137. #define ZR060_CFSR_Busy (1 << 7)
  138. #define ZR060_CFSR_CBusy (1 << 2)
  139. #define ZR060_CFSR_CFIFO (3 << 0)
  140. /* ZR36060 Code Interface register */
  141. #define ZR060_CIR_Code16 (1 << 7)
  142. #define ZR060_CIR_Endian (1 << 6)
  143. #define ZR060_CIR_CFIS (1 << 2)
  144. #define ZR060_CIR_CodeMstr (1 << 0)
  145. /* ZR36060 Codec Mode register */
  146. #define ZR060_CMR_Comp (1 << 7)
  147. #define ZR060_CMR_ATP (1 << 6)
  148. #define ZR060_CMR_Pass2 (1 << 5)
  149. #define ZR060_CMR_TLM (1 << 4)
  150. #define ZR060_CMR_BRB (1 << 2)
  151. #define ZR060_CMR_FSF (1 << 1)
  152. /* ZR36060 Markers Enable register */
  153. #define ZR060_MER_App (1 << 7)
  154. #define ZR060_MER_Com (1 << 6)
  155. #define ZR060_MER_DRI (1 << 5)
  156. #define ZR060_MER_DQT (1 << 4)
  157. #define ZR060_MER_DHT (1 << 3)
  158. /* ZR36060 Interrupt Mask register */
  159. #define ZR060_IMR_EOAV (1 << 3)
  160. #define ZR060_IMR_EOI (1 << 2)
  161. #define ZR060_IMR_End (1 << 1)
  162. #define ZR060_IMR_DataErr (1 << 0)
  163. /* ZR36060 Interrupt Status register */
  164. #define ZR060_ISR_ProCnt (3 << 6)
  165. #define ZR060_ISR_EOAV (1 << 3)
  166. #define ZR060_ISR_EOI (1 << 2)
  167. #define ZR060_ISR_End (1 << 1)
  168. #define ZR060_ISR_DataErr (1 << 0)
  169. /* ZR36060 Video Control register */
  170. #define ZR060_VCR_Video8 (1 << 7)
  171. #define ZR060_VCR_Range (1 << 6)
  172. #define ZR060_VCR_FIDet (1 << 3)
  173. #define ZR060_VCR_FIVedge (1 << 2)
  174. #define ZR060_VCR_FIExt (1 << 1)
  175. #define ZR060_VCR_SyncMstr (1 << 0)
  176. /* ZR36060 Video Polarity register */
  177. #define ZR060_VPR_VCLKPol (1 << 7)
  178. #define ZR060_VPR_PValPol (1 << 6)
  179. #define ZR060_VPR_PoePol (1 << 5)
  180. #define ZR060_VPR_SImgPol (1 << 4)
  181. #define ZR060_VPR_BLPol (1 << 3)
  182. #define ZR060_VPR_FIPol (1 << 2)
  183. #define ZR060_VPR_HSPol (1 << 1)
  184. #define ZR060_VPR_VSPol (1 << 0)
  185. /* ZR36060 Scaling register */
  186. #define ZR060_SR_VScale (1 << 2)
  187. #define ZR060_SR_HScale2 (1 << 0)
  188. #define ZR060_SR_HScale4 (2 << 0)
  189. #endif /*fndef ZR36060_H */