STG4000Reg.h 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. /*
  2. * linux/drivers/video/kyro/STG4000Reg.h
  3. *
  4. * Copyright (C) 2002 STMicroelectronics
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file COPYING in the main directory of this archive
  8. * for more details.
  9. */
  10. #ifndef _STG4000REG_H
  11. #define _STG4000REG_H
  12. #define DWFILL unsigned long :32
  13. #define WFILL unsigned short :16
  14. /*
  15. * Macros that access memory mapped card registers in PCI space
  16. * Add an appropriate section for your OS or processor architecture.
  17. */
  18. #if defined(__KERNEL__)
  19. #include <asm/page.h>
  20. #include <asm/io.h>
  21. #define STG_WRITE_REG(reg,data) (writel(data,&pSTGReg->reg))
  22. #define STG_READ_REG(reg) (readl(&pSTGReg->reg))
  23. #else
  24. #define STG_WRITE_REG(reg,data) (pSTGReg->reg = data)
  25. #define STG_READ_REG(reg) (pSTGReg->reg)
  26. #endif /* __KERNEL__ */
  27. #define SET_BIT(n) (1<<(n))
  28. #define CLEAR_BIT(n) (tmp &= ~(1<<n))
  29. #define CLEAR_BITS_FRM_TO(frm, to) \
  30. {\
  31. int i; \
  32. for(i = frm; i<= to; i++) \
  33. { \
  34. tmp &= ~(1<<i); \
  35. } \
  36. }
  37. #define CLEAR_BIT_2(n) (usTemp &= ~(1<<n))
  38. #define CLEAR_BITS_FRM_TO_2(frm, to) \
  39. {\
  40. int i; \
  41. for(i = frm; i<= to; i++) \
  42. { \
  43. usTemp &= ~(1<<i); \
  44. } \
  45. }
  46. /* LUT select */
  47. typedef enum _LUT_USES {
  48. NO_LUT = 0, RESERVED, GRAPHICS, OVERLAY
  49. } LUT_USES;
  50. /* Primary surface pixel format select */
  51. typedef enum _PIXEL_FORMAT {
  52. _8BPP = 0, _15BPP, _16BPP, _24BPP, _32BPP
  53. } PIXEL_FORMAT;
  54. /* Overlay blending mode select */
  55. typedef enum _BLEND_MODE {
  56. GRAPHICS_MODE = 0, COLOR_KEY, PER_PIXEL_ALPHA, GLOBAL_ALPHA,
  57. CK_PIXEL_ALPHA, CK_GLOBAL_ALPHA
  58. } OVRL_BLEND_MODE;
  59. /* Overlay Pixel format select */
  60. typedef enum _OVRL_PIX_FORMAT {
  61. UYVY, VYUY, YUYV, YVYU
  62. } OVRL_PIX_FORMAT;
  63. /* Register Table */
  64. typedef struct {
  65. /* 0h */
  66. volatile u32 Thread0Enable; /* 0x0000 */
  67. volatile u32 Thread1Enable; /* 0x0004 */
  68. volatile u32 Thread0Recover; /* 0x0008 */
  69. volatile u32 Thread1Recover; /* 0x000C */
  70. volatile u32 Thread0Step; /* 0x0010 */
  71. volatile u32 Thread1Step; /* 0x0014 */
  72. volatile u32 VideoInStatus; /* 0x0018 */
  73. volatile u32 Core2InSignStart; /* 0x001C */
  74. volatile u32 Core1ResetVector; /* 0x0020 */
  75. volatile u32 Core1ROMOffset; /* 0x0024 */
  76. volatile u32 Core1ArbiterPriority; /* 0x0028 */
  77. volatile u32 VideoInControl; /* 0x002C */
  78. volatile u32 VideoInReg0CtrlA; /* 0x0030 */
  79. volatile u32 VideoInReg0CtrlB; /* 0x0034 */
  80. volatile u32 VideoInReg1CtrlA; /* 0x0038 */
  81. volatile u32 VideoInReg1CtrlB; /* 0x003C */
  82. volatile u32 Thread0Kicker; /* 0x0040 */
  83. volatile u32 Core2InputSign; /* 0x0044 */
  84. volatile u32 Thread0ProgCtr; /* 0x0048 */
  85. volatile u32 Thread1ProgCtr; /* 0x004C */
  86. volatile u32 Thread1Kicker; /* 0x0050 */
  87. volatile u32 GPRegister1; /* 0x0054 */
  88. volatile u32 GPRegister2; /* 0x0058 */
  89. volatile u32 GPRegister3; /* 0x005C */
  90. volatile u32 GPRegister4; /* 0x0060 */
  91. volatile u32 SerialIntA; /* 0x0064 */
  92. volatile u32 Fill0[6]; /* GAP 0x0068 - 0x007C */
  93. volatile u32 SoftwareReset; /* 0x0080 */
  94. volatile u32 SerialIntB; /* 0x0084 */
  95. volatile u32 Fill1[37]; /* GAP 0x0088 - 0x011C */
  96. volatile u32 ROMELQV; /* 0x011C */
  97. volatile u32 WLWH; /* 0x0120 */
  98. volatile u32 ROMELWL; /* 0x0124 */
  99. volatile u32 dwFill_1; /* GAP 0x0128 */
  100. volatile u32 IntStatus; /* 0x012C */
  101. volatile u32 IntMask; /* 0x0130 */
  102. volatile u32 IntClear; /* 0x0134 */
  103. volatile u32 Fill2[6]; /* GAP 0x0138 - 0x014C */
  104. volatile u32 ROMGPIOA; /* 0x0150 */
  105. volatile u32 ROMGPIOB; /* 0x0154 */
  106. volatile u32 ROMGPIOC; /* 0x0158 */
  107. volatile u32 ROMGPIOD; /* 0x015C */
  108. volatile u32 Fill3[2]; /* GAP 0x0160 - 0x0168 */
  109. volatile u32 AGPIntID; /* 0x0168 */
  110. volatile u32 AGPIntClassCode; /* 0x016C */
  111. volatile u32 AGPIntBIST; /* 0x0170 */
  112. volatile u32 AGPIntSSID; /* 0x0174 */
  113. volatile u32 AGPIntPMCSR; /* 0x0178 */
  114. volatile u32 VGAFrameBufBase; /* 0x017C */
  115. volatile u32 VGANotify; /* 0x0180 */
  116. volatile u32 DACPLLMode; /* 0x0184 */
  117. volatile u32 Core1VideoClockDiv; /* 0x0188 */
  118. volatile u32 AGPIntStat; /* 0x018C */
  119. /*
  120. volatile u32 Fill4[0x0400/4 - 0x0190/4]; //GAP 0x0190 - 0x0400
  121. volatile u32 Fill5[0x05FC/4 - 0x0400/4]; //GAP 0x0400 - 0x05FC Fog Table
  122. volatile u32 Fill6[0x0604/4 - 0x0600/4]; //GAP 0x0600 - 0x0604
  123. volatile u32 Fill7[0x0680/4 - 0x0608/4]; //GAP 0x0608 - 0x0680
  124. volatile u32 Fill8[0x07FC/4 - 0x0684/4]; //GAP 0x0684 - 0x07FC
  125. */
  126. volatile u32 Fill4[412]; /* 0x0190 - 0x07FC */
  127. volatile u32 TACtrlStreamBase; /* 0x0800 */
  128. volatile u32 TAObjDataBase; /* 0x0804 */
  129. volatile u32 TAPtrDataBase; /* 0x0808 */
  130. volatile u32 TARegionDataBase; /* 0x080C */
  131. volatile u32 TATailPtrBase; /* 0x0810 */
  132. volatile u32 TAPtrRegionSize; /* 0x0814 */
  133. volatile u32 TAConfiguration; /* 0x0818 */
  134. volatile u32 TAObjDataStartAddr; /* 0x081C */
  135. volatile u32 TAObjDataEndAddr; /* 0x0820 */
  136. volatile u32 TAXScreenClip; /* 0x0824 */
  137. volatile u32 TAYScreenClip; /* 0x0828 */
  138. volatile u32 TARHWClamp; /* 0x082C */
  139. volatile u32 TARHWCompare; /* 0x0830 */
  140. volatile u32 TAStart; /* 0x0834 */
  141. volatile u32 TAObjReStart; /* 0x0838 */
  142. volatile u32 TAPtrReStart; /* 0x083C */
  143. volatile u32 TAStatus1; /* 0x0840 */
  144. volatile u32 TAStatus2; /* 0x0844 */
  145. volatile u32 TAIntStatus; /* 0x0848 */
  146. volatile u32 TAIntMask; /* 0x084C */
  147. volatile u32 Fill5[235]; /* GAP 0x0850 - 0x0BF8 */
  148. volatile u32 TextureAddrThresh; /* 0x0BFC */
  149. volatile u32 Core1Translation; /* 0x0C00 */
  150. volatile u32 TextureAddrReMap; /* 0x0C04 */
  151. volatile u32 RenderOutAGPRemap; /* 0x0C08 */
  152. volatile u32 _3DRegionReadTrans; /* 0x0C0C */
  153. volatile u32 _3DPtrReadTrans; /* 0x0C10 */
  154. volatile u32 _3DParamReadTrans; /* 0x0C14 */
  155. volatile u32 _3DRegionReadThresh; /* 0x0C18 */
  156. volatile u32 _3DPtrReadThresh; /* 0x0C1C */
  157. volatile u32 _3DParamReadThresh; /* 0x0C20 */
  158. volatile u32 _3DRegionReadAGPRemap; /* 0x0C24 */
  159. volatile u32 _3DPtrReadAGPRemap; /* 0x0C28 */
  160. volatile u32 _3DParamReadAGPRemap; /* 0x0C2C */
  161. volatile u32 ZBufferAGPRemap; /* 0x0C30 */
  162. volatile u32 TAIndexAGPRemap; /* 0x0C34 */
  163. volatile u32 TAVertexAGPRemap; /* 0x0C38 */
  164. volatile u32 TAUVAddrTrans; /* 0x0C3C */
  165. volatile u32 TATailPtrCacheTrans; /* 0x0C40 */
  166. volatile u32 TAParamWriteTrans; /* 0x0C44 */
  167. volatile u32 TAPtrWriteTrans; /* 0x0C48 */
  168. volatile u32 TAParamWriteThresh; /* 0x0C4C */
  169. volatile u32 TAPtrWriteThresh; /* 0x0C50 */
  170. volatile u32 TATailPtrCacheAGPRe; /* 0x0C54 */
  171. volatile u32 TAParamWriteAGPRe; /* 0x0C58 */
  172. volatile u32 TAPtrWriteAGPRe; /* 0x0C5C */
  173. volatile u32 SDRAMArbiterConf; /* 0x0C60 */
  174. volatile u32 SDRAMConf0; /* 0x0C64 */
  175. volatile u32 SDRAMConf1; /* 0x0C68 */
  176. volatile u32 SDRAMConf2; /* 0x0C6C */
  177. volatile u32 SDRAMRefresh; /* 0x0C70 */
  178. volatile u32 SDRAMPowerStat; /* 0x0C74 */
  179. volatile u32 Fill6[2]; /* GAP 0x0C78 - 0x0C7C */
  180. volatile u32 RAMBistData; /* 0x0C80 */
  181. volatile u32 RAMBistCtrl; /* 0x0C84 */
  182. volatile u32 FIFOBistKey; /* 0x0C88 */
  183. volatile u32 RAMBistResult; /* 0x0C8C */
  184. volatile u32 FIFOBistResult; /* 0x0C90 */
  185. /*
  186. volatile u32 Fill11[0x0CBC/4 - 0x0C94/4]; //GAP 0x0C94 - 0x0CBC
  187. volatile u32 Fill12[0x0CD0/4 - 0x0CC0/4]; //GAP 0x0CC0 - 0x0CD0 3DRegisters
  188. */
  189. volatile u32 Fill7[16]; /* 0x0c94 - 0x0cd0 */
  190. volatile u32 SDRAMAddrSign; /* 0x0CD4 */
  191. volatile u32 SDRAMDataSign; /* 0x0CD8 */
  192. volatile u32 SDRAMSignConf; /* 0x0CDC */
  193. /* DWFILL; //GAP 0x0CE0 */
  194. volatile u32 dwFill_2;
  195. volatile u32 ISPSignature; /* 0x0CE4 */
  196. volatile u32 Fill8[454]; /*GAP 0x0CE8 - 0x13FC */
  197. volatile u32 DACPrimAddress; /* 0x1400 */
  198. volatile u32 DACPrimSize; /* 0x1404 */
  199. volatile u32 DACCursorAddr; /* 0x1408 */
  200. volatile u32 DACCursorCtrl; /* 0x140C */
  201. volatile u32 DACOverlayAddr; /* 0x1410 */
  202. volatile u32 DACOverlayUAddr; /* 0x1414 */
  203. volatile u32 DACOverlayVAddr; /* 0x1418 */
  204. volatile u32 DACOverlaySize; /* 0x141C */
  205. volatile u32 DACOverlayVtDec; /* 0x1420 */
  206. volatile u32 Fill9[9]; /* GAP 0x1424 - 0x1444 */
  207. volatile u32 DACVerticalScal; /* 0x1448 */
  208. volatile u32 DACPixelFormat; /* 0x144C */
  209. volatile u32 DACHorizontalScal; /* 0x1450 */
  210. volatile u32 DACVidWinStart; /* 0x1454 */
  211. volatile u32 DACVidWinEnd; /* 0x1458 */
  212. volatile u32 DACBlendCtrl; /* 0x145C */
  213. volatile u32 DACHorTim1; /* 0x1460 */
  214. volatile u32 DACHorTim2; /* 0x1464 */
  215. volatile u32 DACHorTim3; /* 0x1468 */
  216. volatile u32 DACVerTim1; /* 0x146C */
  217. volatile u32 DACVerTim2; /* 0x1470 */
  218. volatile u32 DACVerTim3; /* 0x1474 */
  219. volatile u32 DACBorderColor; /* 0x1478 */
  220. volatile u32 DACSyncCtrl; /* 0x147C */
  221. volatile u32 DACStreamCtrl; /* 0x1480 */
  222. volatile u32 DACLUTAddress; /* 0x1484 */
  223. volatile u32 DACLUTData; /* 0x1488 */
  224. volatile u32 DACBurstCtrl; /* 0x148C */
  225. volatile u32 DACCrcTrigger; /* 0x1490 */
  226. volatile u32 DACCrcDone; /* 0x1494 */
  227. volatile u32 DACCrcResult1; /* 0x1498 */
  228. volatile u32 DACCrcResult2; /* 0x149C */
  229. volatile u32 DACLinecount; /* 0x14A0 */
  230. volatile u32 Fill10[151]; /*GAP 0x14A4 - 0x16FC */
  231. volatile u32 DigVidPortCtrl; /* 0x1700 */
  232. volatile u32 DigVidPortStat; /* 0x1704 */
  233. /*
  234. volatile u32 Fill11[0x1FFC/4 - 0x1708/4]; //GAP 0x1708 - 0x1FFC
  235. volatile u32 Fill17[0x3000/4 - 0x2FFC/4]; //GAP 0x2000 - 0x2FFC ALUT
  236. */
  237. volatile u32 Fill11[1598];
  238. /* DWFILL; //GAP 0x3000 ALUT 256MB offset */
  239. volatile u32 Fill_3;
  240. } STG4000REG;
  241. #endif /* _STG4000REG_H */