Commit | Line | Data |
---|---|---|
faa4fd2a BC |
1 | /* |
2 | * Copyright (C) 2010 Bluecherry, LLC www.bluecherrydvr.com | |
3 | * Copyright (C) 2010 Ben Collins <bcollins@bluecherry.net> | |
4 | * | |
5 | * This program is free software; you can redistribute it and/or modify | |
6 | * it under the terms of the GNU General Public License as published by | |
7 | * the Free Software Foundation; either version 2 of the License, or | |
8 | * (at your option) any later version. | |
9 | * | |
10 | * This program is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | * GNU General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU General Public License | |
16 | * along with this program; if not, write to the Free Software | |
17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
18 | */ | |
19 | ||
20 | #ifndef __SOLO6010_REGISTERS_H | |
21 | #define __SOLO6010_REGISTERS_H | |
22 | ||
23 | #include "solo6010-offsets.h" | |
24 | ||
25 | /* Global 6010 system configuration */ | |
26 | #define SOLO_SYS_CFG 0x0000 | |
27 | #define SOLO_SYS_CFG_FOUT_EN 0x00000001 | |
28 | #define SOLO_SYS_CFG_PLL_BYPASS 0x00000002 | |
29 | #define SOLO_SYS_CFG_PLL_PWDN 0x00000004 | |
30 | #define SOLO_SYS_CFG_OUTDIV(__n) (((__n) & 0x003) << 3) | |
31 | #define SOLO_SYS_CFG_FEEDBACKDIV(__n) (((__n) & 0x1ff) << 5) | |
32 | #define SOLO_SYS_CFG_INPUTDIV(__n) (((__n) & 0x01f) << 14) | |
33 | #define SOLO_SYS_CFG_CLOCK_DIV 0x00080000 | |
34 | #define SOLO_SYS_CFG_NCLK_DELAY(__n) (((__n) & 0x003) << 24) | |
35 | #define SOLO_SYS_CFG_PCLK_DELAY(__n) (((__n) & 0x00f) << 26) | |
36 | #define SOLO_SYS_CFG_SDRAM64BIT 0x40000000 | |
37 | #define SOLO_SYS_CFG_RESET 0x80000000 | |
38 | ||
39 | #define SOLO_DMA_CTRL 0x0004 | |
40 | #define SOLO_DMA_CTRL_REFRESH_CYCLE(n) ((n)<<8) | |
41 | /* 0=16/32MB, 1=32/64MB, 2=64/128MB, 3=128/256MB */ | |
42 | #define SOLO_DMA_CTRL_SDRAM_SIZE(n) ((n)<<6) | |
43 | #define SOLO_DMA_CTRL_SDRAM_CLK_INVERT (1<<5) | |
44 | #define SOLO_DMA_CTRL_STROBE_SELECT (1<<4) | |
45 | #define SOLO_DMA_CTRL_READ_DATA_SELECT (1<<3) | |
46 | #define SOLO_DMA_CTRL_READ_CLK_SELECT (1<<2) | |
47 | #define SOLO_DMA_CTRL_LATENCY(n) ((n)<<0) | |
48 | ||
49 | #define SOLO_SYS_VCLK 0x000C | |
50 | #define SOLO_VCLK_INVERT (1<<22) | |
51 | /* 0=sys_clk/4, 1=sys_clk/2, 2=clk_in/2 of system input */ | |
52 | #define SOLO_VCLK_SELECT(n) ((n)<<20) | |
53 | #define SOLO_VCLK_VIN1415_DELAY(n) ((n)<<14) | |
54 | #define SOLO_VCLK_VIN1213_DELAY(n) ((n)<<12) | |
55 | #define SOLO_VCLK_VIN1011_DELAY(n) ((n)<<10) | |
56 | #define SOLO_VCLK_VIN0809_DELAY(n) ((n)<<8) | |
57 | #define SOLO_VCLK_VIN0607_DELAY(n) ((n)<<6) | |
58 | #define SOLO_VCLK_VIN0405_DELAY(n) ((n)<<4) | |
59 | #define SOLO_VCLK_VIN0203_DELAY(n) ((n)<<2) | |
60 | #define SOLO_VCLK_VIN0001_DELAY(n) ((n)<<0) | |
61 | ||
62 | #define SOLO_IRQ_STAT 0x0010 | |
63 | #define SOLO_IRQ_ENABLE 0x0014 | |
64 | #define SOLO_IRQ_P2M(n) (1<<((n)+17)) | |
65 | #define SOLO_IRQ_GPIO (1<<16) | |
66 | #define SOLO_IRQ_VIDEO_LOSS (1<<15) | |
67 | #define SOLO_IRQ_VIDEO_IN (1<<14) | |
68 | #define SOLO_IRQ_MOTION (1<<13) | |
69 | #define SOLO_IRQ_ATA_CMD (1<<12) | |
70 | #define SOLO_IRQ_ATA_DIR (1<<11) | |
71 | #define SOLO_IRQ_PCI_ERR (1<<10) | |
72 | #define SOLO_IRQ_PS2_1 (1<<9) | |
73 | #define SOLO_IRQ_PS2_0 (1<<8) | |
74 | #define SOLO_IRQ_SPI (1<<7) | |
75 | #define SOLO_IRQ_IIC (1<<6) | |
76 | #define SOLO_IRQ_UART(n) (1<<((n) + 4)) | |
77 | #define SOLO_IRQ_G723 (1<<3) | |
78 | #define SOLO_IRQ_DECODER (1<<1) | |
79 | #define SOLO_IRQ_ENCODER (1<<0) | |
80 | ||
81 | #define SOLO_CHIP_OPTION 0x001C | |
82 | #define SOLO_CHIP_ID_MASK 0x00000007 | |
83 | ||
84 | #define SOLO_EEPROM_CTRL 0x0060 | |
85 | #define SOLO_EEPROM_ACCESS_EN (1<<7) | |
86 | #define SOLO_EEPROM_CS (1<<3) | |
87 | #define SOLO_EEPROM_CLK (1<<2) | |
88 | #define SOLO_EEPROM_DO (1<<1) | |
89 | #define SOLO_EEPROM_DI (1<<0) | |
90 | #define SOLO_EEPROM_ENABLE (EEPROM_ACCESS_EN | EEPROM_CS) | |
91 | ||
92 | #define SOLO_PCI_ERR 0x0070 | |
93 | #define SOLO_PCI_ERR_FATAL 0x00000001 | |
94 | #define SOLO_PCI_ERR_PARITY 0x00000002 | |
95 | #define SOLO_PCI_ERR_TARGET 0x00000004 | |
96 | #define SOLO_PCI_ERR_TIMEOUT 0x00000008 | |
97 | #define SOLO_PCI_ERR_P2M 0x00000010 | |
98 | #define SOLO_PCI_ERR_ATA 0x00000020 | |
99 | #define SOLO_PCI_ERR_P2M_DESC 0x00000040 | |
100 | #define SOLO_PCI_ERR_FSM0(__s) (((__s) >> 16) & 0x0f) | |
101 | #define SOLO_PCI_ERR_FSM1(__s) (((__s) >> 20) & 0x0f) | |
102 | #define SOLO_PCI_ERR_FSM2(__s) (((__s) >> 24) & 0x1f) | |
103 | ||
104 | #define SOLO_P2M_BASE 0x0080 | |
105 | ||
106 | #define SOLO_P2M_CONFIG(n) (0x0080 + ((n)*0x20)) | |
107 | #define SOLO_P2M_DMA_INTERVAL(n) ((n)<<6)/* N*32 clocks */ | |
108 | #define SOLO_P2M_CSC_BYTE_REORDER (1<<5) /* BGR -> RGB */ | |
109 | /* 0:r=[14:10] g=[9:5] b=[4:0], 1:r=[15:11] g=[10:5] b=[4:0] */ | |
110 | #define SOLO_P2M_CSC_16BIT_565 (1<<4) | |
111 | #define SOLO_P2M_UV_SWAP (1<<3) | |
112 | #define SOLO_P2M_PCI_MASTER_MODE (1<<2) | |
113 | #define SOLO_P2M_DESC_INTR_OPT (1<<1) /* 1:Empty, 0:Each */ | |
114 | #define SOLO_P2M_DESC_MODE (1<<0) | |
115 | ||
116 | #define SOLO_P2M_DES_ADR(n) (0x0084 + ((n)*0x20)) | |
117 | ||
118 | #define SOLO_P2M_DESC_ID(n) (0x0088 + ((n)*0x20)) | |
119 | #define SOLO_P2M_UPDATE_ID(n) ((n)<<0) | |
120 | ||
121 | #define SOLO_P2M_STATUS(n) (0x008C + ((n)*0x20)) | |
122 | #define SOLO_P2M_COMMAND_DONE (1<<8) | |
123 | #define SOLO_P2M_CURRENT_ID(stat) (0xff & (stat)) | |
124 | ||
125 | #define SOLO_P2M_CONTROL(n) (0x0090 + ((n)*0x20)) | |
126 | #define SOLO_P2M_PCI_INC(n) ((n)<<20) | |
127 | #define SOLO_P2M_REPEAT(n) ((n)<<10) | |
128 | /* 0:512, 1:256, 2:128, 3:64, 4:32, 5:128(2page) */ | |
129 | #define SOLO_P2M_BURST_SIZE(n) ((n)<<7) | |
130 | #define SOLO_P2M_BURST_512 0 | |
131 | #define SOLO_P2M_BURST_256 1 | |
132 | #define SOLO_P2M_BURST_128 2 | |
133 | #define SOLO_P2M_BURST_64 3 | |
134 | #define SOLO_P2M_BURST_32 4 | |
135 | #define SOLO_P2M_CSC_16BIT (1<<6) /* 0:24bit, 1:16bit */ | |
136 | /* 0:Y[0]<-0(OFF), 1:Y[0]<-1(ON), 2:Y[0]<-G[0], 3:Y[0]<-Bit[15] */ | |
137 | #define SOLO_P2M_ALPHA_MODE(n) ((n)<<4) | |
138 | #define SOLO_P2M_CSC_ON (1<<3) | |
139 | #define SOLO_P2M_INTERRUPT_REQ (1<<2) | |
140 | #define SOLO_P2M_WRITE (1<<1) | |
141 | #define SOLO_P2M_TRANS_ON (1<<0) | |
142 | ||
143 | #define SOLO_P2M_EXT_CFG(n) (0x0094 + ((n)*0x20)) | |
144 | #define SOLO_P2M_EXT_INC(n) ((n)<<20) | |
145 | #define SOLO_P2M_COPY_SIZE(n) ((n)<<0) | |
146 | ||
147 | #define SOLO_P2M_TAR_ADR(n) (0x0098 + ((n)*0x20)) | |
148 | ||
149 | #define SOLO_P2M_EXT_ADR(n) (0x009C + ((n)*0x20)) | |
150 | ||
151 | #define SOLO_P2M_BUFFER(i) (0x2000 + ((i)*4)) | |
152 | ||
153 | #define SOLO_VI_CH_SWITCH_0 0x0100 | |
154 | #define SOLO_VI_CH_SWITCH_1 0x0104 | |
155 | #define SOLO_VI_CH_SWITCH_2 0x0108 | |
156 | ||
157 | #define SOLO_VI_CH_ENA 0x010C | |
158 | #define SOLO_VI_CH_FORMAT 0x0110 | |
159 | #define SOLO_VI_FD_SEL_MASK(n) ((n)<<16) | |
160 | #define SOLO_VI_PROG_MASK(n) ((n)<<0) | |
161 | ||
162 | #define SOLO_VI_FMT_CFG 0x0114 | |
163 | #define SOLO_VI_FMT_CHECK_VCOUNT (1<<31) | |
164 | #define SOLO_VI_FMT_CHECK_HCOUNT (1<<30) | |
165 | #define SOLO_VI_FMT_TEST_SIGNAL (1<<28) | |
166 | ||
167 | #define SOLO_VI_PAGE_SW 0x0118 | |
168 | #define SOLO_FI_INV_DISP_LIVE(n) ((n)<<8) | |
169 | #define SOLO_FI_INV_DISP_OUT(n) ((n)<<7) | |
170 | #define SOLO_DISP_SYNC_FI(n) ((n)<<6) | |
171 | #define SOLO_PIP_PAGE_ADD(n) ((n)<<3) | |
172 | #define SOLO_NORMAL_PAGE_ADD(n) ((n)<<0) | |
173 | ||
174 | #define SOLO_VI_ACT_I_P 0x011C | |
175 | #define SOLO_VI_ACT_I_S 0x0120 | |
176 | #define SOLO_VI_ACT_P 0x0124 | |
177 | #define SOLO_VI_FI_INVERT (1<<31) | |
178 | #define SOLO_VI_H_START(n) ((n)<<21) | |
179 | #define SOLO_VI_V_START(n) ((n)<<11) | |
180 | #define SOLO_VI_V_STOP(n) ((n)<<0) | |
181 | ||
182 | #define SOLO_VI_STATUS0 0x0128 | |
183 | #define SOLO_VI_STATUS0_PAGE(__n) ((__n) & 0x07) | |
184 | #define SOLO_VI_STATUS1 0x012C | |
185 | ||
186 | /* XXX: Might be better off in kernel level disp.h */ | |
187 | #define DISP_PAGE(stat) ((stat) & 0x07) | |
188 | ||
189 | #define SOLO_VI_PB_CONFIG 0x0130 | |
190 | #define SOLO_VI_PB_USER_MODE (1<<1) | |
191 | #define SOLO_VI_PB_PAL (1<<0) | |
192 | #define SOLO_VI_PB_RANGE_HV 0x0134 | |
193 | #define SOLO_VI_PB_HSIZE(h) ((h)<<12) | |
194 | #define SOLO_VI_PB_VSIZE(v) ((v)<<0) | |
195 | #define SOLO_VI_PB_ACT_H 0x0138 | |
196 | #define SOLO_VI_PB_HSTART(n) ((n)<<12) | |
197 | #define SOLO_VI_PB_HSTOP(n) ((n)<<0) | |
198 | #define SOLO_VI_PB_ACT_V 0x013C | |
199 | #define SOLO_VI_PB_VSTART(n) ((n)<<12) | |
200 | #define SOLO_VI_PB_VSTOP(n) ((n)<<0) | |
201 | ||
202 | #define SOLO_VI_MOSAIC(ch) (0x0140 + ((ch)*4)) | |
203 | #define SOLO_VI_MOSAIC_SX(x) ((x)<<24) | |
204 | #define SOLO_VI_MOSAIC_EX(x) ((x)<<16) | |
205 | #define SOLO_VI_MOSAIC_SY(x) ((x)<<8) | |
206 | #define SOLO_VI_MOSAIC_EY(x) ((x)<<0) | |
207 | ||
208 | #define SOLO_VI_WIN_CTRL0(ch) (0x0180 + ((ch)*4)) | |
209 | #define SOLO_VI_WIN_CTRL1(ch) (0x01C0 + ((ch)*4)) | |
210 | ||
211 | #define SOLO_VI_WIN_CHANNEL(n) ((n)<<28) | |
212 | ||
213 | #define SOLO_VI_WIN_PIP(n) ((n)<<27) | |
214 | #define SOLO_VI_WIN_SCALE(n) ((n)<<24) | |
215 | ||
216 | #define SOLO_VI_WIN_SX(x) ((x)<<12) | |
217 | #define SOLO_VI_WIN_EX(x) ((x)<<0) | |
218 | ||
219 | #define SOLO_VI_WIN_SY(x) ((x)<<12) | |
220 | #define SOLO_VI_WIN_EY(x) ((x)<<0) | |
221 | ||
222 | #define SOLO_VI_WIN_ON(ch) (0x0200 + ((ch)*4)) | |
223 | ||
224 | #define SOLO_VI_WIN_SW 0x0240 | |
225 | #define SOLO_VI_WIN_LIVE_AUTO_MUTE 0x0244 | |
226 | ||
227 | #define SOLO_VI_MOT_ADR 0x0260 | |
228 | #define SOLO_VI_MOTION_EN(mask) ((mask)<<16) | |
229 | #define SOLO_VI_MOT_CTRL 0x0264 | |
230 | #define SOLO_VI_MOTION_FRAME_COUNT(n) ((n)<<24) | |
231 | #define SOLO_VI_MOTION_SAMPLE_LENGTH(n) ((n)<<16) | |
232 | #define SOLO_VI_MOTION_INTR_START_STOP (1<<15) | |
233 | #define SOLO_VI_MOTION_FREEZE_DATA (1<<14) | |
234 | #define SOLO_VI_MOTION_SAMPLE_COUNT(n) ((n)<<0) | |
235 | #define SOLO_VI_MOT_CLEAR 0x0268 | |
236 | #define SOLO_VI_MOT_STATUS 0x026C | |
237 | #define SOLO_VI_MOTION_CNT(n) ((n)<<0) | |
238 | #define SOLO_VI_MOTION_BORDER 0x0270 | |
239 | #define SOLO_VI_MOTION_BAR 0x0274 | |
240 | #define SOLO_VI_MOTION_Y_SET (1<<29) | |
241 | #define SOLO_VI_MOTION_Y_ADD (1<<28) | |
242 | #define SOLO_VI_MOTION_CB_SET (1<<27) | |
243 | #define SOLO_VI_MOTION_CB_ADD (1<<26) | |
244 | #define SOLO_VI_MOTION_CR_SET (1<<25) | |
245 | #define SOLO_VI_MOTION_CR_ADD (1<<24) | |
246 | #define SOLO_VI_MOTION_Y_VALUE(v) ((v)<<16) | |
247 | #define SOLO_VI_MOTION_CB_VALUE(v) ((v)<<8) | |
248 | #define SOLO_VI_MOTION_CR_VALUE(v) ((v)<<0) | |
249 | ||
250 | #define SOLO_VO_FMT_ENC 0x0300 | |
251 | #define SOLO_VO_SCAN_MODE_PROGRESSIVE (1<<31) | |
252 | #define SOLO_VO_FMT_TYPE_PAL (1<<30) | |
253 | #define SOLO_VO_FMT_TYPE_NTSC 0 | |
254 | #define SOLO_VO_USER_SET (1<<29) | |
255 | ||
256 | #define SOLO_VO_FI_CHANGE (1<<20) | |
257 | #define SOLO_VO_USER_COLOR_SET_VSYNC (1<<19) | |
258 | #define SOLO_VO_USER_COLOR_SET_HSYNC (1<<18) | |
259 | #define SOLO_VO_USER_COLOR_SET_NAV (1<<17) | |
260 | #define SOLO_VO_USER_COLOR_SET_NAH (1<<16) | |
261 | #define SOLO_VO_NA_COLOR_Y(Y) ((Y)<<8) | |
262 | #define SOLO_VO_NA_COLOR_CB(CB) (((CB)/16)<<4) | |
263 | #define SOLO_VO_NA_COLOR_CR(CR) (((CR)/16)<<0) | |
264 | ||
265 | #define SOLO_VO_ACT_H 0x0304 | |
266 | #define SOLO_VO_H_BLANK(n) ((n)<<22) | |
267 | #define SOLO_VO_H_START(n) ((n)<<11) | |
268 | #define SOLO_VO_H_STOP(n) ((n)<<0) | |
269 | ||
270 | #define SOLO_VO_ACT_V 0x0308 | |
271 | #define SOLO_VO_V_BLANK(n) ((n)<<22) | |
272 | #define SOLO_VO_V_START(n) ((n)<<11) | |
273 | #define SOLO_VO_V_STOP(n) ((n)<<0) | |
274 | ||
275 | #define SOLO_VO_RANGE_HV 0x030C | |
276 | #define SOLO_VO_SYNC_INVERT (1<<24) | |
277 | #define SOLO_VO_HSYNC_INVERT (1<<23) | |
278 | #define SOLO_VO_VSYNC_INVERT (1<<22) | |
279 | #define SOLO_VO_H_LEN(n) ((n)<<11) | |
280 | #define SOLO_VO_V_LEN(n) ((n)<<0) | |
281 | ||
282 | #define SOLO_VO_DISP_CTRL 0x0310 | |
283 | #define SOLO_VO_DISP_ON (1<<31) | |
284 | #define SOLO_VO_DISP_ERASE_COUNT(n) ((n&0xf)<<24) | |
285 | #define SOLO_VO_DISP_DOUBLE_SCAN (1<<22) | |
286 | #define SOLO_VO_DISP_SINGLE_PAGE (1<<21) | |
287 | #define SOLO_VO_DISP_BASE(n) (((n)>>16) & 0xffff) | |
288 | ||
289 | #define SOLO_VO_DISP_ERASE 0x0314 | |
290 | #define SOLO_VO_DISP_ERASE_ON (1<<0) | |
291 | ||
292 | #define SOLO_VO_ZOOM_CTRL 0x0318 | |
293 | #define SOLO_VO_ZOOM_VER_ON (1<<24) | |
294 | #define SOLO_VO_ZOOM_HOR_ON (1<<23) | |
295 | #define SOLO_VO_ZOOM_V_COMP (1<<22) | |
296 | #define SOLO_VO_ZOOM_SX(h) (((h)/2)<<11) | |
297 | #define SOLO_VO_ZOOM_SY(v) (((v)/2)<<0) | |
298 | ||
299 | #define SOLO_VO_FREEZE_CTRL 0x031C | |
300 | #define SOLO_VO_FREEZE_ON (1<<1) | |
301 | #define SOLO_VO_FREEZE_INTERPOLATION (1<<0) | |
302 | ||
303 | #define SOLO_VO_BKG_COLOR 0x0320 | |
304 | #define SOLO_BG_Y(y) ((y)<<16) | |
305 | #define SOLO_BG_U(u) ((u)<<8) | |
306 | #define SOLO_BG_V(v) ((v)<<0) | |
307 | ||
308 | #define SOLO_VO_DEINTERLACE 0x0324 | |
309 | #define SOLO_VO_DEINTERLACE_THRESHOLD(n) ((n)<<8) | |
310 | #define SOLO_VO_DEINTERLACE_EDGE_VALUE(n) ((n)<<0) | |
311 | ||
312 | #define SOLO_VO_BORDER_LINE_COLOR 0x0330 | |
313 | #define SOLO_VO_BORDER_FILL_COLOR 0x0334 | |
314 | #define SOLO_VO_BORDER_LINE_MASK 0x0338 | |
315 | #define SOLO_VO_BORDER_FILL_MASK 0x033c | |
316 | ||
317 | #define SOLO_VO_BORDER_X(n) (0x0340+((n)*4)) | |
318 | #define SOLO_VO_BORDER_Y(n) (0x0354+((n)*4)) | |
319 | ||
320 | #define SOLO_VO_CELL_EXT_SET 0x0368 | |
321 | #define SOLO_VO_CELL_EXT_START 0x036c | |
322 | #define SOLO_VO_CELL_EXT_STOP 0x0370 | |
323 | ||
324 | #define SOLO_VO_CELL_EXT_SET2 0x0374 | |
325 | #define SOLO_VO_CELL_EXT_START2 0x0378 | |
326 | #define SOLO_VO_CELL_EXT_STOP2 0x037c | |
327 | ||
328 | #define SOLO_VO_RECTANGLE_CTRL(n) (0x0368+((n)*12)) | |
329 | #define SOLO_VO_RECTANGLE_START(n) (0x036c+((n)*12)) | |
330 | #define SOLO_VO_RECTANGLE_STOP(n) (0x0370+((n)*12)) | |
331 | ||
332 | #define SOLO_VO_CURSOR_POS (0x0380) | |
333 | #define SOLO_VO_CURSOR_CLR (0x0384) | |
334 | #define SOLO_VO_CURSOR_CLR2 (0x0388) | |
335 | #define SOLO_VO_CURSOR_MASK(id) (0x0390+((id)*4)) | |
336 | ||
337 | #define SOLO_VO_EXPANSION(id) (0x0250+((id)*4)) | |
338 | ||
339 | #define SOLO_OSG_CONFIG 0x03E0 | |
340 | #define SOLO_VO_OSG_ON (1<<31) | |
341 | #define SOLO_VO_OSG_COLOR_MUTE (1<<28) | |
342 | #define SOLO_VO_OSG_ALPHA_RATE(n) ((n)<<22) | |
343 | #define SOLO_VO_OSG_ALPHA_BG_RATE(n) ((n)<<16) | |
344 | #define SOLO_VO_OSG_BASE(offset) (((offset)>>16)&0xffff) | |
345 | ||
346 | #define SOLO_OSG_ERASE 0x03E4 | |
347 | #define SOLO_OSG_ERASE_ON (0x80) | |
348 | #define SOLO_OSG_ERASE_OFF (0x00) | |
349 | ||
350 | #define SOLO_VO_OSG_BLINK 0x03E8 | |
351 | #define SOLO_VO_OSG_BLINK_ON (1<<1) | |
352 | #define SOLO_VO_OSG_BLINK_INTREVAL18 (1<<0) | |
353 | ||
354 | #define SOLO_CAP_BASE 0x0400 | |
355 | #define SOLO_CAP_MAX_PAGE(n) ((n)<<16) | |
356 | #define SOLO_CAP_BASE_ADDR(n) ((n)<<0) | |
357 | #define SOLO_CAP_BTW 0x0404 | |
358 | #define SOLO_CAP_PROG_BANDWIDTH(n) ((n)<<8) | |
359 | #define SOLO_CAP_MAX_BANDWIDTH(n) ((n)<<0) | |
360 | ||
361 | #define SOLO_DIM_SCALE1 0x0408 | |
362 | #define SOLO_DIM_SCALE2 0x040C | |
363 | #define SOLO_DIM_SCALE3 0x0410 | |
364 | #define SOLO_DIM_SCALE4 0x0414 | |
365 | #define SOLO_DIM_SCALE5 0x0418 | |
366 | #define SOLO_DIM_V_MB_NUM_FRAME(n) ((n)<<16) | |
367 | #define SOLO_DIM_V_MB_NUM_FIELD(n) ((n)<<8) | |
368 | #define SOLO_DIM_H_MB_NUM(n) ((n)<<0) | |
369 | ||
370 | #define SOLO_DIM_PROG 0x041C | |
371 | #define SOLO_CAP_STATUS 0x0420 | |
372 | ||
373 | #define SOLO_CAP_CH_SCALE(ch) (0x0440+((ch)*4)) | |
374 | #define SOLO_CAP_CH_COMP_ENA_E(ch) (0x0480+((ch)*4)) | |
375 | #define SOLO_CAP_CH_INTV(ch) (0x04C0+((ch)*4)) | |
376 | #define SOLO_CAP_CH_INTV_E(ch) (0x0500+((ch)*4)) | |
377 | ||
378 | ||
379 | #define SOLO_VE_CFG0 0x0610 | |
380 | #define SOLO_VE_TWO_PAGE_MODE (1<<31) | |
381 | #define SOLO_VE_INTR_CTRL(n) ((n)<<24) | |
382 | #define SOLO_VE_BLOCK_SIZE(n) ((n)<<16) | |
383 | #define SOLO_VE_BLOCK_BASE(n) ((n)<<0) | |
384 | ||
385 | #define SOLO_VE_CFG1 0x0614 | |
386 | #define SOLO_VE_BYTE_ALIGN(n) ((n)<<24) | |
387 | #define SOLO_VE_INSERT_INDEX (1<<18) | |
388 | #define SOLO_VE_MOTION_MODE(n) ((n)<<16) | |
389 | #define SOLO_VE_MOTION_BASE(n) ((n)<<0) | |
390 | ||
391 | #define SOLO_VE_WMRK_POLY 0x061C | |
392 | #define SOLO_VE_VMRK_INIT_KEY 0x0620 | |
393 | #define SOLO_VE_WMRK_STRL 0x0624 | |
394 | #define SOLO_VE_ENCRYP_POLY 0x0628 | |
395 | #define SOLO_VE_ENCRYP_INIT 0x062C | |
396 | #define SOLO_VE_ATTR 0x0630 | |
397 | #define SOLO_VE_LITTLE_ENDIAN (1<<31) | |
398 | #define SOLO_COMP_ATTR_RN (1<<30) | |
399 | #define SOLO_COMP_ATTR_FCODE(n) ((n)<<27) | |
400 | #define SOLO_COMP_TIME_INC(n) ((n)<<25) | |
401 | #define SOLO_COMP_TIME_WIDTH(n) ((n)<<21) | |
402 | #define SOLO_DCT_INTERVAL(n) ((n)<<16) | |
403 | ||
404 | #define SOLO_VE_STATE(n) (0x0640+((n)*4)) | |
405 | struct videnc_status { | |
406 | union { | |
407 | u32 status0; | |
408 | struct { | |
409 | u32 mp4_enc_code_size:20, sad_motion:1, vid_motion:1, | |
410 | vop_type:2, video_channel:5, source_field_idx:1, | |
411 | interlace:1, progressive:1; | |
412 | } status0_st; | |
413 | }; | |
414 | union { | |
415 | u32 status1; | |
416 | struct { | |
417 | u32 vsize:8, hsize:8, last_queue:4, foo1:8, scale:4; | |
418 | } status1_st; | |
419 | }; | |
420 | union { | |
421 | u32 status4; | |
422 | struct { | |
423 | u32 jpeg_code_size:20, interval:10, foo1:2; | |
424 | } status4_st; | |
425 | }; | |
426 | union { | |
427 | u32 status9; | |
428 | struct { | |
429 | u32 channel:5, foo1:27; | |
430 | } status9_st; | |
431 | }; | |
432 | union { | |
433 | u32 status10; | |
434 | struct { | |
435 | u32 mp4_code_size:20, foo:12; | |
436 | } status10_st; | |
437 | }; | |
438 | union { | |
439 | u32 status11; | |
440 | struct { | |
441 | u32 last_queue:8, foo1:24; | |
442 | } status11_st; | |
443 | }; | |
444 | }; | |
445 | ||
446 | #define SOLO_VE_JPEG_QP_TBL 0x0670 | |
447 | #define SOLO_VE_JPEG_QP_CH_L 0x0674 | |
448 | #define SOLO_VE_JPEG_QP_CH_H 0x0678 | |
449 | #define SOLO_VE_JPEG_CFG 0x067C | |
450 | #define SOLO_VE_JPEG_CTRL 0x0680 | |
451 | ||
452 | #define SOLO_VE_OSD_CH 0x0690 | |
453 | #define SOLO_VE_OSD_BASE 0x0694 | |
454 | #define SOLO_VE_OSD_CLR 0x0698 | |
455 | #define SOLO_VE_OSD_OPT 0x069C | |
456 | ||
457 | #define SOLO_VE_CH_INTL(ch) (0x0700+((ch)*4)) | |
458 | #define SOLO_VE_CH_MOT(ch) (0x0740+((ch)*4)) | |
459 | #define SOLO_VE_CH_QP(ch) (0x0780+((ch)*4)) | |
460 | #define SOLO_VE_CH_QP_E(ch) (0x07C0+((ch)*4)) | |
461 | #define SOLO_VE_CH_GOP(ch) (0x0800+((ch)*4)) | |
462 | #define SOLO_VE_CH_GOP_E(ch) (0x0840+((ch)*4)) | |
463 | #define SOLO_VE_CH_REF_BASE(ch) (0x0880+((ch)*4)) | |
464 | #define SOLO_VE_CH_REF_BASE_E(ch) (0x08C0+((ch)*4)) | |
465 | ||
466 | #define SOLO_VE_MPEG4_QUE(n) (0x0A00+((n)*8)) | |
467 | #define SOLO_VE_JPEG_QUE(n) (0x0A04+((n)*8)) | |
468 | ||
469 | #define SOLO_VD_CFG0 0x0900 | |
470 | #define SOLO_VD_CFG_NO_WRITE_NO_WINDOW (1<<24) | |
471 | #define SOLO_VD_CFG_BUSY_WIAT_CODE (1<<23) | |
472 | #define SOLO_VD_CFG_BUSY_WIAT_REF (1<<22) | |
473 | #define SOLO_VD_CFG_BUSY_WIAT_RES (1<<21) | |
474 | #define SOLO_VD_CFG_BUSY_WIAT_MS (1<<20) | |
475 | #define SOLO_VD_CFG_SINGLE_MODE (1<<18) | |
476 | #define SOLO_VD_CFG_SCAL_MANUAL (1<<17) | |
477 | #define SOLO_VD_CFG_USER_PAGE_CTRL (1<<16) | |
478 | #define SOLO_VD_CFG_LITTLE_ENDIAN (1<<15) | |
479 | #define SOLO_VD_CFG_START_FI (1<<14) | |
480 | #define SOLO_VD_CFG_ERR_LOCK (1<<13) | |
481 | #define SOLO_VD_CFG_ERR_INT_ENA (1<<12) | |
482 | #define SOLO_VD_CFG_TIME_WIDTH(n) ((n)<<8) | |
483 | #define SOLO_VD_CFG_DCT_INTERVAL(n) ((n)<<0) | |
484 | ||
485 | #define SOLO_VD_CFG1 0x0904 | |
486 | ||
487 | #define SOLO_VD_DEINTERLACE 0x0908 | |
488 | #define SOLO_VD_DEINTERLACE_THRESHOLD(n) ((n)<<8) | |
489 | #define SOLO_VD_DEINTERLACE_EDGE_VALUE(n) ((n)<<0) | |
490 | ||
491 | #define SOLO_VD_CODE_ADR 0x090C | |
492 | ||
493 | #define SOLO_VD_CTRL 0x0910 | |
494 | #define SOLO_VD_OPER_ON (1<<31) | |
495 | #define SOLO_VD_MAX_ITEM(n) ((n)<<0) | |
496 | ||
497 | #define SOLO_VD_STATUS0 0x0920 | |
498 | #define SOLO_VD_STATUS0_INTR_ACK (1<<22) | |
499 | #define SOLO_VD_STATUS0_INTR_EMPTY (1<<21) | |
500 | #define SOLO_VD_STATUS0_INTR_ERR (1<<20) | |
501 | ||
502 | #define SOLO_VD_STATUS1 0x0924 | |
503 | ||
504 | #define SOLO_VD_IDX0 0x0930 | |
505 | #define SOLO_VD_IDX_INTERLACE (1<<30) | |
506 | #define SOLO_VD_IDX_CHANNEL(n) ((n)<<24) | |
507 | #define SOLO_VD_IDX_SIZE(n) ((n)<<0) | |
508 | ||
509 | #define SOLO_VD_IDX1 0x0934 | |
510 | #define SOLO_VD_IDX_SRC_SCALE(n) ((n)<<28) | |
511 | #define SOLO_VD_IDX_WINDOW(n) ((n)<<24) | |
512 | #define SOLO_VD_IDX_DEINTERLACE (1<<16) | |
513 | #define SOLO_VD_IDX_H_BLOCK(n) ((n)<<8) | |
514 | #define SOLO_VD_IDX_V_BLOCK(n) ((n)<<0) | |
515 | ||
516 | #define SOLO_VD_IDX2 0x0938 | |
517 | #define SOLO_VD_IDX_REF_BASE_SIDE (1<<31) | |
518 | #define SOLO_VD_IDX_REF_BASE(n) (((n)>>16)&0xffff) | |
519 | ||
520 | #define SOLO_VD_IDX3 0x093C | |
521 | #define SOLO_VD_IDX_DISP_SCALE(n) ((n)<<28) | |
522 | #define SOLO_VD_IDX_INTERLACE_WR (1<<27) | |
523 | #define SOLO_VD_IDX_INTERPOL (1<<26) | |
524 | #define SOLO_VD_IDX_HOR2X (1<<25) | |
525 | #define SOLO_VD_IDX_OFFSET_X(n) ((n)<<12) | |
526 | #define SOLO_VD_IDX_OFFSET_Y(n) ((n)<<0) | |
527 | ||
528 | #define SOLO_VD_IDX4 0x0940 | |
529 | #define SOLO_VD_IDX_DEC_WR_PAGE(n) ((n)<<8) | |
530 | #define SOLO_VD_IDX_DISP_RD_PAGE(n) ((n)<<0) | |
531 | ||
532 | #define SOLO_VD_WR_PAGE(n) (0x03F0 + ((n) * 4)) | |
533 | ||
534 | ||
535 | #define SOLO_GPIO_CONFIG_0 0x0B00 | |
536 | #define SOLO_GPIO_CONFIG_1 0x0B04 | |
537 | #define SOLO_GPIO_DATA_OUT 0x0B08 | |
538 | #define SOLO_GPIO_DATA_IN 0x0B0C | |
539 | #define SOLO_GPIO_INT_ACK_STA 0x0B10 | |
540 | #define SOLO_GPIO_INT_ENA 0x0B14 | |
541 | #define SOLO_GPIO_INT_CFG_0 0x0B18 | |
542 | #define SOLO_GPIO_INT_CFG_1 0x0B1C | |
543 | ||
544 | ||
545 | #define SOLO_IIC_CFG 0x0B20 | |
546 | #define SOLO_IIC_ENABLE (1<<8) | |
547 | #define SOLO_IIC_PRESCALE(n) ((n)<<0) | |
548 | ||
549 | #define SOLO_IIC_CTRL 0x0B24 | |
550 | #define SOLO_IIC_AUTO_CLEAR (1<<20) | |
551 | #define SOLO_IIC_STATE_RX_ACK (1<<19) | |
552 | #define SOLO_IIC_STATE_BUSY (1<<18) | |
553 | #define SOLO_IIC_STATE_SIG_ERR (1<<17) | |
554 | #define SOLO_IIC_STATE_TRNS (1<<16) | |
555 | #define SOLO_IIC_CH_SET(n) ((n)<<5) | |
556 | #define SOLO_IIC_ACK_EN (1<<4) | |
557 | #define SOLO_IIC_START (1<<3) | |
558 | #define SOLO_IIC_STOP (1<<2) | |
559 | #define SOLO_IIC_READ (1<<1) | |
560 | #define SOLO_IIC_WRITE (1<<0) | |
561 | ||
562 | #define SOLO_IIC_TXD 0x0B28 | |
563 | #define SOLO_IIC_RXD 0x0B2C | |
564 | ||
565 | /* | |
566 | * UART REGISTER | |
567 | */ | |
568 | #define SOLO_UART_CONTROL(n) (0x0BA0 + ((n)*0x20)) | |
569 | #define SOLO_UART_CLK_DIV(n) ((n)<<24) | |
570 | #define SOLO_MODEM_CTRL_EN (1<<20) | |
571 | #define SOLO_PARITY_ERROR_DROP (1<<18) | |
572 | #define SOLO_IRQ_ERR_EN (1<<17) | |
573 | #define SOLO_IRQ_RX_EN (1<<16) | |
574 | #define SOLO_IRQ_TX_EN (1<<15) | |
575 | #define SOLO_RX_EN (1<<14) | |
576 | #define SOLO_TX_EN (1<<13) | |
577 | #define SOLO_UART_HALF_DUPLEX (1<<12) | |
578 | #define SOLO_UART_LOOPBACK (1<<11) | |
579 | ||
580 | #define SOLO_BAUDRATE_230400 ((0<<9)|(0<<6)) | |
581 | #define SOLO_BAUDRATE_115200 ((0<<9)|(1<<6)) | |
582 | #define SOLO_BAUDRATE_57600 ((0<<9)|(2<<6)) | |
583 | #define SOLO_BAUDRATE_38400 ((0<<9)|(3<<6)) | |
584 | #define SOLO_BAUDRATE_19200 ((0<<9)|(4<<6)) | |
585 | #define SOLO_BAUDRATE_9600 ((0<<9)|(5<<6)) | |
586 | #define SOLO_BAUDRATE_4800 ((0<<9)|(6<<6)) | |
587 | #define SOLO_BAUDRATE_2400 ((1<<9)|(6<<6)) | |
588 | #define SOLO_BAUDRATE_1200 ((2<<9)|(6<<6)) | |
589 | #define SOLO_BAUDRATE_300 ((3<<9)|(6<<6)) | |
590 | ||
591 | #define SOLO_UART_DATA_BIT_8 (3<<4) | |
592 | #define SOLO_UART_DATA_BIT_7 (2<<4) | |
593 | #define SOLO_UART_DATA_BIT_6 (1<<4) | |
594 | #define SOLO_UART_DATA_BIT_5 (0<<4) | |
595 | ||
596 | #define SOLO_UART_STOP_BIT_1 (0<<2) | |
597 | #define SOLO_UART_STOP_BIT_2 (1<<2) | |
598 | ||
599 | #define SOLO_UART_PARITY_NONE (0<<0) | |
600 | #define SOLO_UART_PARITY_EVEN (2<<0) | |
601 | #define SOLO_UART_PARITY_ODD (3<<0) | |
602 | ||
603 | #define SOLO_UART_STATUS(n) (0x0BA4 + ((n)*0x20)) | |
604 | #define SOLO_UART_CTS (1<<15) | |
605 | #define SOLO_UART_RX_BUSY (1<<14) | |
606 | #define SOLO_UART_OVERRUN (1<<13) | |
607 | #define SOLO_UART_FRAME_ERR (1<<12) | |
608 | #define SOLO_UART_PARITY_ERR (1<<11) | |
609 | #define SOLO_UART_TX_BUSY (1<<5) | |
610 | ||
611 | #define SOLO_UART_RX_BUFF_CNT(stat) (((stat)>>6) & 0x1f) | |
612 | #define SOLO_UART_RX_BUFF_SIZE 8 | |
613 | #define SOLO_UART_TX_BUFF_CNT(stat) (((stat)>>0) & 0x1f) | |
614 | #define SOLO_UART_TX_BUFF_SIZE 8 | |
615 | ||
616 | #define SOLO_UART_TX_DATA(n) (0x0BA8 + ((n)*0x20)) | |
617 | #define SOLO_UART_TX_DATA_PUSH (1<<8) | |
618 | #define SOLO_UART_RX_DATA(n) (0x0BAC + ((n)*0x20)) | |
619 | #define SOLO_UART_RX_DATA_POP (1<<8) | |
620 | ||
621 | #define SOLO_TIMER_CLOCK_NUM 0x0be0 | |
622 | #define SOLO_TIMER_WATCHDOG 0x0be4 | |
623 | #define SOLO_TIMER_USEC 0x0be8 | |
624 | #define SOLO_TIMER_SEC 0x0bec | |
625 | ||
626 | #define SOLO_AUDIO_CONTROL 0x0D00 | |
627 | #define SOLO_AUDIO_ENABLE (1<<31) | |
628 | #define SOLO_AUDIO_MASTER_MODE (1<<30) | |
629 | #define SOLO_AUDIO_I2S_MODE (1<<29) | |
630 | #define SOLO_AUDIO_I2S_LR_SWAP (1<<27) | |
631 | #define SOLO_AUDIO_I2S_8BIT (1<<26) | |
632 | #define SOLO_AUDIO_I2S_MULTI(n) ((n)<<24) | |
633 | #define SOLO_AUDIO_MIX_9TO0 (1<<23) | |
634 | #define SOLO_AUDIO_DEC_9TO0_VOL(n) ((n)<<20) | |
635 | #define SOLO_AUDIO_MIX_19TO10 (1<<19) | |
636 | #define SOLO_AUDIO_DEC_19TO10_VOL(n) ((n)<<16) | |
637 | #define SOLO_AUDIO_MODE(n) ((n)<<0) | |
638 | #define SOLO_AUDIO_SAMPLE 0x0D04 | |
639 | #define SOLO_AUDIO_EE_MODE_ON (1<<30) | |
640 | #define SOLO_AUDIO_EE_ENC_CH(ch) ((ch)<<25) | |
641 | #define SOLO_AUDIO_BITRATE(n) ((n)<<16) | |
642 | #define SOLO_AUDIO_CLK_DIV(n) ((n)<<0) | |
643 | #define SOLO_AUDIO_FDMA_INTR 0x0D08 | |
644 | #define SOLO_AUDIO_FDMA_INTERVAL(n) ((n)<<19) | |
645 | #define SOLO_AUDIO_INTR_ORDER(n) ((n)<<16) | |
646 | #define SOLO_AUDIO_FDMA_BASE(n) ((n)<<0) | |
647 | #define SOLO_AUDIO_EVOL_0 0x0D0C | |
648 | #define SOLO_AUDIO_EVOL_1 0x0D10 | |
649 | #define SOLO_AUDIO_EVOL(ch, value) ((value)<<((ch)%10)) | |
650 | #define SOLO_AUDIO_STA 0x0D14 | |
651 | ||
652 | ||
653 | #define SOLO_WATCHDOG 0x0BE4 | |
654 | #define WATCHDOG_STAT(status) (status<<8) | |
655 | #define WATCHDOG_TIME(sec) (sec&0xff) | |
656 | ||
657 | #endif /* __SOLO6010_REGISTERS_H */ |