1
2
3
4
5
6
7
8
9
10
11 #ifndef _STG4000REG_H
12 #define _STG4000REG_H
13
14 #define DWFILL unsigned long :32
15 #define WFILL unsigned short :16
16
17
18
19
20
21 #if defined(__KERNEL__)
22 #include <asm/page.h>
23 #include <asm/io.h>
24 #define STG_WRITE_REG(reg,data) (writel(data,&pSTGReg->reg))
25 #define STG_READ_REG(reg) (readl(&pSTGReg->reg))
26 #else
27 #define STG_WRITE_REG(reg,data) (pSTGReg->reg = data)
28 #define STG_READ_REG(reg) (pSTGReg->reg)
29 #endif
30
31 #define SET_BIT(n) (1<<(n))
32 #define CLEAR_BIT(n) (tmp &= ~(1<<n))
33 #define CLEAR_BITS_FRM_TO(frm, to) \
34 {\
35 int i; \
36 for(i = frm; i<= to; i++) \
37 { \
38 tmp &= ~(1<<i); \
39 } \
40 }
41
42 #define CLEAR_BIT_2(n) (usTemp &= ~(1<<n))
43 #define CLEAR_BITS_FRM_TO_2(frm, to) \
44 {\
45 int i; \
46 for(i = frm; i<= to; i++) \
47 { \
48 usTemp &= ~(1<<i); \
49 } \
50 }
51
52
53 typedef enum _LUT_USES {
54 NO_LUT = 0, RESERVED, GRAPHICS, OVERLAY
55 } LUT_USES;
56
57
58 typedef enum _PIXEL_FORMAT {
59 _8BPP = 0, _15BPP, _16BPP, _24BPP, _32BPP
60 } PIXEL_FORMAT;
61
62
63 typedef enum _BLEND_MODE {
64 GRAPHICS_MODE = 0, COLOR_KEY, PER_PIXEL_ALPHA, GLOBAL_ALPHA,
65 CK_PIXEL_ALPHA, CK_GLOBAL_ALPHA
66 } OVRL_BLEND_MODE;
67
68
69 typedef enum _OVRL_PIX_FORMAT {
70 UYVY, VYUY, YUYV, YVYU
71 } OVRL_PIX_FORMAT;
72
73
74 typedef struct {
75
76 volatile u32 Thread0Enable;
77 volatile u32 Thread1Enable;
78 volatile u32 Thread0Recover;
79 volatile u32 Thread1Recover;
80 volatile u32 Thread0Step;
81 volatile u32 Thread1Step;
82 volatile u32 VideoInStatus;
83 volatile u32 Core2InSignStart;
84 volatile u32 Core1ResetVector;
85 volatile u32 Core1ROMOffset;
86 volatile u32 Core1ArbiterPriority;
87 volatile u32 VideoInControl;
88 volatile u32 VideoInReg0CtrlA;
89 volatile u32 VideoInReg0CtrlB;
90 volatile u32 VideoInReg1CtrlA;
91 volatile u32 VideoInReg1CtrlB;
92 volatile u32 Thread0Kicker;
93 volatile u32 Core2InputSign;
94 volatile u32 Thread0ProgCtr;
95 volatile u32 Thread1ProgCtr;
96 volatile u32 Thread1Kicker;
97 volatile u32 GPRegister1;
98 volatile u32 GPRegister2;
99 volatile u32 GPRegister3;
100 volatile u32 GPRegister4;
101 volatile u32 SerialIntA;
102
103 volatile u32 Fill0[6];
104
105 volatile u32 SoftwareReset;
106 volatile u32 SerialIntB;
107
108 volatile u32 Fill1[37];
109
110 volatile u32 ROMELQV;
111 volatile u32 WLWH;
112 volatile u32 ROMELWL;
113
114 volatile u32 dwFill_1;
115
116 volatile u32 IntStatus;
117 volatile u32 IntMask;
118 volatile u32 IntClear;
119
120 volatile u32 Fill2[6];
121
122 volatile u32 ROMGPIOA;
123 volatile u32 ROMGPIOB;
124 volatile u32 ROMGPIOC;
125 volatile u32 ROMGPIOD;
126
127 volatile u32 Fill3[2];
128
129 volatile u32 AGPIntID;
130 volatile u32 AGPIntClassCode;
131 volatile u32 AGPIntBIST;
132 volatile u32 AGPIntSSID;
133 volatile u32 AGPIntPMCSR;
134 volatile u32 VGAFrameBufBase;
135 volatile u32 VGANotify;
136 volatile u32 DACPLLMode;
137 volatile u32 Core1VideoClockDiv;
138 volatile u32 AGPIntStat;
139
140
141
142
143
144
145
146
147 volatile u32 Fill4[412];
148
149 volatile u32 TACtrlStreamBase;
150 volatile u32 TAObjDataBase;
151 volatile u32 TAPtrDataBase;
152 volatile u32 TARegionDataBase;
153 volatile u32 TATailPtrBase;
154 volatile u32 TAPtrRegionSize;
155 volatile u32 TAConfiguration;
156 volatile u32 TAObjDataStartAddr;
157 volatile u32 TAObjDataEndAddr;
158 volatile u32 TAXScreenClip;
159 volatile u32 TAYScreenClip;
160 volatile u32 TARHWClamp;
161 volatile u32 TARHWCompare;
162 volatile u32 TAStart;
163 volatile u32 TAObjReStart;
164 volatile u32 TAPtrReStart;
165 volatile u32 TAStatus1;
166 volatile u32 TAStatus2;
167 volatile u32 TAIntStatus;
168 volatile u32 TAIntMask;
169
170 volatile u32 Fill5[235];
171
172 volatile u32 TextureAddrThresh;
173 volatile u32 Core1Translation;
174 volatile u32 TextureAddrReMap;
175 volatile u32 RenderOutAGPRemap;
176 volatile u32 _3DRegionReadTrans;
177 volatile u32 _3DPtrReadTrans;
178 volatile u32 _3DParamReadTrans;
179 volatile u32 _3DRegionReadThresh;
180 volatile u32 _3DPtrReadThresh;
181 volatile u32 _3DParamReadThresh;
182 volatile u32 _3DRegionReadAGPRemap;
183 volatile u32 _3DPtrReadAGPRemap;
184 volatile u32 _3DParamReadAGPRemap;
185 volatile u32 ZBufferAGPRemap;
186 volatile u32 TAIndexAGPRemap;
187 volatile u32 TAVertexAGPRemap;
188 volatile u32 TAUVAddrTrans;
189 volatile u32 TATailPtrCacheTrans;
190 volatile u32 TAParamWriteTrans;
191 volatile u32 TAPtrWriteTrans;
192 volatile u32 TAParamWriteThresh;
193 volatile u32 TAPtrWriteThresh;
194 volatile u32 TATailPtrCacheAGPRe;
195 volatile u32 TAParamWriteAGPRe;
196 volatile u32 TAPtrWriteAGPRe;
197 volatile u32 SDRAMArbiterConf;
198 volatile u32 SDRAMConf0;
199 volatile u32 SDRAMConf1;
200 volatile u32 SDRAMConf2;
201 volatile u32 SDRAMRefresh;
202 volatile u32 SDRAMPowerStat;
203
204 volatile u32 Fill6[2];
205
206 volatile u32 RAMBistData;
207 volatile u32 RAMBistCtrl;
208 volatile u32 FIFOBistKey;
209 volatile u32 RAMBistResult;
210 volatile u32 FIFOBistResult;
211
212
213
214
215
216
217 volatile u32 Fill7[16];
218
219 volatile u32 SDRAMAddrSign;
220 volatile u32 SDRAMDataSign;
221 volatile u32 SDRAMSignConf;
222
223
224 volatile u32 dwFill_2;
225
226 volatile u32 ISPSignature;
227
228 volatile u32 Fill8[454];
229
230 volatile u32 DACPrimAddress;
231 volatile u32 DACPrimSize;
232 volatile u32 DACCursorAddr;
233 volatile u32 DACCursorCtrl;
234 volatile u32 DACOverlayAddr;
235 volatile u32 DACOverlayUAddr;
236 volatile u32 DACOverlayVAddr;
237 volatile u32 DACOverlaySize;
238 volatile u32 DACOverlayVtDec;
239
240 volatile u32 Fill9[9];
241
242 volatile u32 DACVerticalScal;
243 volatile u32 DACPixelFormat;
244 volatile u32 DACHorizontalScal;
245 volatile u32 DACVidWinStart;
246 volatile u32 DACVidWinEnd;
247 volatile u32 DACBlendCtrl;
248 volatile u32 DACHorTim1;
249 volatile u32 DACHorTim2;
250 volatile u32 DACHorTim3;
251 volatile u32 DACVerTim1;
252 volatile u32 DACVerTim2;
253 volatile u32 DACVerTim3;
254 volatile u32 DACBorderColor;
255 volatile u32 DACSyncCtrl;
256 volatile u32 DACStreamCtrl;
257 volatile u32 DACLUTAddress;
258 volatile u32 DACLUTData;
259 volatile u32 DACBurstCtrl;
260 volatile u32 DACCrcTrigger;
261 volatile u32 DACCrcDone;
262 volatile u32 DACCrcResult1;
263 volatile u32 DACCrcResult2;
264 volatile u32 DACLinecount;
265
266 volatile u32 Fill10[151];
267
268 volatile u32 DigVidPortCtrl;
269 volatile u32 DigVidPortStat;
270
271
272
273
274
275
276 volatile u32 Fill11[1598];
277
278
279 volatile u32 Fill_3;
280
281 } STG4000REG;
282
283 #endif