xref: /linux/drivers/video/fbdev/cyber2000fb.h (revision 75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37)
1*d2912cb1SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
2f7018c21STomi Valkeinen /*
3f7018c21STomi Valkeinen  *  linux/drivers/video/cyber2000fb.h
4f7018c21STomi Valkeinen  *
5f7018c21STomi Valkeinen  *  Copyright (C) 1998-2000 Russell King
6f7018c21STomi Valkeinen  *
7f7018c21STomi Valkeinen  * Integraphics Cyber2000 frame buffer device
8f7018c21STomi Valkeinen  */
9f7018c21STomi Valkeinen 
10f7018c21STomi Valkeinen /*
11f7018c21STomi Valkeinen  * Internal CyberPro sizes and offsets.
12f7018c21STomi Valkeinen  */
13f7018c21STomi Valkeinen #define MMIO_OFFSET	0x00800000
14f7018c21STomi Valkeinen #define MMIO_SIZE	0x000c0000
15f7018c21STomi Valkeinen 
16f7018c21STomi Valkeinen #define NR_PALETTE	256
17f7018c21STomi Valkeinen 
18f7018c21STomi Valkeinen #if defined(DEBUG) && defined(CONFIG_DEBUG_LL)
debug_printf(char * fmt,...)19f7018c21STomi Valkeinen static void debug_printf(char *fmt, ...)
20f7018c21STomi Valkeinen {
21f7018c21STomi Valkeinen 	extern void printascii(const char *);
22f7018c21STomi Valkeinen 	char buffer[128];
23f7018c21STomi Valkeinen 	va_list ap;
24f7018c21STomi Valkeinen 
25f7018c21STomi Valkeinen 	va_start(ap, fmt);
26f7018c21STomi Valkeinen 	vsprintf(buffer, fmt, ap);
27f7018c21STomi Valkeinen 	va_end(ap);
28f7018c21STomi Valkeinen 
29f7018c21STomi Valkeinen 	printascii(buffer);
30f7018c21STomi Valkeinen }
31f7018c21STomi Valkeinen #else
32f7018c21STomi Valkeinen #define debug_printf(x...) do { } while (0)
33f7018c21STomi Valkeinen #endif
34f7018c21STomi Valkeinen 
35f7018c21STomi Valkeinen #define RAMDAC_RAMPWRDN		0x01
36f7018c21STomi Valkeinen #define RAMDAC_DAC8BIT		0x02
37f7018c21STomi Valkeinen #define RAMDAC_VREFEN		0x04
38f7018c21STomi Valkeinen #define RAMDAC_BYPASS		0x10
39f7018c21STomi Valkeinen #define RAMDAC_DACPWRDN		0x40
40f7018c21STomi Valkeinen 
41f7018c21STomi Valkeinen #define EXT_CRT_VRTOFL		0x11
42f7018c21STomi Valkeinen #define EXT_CRT_VRTOFL_LINECOMP10	0x10
43f7018c21STomi Valkeinen #define EXT_CRT_VRTOFL_INTERLACE	0x20
44f7018c21STomi Valkeinen 
45f7018c21STomi Valkeinen #define EXT_CRT_IRQ		0x12
46f7018c21STomi Valkeinen #define EXT_CRT_IRQ_ENABLE		0x01
47f7018c21STomi Valkeinen #define EXT_CRT_IRQ_ACT_HIGH		0x04
48f7018c21STomi Valkeinen 
49f7018c21STomi Valkeinen #define EXT_CRT_TEST		0x13
50f7018c21STomi Valkeinen 
51f7018c21STomi Valkeinen #define EXT_SYNC_CTL		0x16
52f7018c21STomi Valkeinen #define EXT_SYNC_CTL_HS_NORMAL		0x00
53f7018c21STomi Valkeinen #define EXT_SYNC_CTL_HS_0		0x01
54f7018c21STomi Valkeinen #define EXT_SYNC_CTL_HS_1		0x02
55f7018c21STomi Valkeinen #define EXT_SYNC_CTL_HS_HSVS		0x03
56f7018c21STomi Valkeinen #define EXT_SYNC_CTL_VS_NORMAL		0x00
57f7018c21STomi Valkeinen #define EXT_SYNC_CTL_VS_0		0x04
58f7018c21STomi Valkeinen #define EXT_SYNC_CTL_VS_1		0x08
59f7018c21STomi Valkeinen #define EXT_SYNC_CTL_VS_COMP		0x0c
60f7018c21STomi Valkeinen 
61f7018c21STomi Valkeinen #define EXT_BUS_CTL		0x30
62f7018c21STomi Valkeinen #define EXT_BUS_CTL_LIN_1MB		0x00
63f7018c21STomi Valkeinen #define EXT_BUS_CTL_LIN_2MB		0x01
64f7018c21STomi Valkeinen #define EXT_BUS_CTL_LIN_4MB		0x02
65f7018c21STomi Valkeinen #define EXT_BUS_CTL_ZEROWAIT		0x04
66f7018c21STomi Valkeinen #define EXT_BUS_CTL_PCIBURST_WRITE	0x20
67f7018c21STomi Valkeinen #define EXT_BUS_CTL_PCIBURST_READ	0x80	/* CyberPro 5000 only */
68f7018c21STomi Valkeinen 
69f7018c21STomi Valkeinen #define EXT_SEG_WRITE_PTR	0x31
70f7018c21STomi Valkeinen #define EXT_SEG_READ_PTR	0x32
71f7018c21STomi Valkeinen #define EXT_BIU_MISC		0x33
72f7018c21STomi Valkeinen #define EXT_BIU_MISC_LIN_ENABLE		0x01
73f7018c21STomi Valkeinen #define EXT_BIU_MISC_COP_ENABLE		0x04
74f7018c21STomi Valkeinen #define EXT_BIU_MISC_COP_BFC		0x08
75f7018c21STomi Valkeinen 
76f7018c21STomi Valkeinen #define EXT_FUNC_CTL		0x3c
77f7018c21STomi Valkeinen #define EXT_FUNC_CTL_EXTREGENBL		0x80	/* enable access to 0xbcxxx		*/
78f7018c21STomi Valkeinen 
79f7018c21STomi Valkeinen #define PCI_BM_CTL		0x3e
80f7018c21STomi Valkeinen #define PCI_BM_CTL_ENABLE		0x01	/* enable bus-master			*/
81f7018c21STomi Valkeinen #define PCI_BM_CTL_BURST		0x02	/* enable burst				*/
82f7018c21STomi Valkeinen #define PCI_BM_CTL_BACK2BACK		0x04	/* enable back to back			*/
83f7018c21STomi Valkeinen #define PCI_BM_CTL_DUMMY		0x08	/* insert dummy cycle			*/
84f7018c21STomi Valkeinen 
85f7018c21STomi Valkeinen #define X_V2_VID_MEM_START	0x40
86f7018c21STomi Valkeinen #define X_V2_VID_SRC_WIDTH	0x43
87f7018c21STomi Valkeinen #define X_V2_X_START		0x45
88f7018c21STomi Valkeinen #define X_V2_X_END		0x47
89f7018c21STomi Valkeinen #define X_V2_Y_START		0x49
90f7018c21STomi Valkeinen #define X_V2_Y_END		0x4b
91f7018c21STomi Valkeinen #define X_V2_VID_SRC_WIN_WIDTH	0x4d
92f7018c21STomi Valkeinen 
93f7018c21STomi Valkeinen #define Y_V2_DDA_X_INC		0x43
94f7018c21STomi Valkeinen #define Y_V2_DDA_Y_INC		0x47
95f7018c21STomi Valkeinen #define Y_V2_VID_FIFO_CTL	0x49
96f7018c21STomi Valkeinen #define Y_V2_VID_FMT		0x4b
97f7018c21STomi Valkeinen #define Y_V2_VID_DISP_CTL1	0x4c
98f7018c21STomi Valkeinen #define Y_V2_VID_FIFO_CTL1	0x4d
99f7018c21STomi Valkeinen 
100f7018c21STomi Valkeinen #define J_X2_VID_MEM_START	0x40
101f7018c21STomi Valkeinen #define J_X2_VID_SRC_WIDTH	0x43
102f7018c21STomi Valkeinen #define J_X2_X_START		0x47
103f7018c21STomi Valkeinen #define J_X2_X_END		0x49
104f7018c21STomi Valkeinen #define J_X2_Y_START		0x4b
105f7018c21STomi Valkeinen #define J_X2_Y_END		0x4d
106f7018c21STomi Valkeinen #define J_X2_VID_SRC_WIN_WIDTH	0x4f
107f7018c21STomi Valkeinen 
108f7018c21STomi Valkeinen #define K_X2_DDA_X_INIT		0x40
109f7018c21STomi Valkeinen #define K_X2_DDA_X_INC		0x42
110f7018c21STomi Valkeinen #define K_X2_DDA_Y_INIT		0x44
111f7018c21STomi Valkeinen #define K_X2_DDA_Y_INC		0x46
112f7018c21STomi Valkeinen #define K_X2_VID_FMT		0x48
113f7018c21STomi Valkeinen #define K_X2_VID_DISP_CTL1	0x49
114f7018c21STomi Valkeinen 
115f7018c21STomi Valkeinen #define K_CAP_X2_CTL1		0x49
116f7018c21STomi Valkeinen 
117f7018c21STomi Valkeinen #define CURS_H_START		0x50
118f7018c21STomi Valkeinen #define CURS_H_PRESET		0x52
119f7018c21STomi Valkeinen #define CURS_V_START		0x53
120f7018c21STomi Valkeinen #define CURS_V_PRESET		0x55
121f7018c21STomi Valkeinen #define CURS_CTL		0x56
122f7018c21STomi Valkeinen 
123f7018c21STomi Valkeinen #define EXT_ATTRIB_CTL		0x57
124f7018c21STomi Valkeinen #define EXT_ATTRIB_CTL_EXT		0x01
125f7018c21STomi Valkeinen 
126f7018c21STomi Valkeinen #define EXT_OVERSCAN_RED	0x58
127f7018c21STomi Valkeinen #define EXT_OVERSCAN_GREEN	0x59
128f7018c21STomi Valkeinen #define EXT_OVERSCAN_BLUE	0x5a
129f7018c21STomi Valkeinen 
130f7018c21STomi Valkeinen #define CAP_X_START		0x60
131f7018c21STomi Valkeinen #define CAP_X_END		0x62
132f7018c21STomi Valkeinen #define CAP_Y_START		0x64
133f7018c21STomi Valkeinen #define CAP_Y_END		0x66
134f7018c21STomi Valkeinen #define CAP_DDA_X_INIT		0x68
135f7018c21STomi Valkeinen #define CAP_DDA_X_INC		0x6a
136f7018c21STomi Valkeinen #define CAP_DDA_Y_INIT		0x6c
137f7018c21STomi Valkeinen #define CAP_DDA_Y_INC		0x6e
138f7018c21STomi Valkeinen 
139f7018c21STomi Valkeinen #define EXT_MEM_CTL0		0x70
140f7018c21STomi Valkeinen #define EXT_MEM_CTL0_7CLK		0x01
141f7018c21STomi Valkeinen #define EXT_MEM_CTL0_RAS_1		0x02
142f7018c21STomi Valkeinen #define EXT_MEM_CTL0_RAS2CAS_1		0x04
143f7018c21STomi Valkeinen #define EXT_MEM_CTL0_MULTCAS		0x08
144f7018c21STomi Valkeinen #define EXT_MEM_CTL0_ASYM		0x10
145f7018c21STomi Valkeinen #define EXT_MEM_CTL0_CAS1ON		0x20
146f7018c21STomi Valkeinen #define EXT_MEM_CTL0_FIFOFLUSH		0x40
147f7018c21STomi Valkeinen #define EXT_MEM_CTL0_SEQRESET		0x80
148f7018c21STomi Valkeinen 
149f7018c21STomi Valkeinen #define EXT_MEM_CTL1		0x71
150f7018c21STomi Valkeinen #define EXT_MEM_CTL1_PAR		0x00
151f7018c21STomi Valkeinen #define EXT_MEM_CTL1_SERPAR		0x01
152f7018c21STomi Valkeinen #define EXT_MEM_CTL1_SER		0x03
153f7018c21STomi Valkeinen #define EXT_MEM_CTL1_SYNC		0x04
154f7018c21STomi Valkeinen #define EXT_MEM_CTL1_VRAM		0x08
155f7018c21STomi Valkeinen #define EXT_MEM_CTL1_4K_REFRESH		0x10
156f7018c21STomi Valkeinen #define EXT_MEM_CTL1_256Kx4		0x00
157f7018c21STomi Valkeinen #define EXT_MEM_CTL1_512Kx8		0x40
158f7018c21STomi Valkeinen #define EXT_MEM_CTL1_1Mx16		0x60
159f7018c21STomi Valkeinen 
160f7018c21STomi Valkeinen #define EXT_MEM_CTL2		0x72
161f7018c21STomi Valkeinen #define MEM_CTL2_SIZE_1MB		0x00
162f7018c21STomi Valkeinen #define MEM_CTL2_SIZE_2MB		0x01
163f7018c21STomi Valkeinen #define MEM_CTL2_SIZE_4MB		0x02
164f7018c21STomi Valkeinen #define MEM_CTL2_SIZE_MASK		0x03
165f7018c21STomi Valkeinen #define MEM_CTL2_64BIT			0x04
166f7018c21STomi Valkeinen 
167f7018c21STomi Valkeinen #define EXT_HIDDEN_CTL1		0x73
168f7018c21STomi Valkeinen 
169f7018c21STomi Valkeinen #define EXT_FIFO_CTL		0x74
170f7018c21STomi Valkeinen 
171f7018c21STomi Valkeinen #define EXT_SEQ_MISC		0x77
172f7018c21STomi Valkeinen #define EXT_SEQ_MISC_8			0x01
173f7018c21STomi Valkeinen #define EXT_SEQ_MISC_16_RGB565		0x02
174f7018c21STomi Valkeinen #define EXT_SEQ_MISC_32			0x03
175f7018c21STomi Valkeinen #define EXT_SEQ_MISC_24_RGB888		0x04
176f7018c21STomi Valkeinen #define EXT_SEQ_MISC_16_RGB555		0x06
177f7018c21STomi Valkeinen #define EXT_SEQ_MISC_8_RGB332		0x09
178f7018c21STomi Valkeinen #define EXT_SEQ_MISC_16_RGB444		0x0a
179f7018c21STomi Valkeinen 
180f7018c21STomi Valkeinen #define EXT_HIDDEN_CTL4		0x7a
181f7018c21STomi Valkeinen 
182f7018c21STomi Valkeinen #define CURS_MEM_START		0x7e		/* bits 23..12 */
183f7018c21STomi Valkeinen 
184f7018c21STomi Valkeinen #define CAP_PIP_X_START		0x80
185f7018c21STomi Valkeinen #define CAP_PIP_X_END		0x82
186f7018c21STomi Valkeinen #define CAP_PIP_Y_START		0x84
187f7018c21STomi Valkeinen #define CAP_PIP_Y_END		0x86
188f7018c21STomi Valkeinen 
189f7018c21STomi Valkeinen #define EXT_CAP_CTL1		0x88
190f7018c21STomi Valkeinen 
191f7018c21STomi Valkeinen #define EXT_CAP_CTL2		0x89
192f7018c21STomi Valkeinen #define EXT_CAP_CTL2_ODDFRAMEIRQ	0x01
193f7018c21STomi Valkeinen #define EXT_CAP_CTL2_ANYFRAMEIRQ	0x02
194f7018c21STomi Valkeinen 
195f7018c21STomi Valkeinen #define BM_CTRL0		0x9c
196f7018c21STomi Valkeinen #define BM_CTRL1		0x9d
197f7018c21STomi Valkeinen 
198f7018c21STomi Valkeinen #define EXT_CAP_MODE1		0xa4
199f7018c21STomi Valkeinen #define EXT_CAP_MODE1_8BIT		0x01	/* enable 8bit capture mode		*/
200f7018c21STomi Valkeinen #define EXT_CAP_MODE1_CCIR656		0x02	/* CCIR656 mode				*/
201f7018c21STomi Valkeinen #define EXT_CAP_MODE1_IGNOREVGT		0x04	/* ignore VGT				*/
202f7018c21STomi Valkeinen #define EXT_CAP_MODE1_ALTFIFO		0x10	/* use alternate FIFO for capture	*/
203f7018c21STomi Valkeinen #define EXT_CAP_MODE1_SWAPUV		0x20	/* swap UV bytes			*/
204f7018c21STomi Valkeinen #define EXT_CAP_MODE1_MIRRORY		0x40	/* mirror vertically			*/
205f7018c21STomi Valkeinen #define EXT_CAP_MODE1_MIRRORX		0x80	/* mirror horizontally			*/
206f7018c21STomi Valkeinen 
207f7018c21STomi Valkeinen #define EXT_CAP_MODE2		0xa5
208f7018c21STomi Valkeinen #define EXT_CAP_MODE2_CCIRINVOE		0x01
209f7018c21STomi Valkeinen #define EXT_CAP_MODE2_CCIRINVVGT	0x02
210f7018c21STomi Valkeinen #define EXT_CAP_MODE2_CCIRINVHGT	0x04
211f7018c21STomi Valkeinen #define EXT_CAP_MODE2_CCIRINVDG		0x08
212f7018c21STomi Valkeinen #define EXT_CAP_MODE2_DATEND		0x10
213f7018c21STomi Valkeinen #define EXT_CAP_MODE2_CCIRDGH		0x20
214f7018c21STomi Valkeinen #define EXT_CAP_MODE2_FIXSONY		0x40
215f7018c21STomi Valkeinen #define EXT_CAP_MODE2_SYNCFREEZE	0x80
216f7018c21STomi Valkeinen 
217f7018c21STomi Valkeinen #define EXT_TV_CTL		0xae
218f7018c21STomi Valkeinen 
219f7018c21STomi Valkeinen #define EXT_DCLK_MULT		0xb0
220f7018c21STomi Valkeinen #define EXT_DCLK_DIV		0xb1
221f7018c21STomi Valkeinen #define EXT_DCLK_DIV_VFSEL		0x20
222f7018c21STomi Valkeinen #define EXT_MCLK_MULT		0xb2
223f7018c21STomi Valkeinen #define EXT_MCLK_DIV		0xb3
224f7018c21STomi Valkeinen 
225f7018c21STomi Valkeinen #define EXT_LATCH1		0xb5
226f7018c21STomi Valkeinen #define EXT_LATCH1_VAFC_EN		0x01	/* enable VAFC				*/
227f7018c21STomi Valkeinen 
228f7018c21STomi Valkeinen #define EXT_FEATURE		0xb7
229f7018c21STomi Valkeinen #define EXT_FEATURE_BUS_MASK		0x07	/* host bus mask			*/
230f7018c21STomi Valkeinen #define EXT_FEATURE_BUS_PCI		0x00
231f7018c21STomi Valkeinen #define EXT_FEATURE_BUS_VL_STD		0x04
232f7018c21STomi Valkeinen #define EXT_FEATURE_BUS_VL_LINEAR	0x05
233f7018c21STomi Valkeinen #define EXT_FEATURE_1682		0x20	/* IGS 1682 compatibility		*/
234f7018c21STomi Valkeinen 
235f7018c21STomi Valkeinen #define EXT_LATCH2		0xb6
236f7018c21STomi Valkeinen #define EXT_LATCH2_I2C_CLKEN		0x10
237f7018c21STomi Valkeinen #define EXT_LATCH2_I2C_CLK		0x20
238f7018c21STomi Valkeinen #define EXT_LATCH2_I2C_DATEN		0x40
239f7018c21STomi Valkeinen #define EXT_LATCH2_I2C_DAT		0x80
240f7018c21STomi Valkeinen 
241f7018c21STomi Valkeinen #define EXT_XT_CTL		0xbe
242f7018c21STomi Valkeinen #define EXT_XT_CAP16			0x04
243f7018c21STomi Valkeinen #define EXT_XT_LINEARFB			0x08
244f7018c21STomi Valkeinen #define EXT_XT_PAL			0x10
245f7018c21STomi Valkeinen 
246f7018c21STomi Valkeinen #define EXT_MEM_START		0xc0		/* ext start address 21 bits		*/
247f7018c21STomi Valkeinen #define HOR_PHASE_SHIFT		0xc2		/* high 3 bits				*/
248f7018c21STomi Valkeinen #define EXT_SRC_WIDTH		0xc3		/* ext offset phase  10 bits		*/
249f7018c21STomi Valkeinen #define EXT_SRC_HEIGHT		0xc4		/* high 6 bits				*/
250f7018c21STomi Valkeinen #define EXT_X_START		0xc5		/* ext->screen, 16 bits			*/
251f7018c21STomi Valkeinen #define EXT_X_END		0xc7		/* ext->screen, 16 bits			*/
252f7018c21STomi Valkeinen #define EXT_Y_START		0xc9		/* ext->screen, 16 bits			*/
253f7018c21STomi Valkeinen #define EXT_Y_END		0xcb		/* ext->screen, 16 bits			*/
254f7018c21STomi Valkeinen #define EXT_SRC_WIN_WIDTH	0xcd		/* 8 bits				*/
255f7018c21STomi Valkeinen #define EXT_COLOUR_COMPARE	0xce		/* 24 bits				*/
256f7018c21STomi Valkeinen #define EXT_DDA_X_INIT		0xd1		/* ext->screen 16 bits			*/
257f7018c21STomi Valkeinen #define EXT_DDA_X_INC		0xd3		/* ext->screen 16 bits			*/
258f7018c21STomi Valkeinen #define EXT_DDA_Y_INIT		0xd5		/* ext->screen 16 bits			*/
259f7018c21STomi Valkeinen #define EXT_DDA_Y_INC		0xd7		/* ext->screen 16 bits			*/
260f7018c21STomi Valkeinen 
261f7018c21STomi Valkeinen #define EXT_VID_FIFO_CTL	0xd9
262f7018c21STomi Valkeinen 
263f7018c21STomi Valkeinen #define EXT_VID_FMT		0xdb
264f7018c21STomi Valkeinen #define EXT_VID_FMT_YUV422		0x00	/* formats - does this cause conversion? */
265f7018c21STomi Valkeinen #define EXT_VID_FMT_RGB555		0x01
266f7018c21STomi Valkeinen #define EXT_VID_FMT_RGB565		0x02
267f7018c21STomi Valkeinen #define EXT_VID_FMT_RGB888_24		0x03
268f7018c21STomi Valkeinen #define EXT_VID_FMT_RGB888_32		0x04
269f7018c21STomi Valkeinen #define EXT_VID_FMT_RGB8		0x05
270f7018c21STomi Valkeinen #define EXT_VID_FMT_RGB4444		0x06
271f7018c21STomi Valkeinen #define EXT_VID_FMT_RGB8T		0x07
272f7018c21STomi Valkeinen #define EXT_VID_FMT_DUP_PIX_ZOON	0x08	/* duplicate pixel zoom			*/
273f7018c21STomi Valkeinen #define EXT_VID_FMT_MOD_3RD_PIX		0x20	/* modify 3rd duplicated pixel		*/
274f7018c21STomi Valkeinen #define EXT_VID_FMT_DBL_H_PIX		0x40	/* double horiz pixels			*/
275f7018c21STomi Valkeinen #define EXT_VID_FMT_YUV128		0x80	/* YUV data offset by 128		*/
276f7018c21STomi Valkeinen 
277f7018c21STomi Valkeinen #define EXT_VID_DISP_CTL1	0xdc
278f7018c21STomi Valkeinen #define EXT_VID_DISP_CTL1_INTRAM	0x01	/* video pixels go to internal RAM	*/
279f7018c21STomi Valkeinen #define EXT_VID_DISP_CTL1_IGNORE_CCOMP	0x02	/* ignore colour compare registers	*/
280f7018c21STomi Valkeinen #define EXT_VID_DISP_CTL1_NOCLIP	0x04	/* do not clip to 16235,16240		*/
281f7018c21STomi Valkeinen #define EXT_VID_DISP_CTL1_UV_AVG	0x08	/* U/V data is averaged			*/
282f7018c21STomi Valkeinen #define EXT_VID_DISP_CTL1_Y128		0x10	/* Y data offset by 128 (if YUV128 set)	*/
283f7018c21STomi Valkeinen #define EXT_VID_DISP_CTL1_VINTERPOL_OFF	0x20	/* disable vertical interpolation	*/
284f7018c21STomi Valkeinen #define EXT_VID_DISP_CTL1_FULL_WIN	0x40	/* video out window full		*/
285f7018c21STomi Valkeinen #define EXT_VID_DISP_CTL1_ENABLE_WINDOW	0x80	/* enable video window			*/
286f7018c21STomi Valkeinen 
287f7018c21STomi Valkeinen #define EXT_VID_FIFO_CTL1	0xdd
288f7018c21STomi Valkeinen #define EXT_VID_FIFO_CTL1_OE_HIGH	0x02
289f7018c21STomi Valkeinen #define EXT_VID_FIFO_CTL1_INTERLEAVE	0x04	/* enable interleaved memory read	*/
290f7018c21STomi Valkeinen 
291f7018c21STomi Valkeinen #define EXT_ROM_UCB4GH		0xe5
292f7018c21STomi Valkeinen #define EXT_ROM_UCB4GH_FREEZE		0x02	/* capture frozen			*/
293f7018c21STomi Valkeinen #define EXT_ROM_UCB4GH_ODDFRAME		0x04	/* 1 = odd frame captured		*/
294f7018c21STomi Valkeinen #define EXT_ROM_UCB4GH_1HL		0x08	/* first horizonal line after VGT falling edge */
295f7018c21STomi Valkeinen #define EXT_ROM_UCB4GH_ODD		0x10	/* odd frame indicator			*/
296f7018c21STomi Valkeinen #define EXT_ROM_UCB4GH_INTSTAT		0x20	/* video interrupt			*/
297f7018c21STomi Valkeinen 
298f7018c21STomi Valkeinen #define VFAC_CTL1		0xe8
299f7018c21STomi Valkeinen #define VFAC_CTL1_CAPTURE		0x01	/* capture enable (only when VSYNC high)*/
300f7018c21STomi Valkeinen #define VFAC_CTL1_VFAC_ENABLE		0x02	/* vfac enable				*/
301f7018c21STomi Valkeinen #define VFAC_CTL1_FREEZE_CAPTURE	0x04	/* freeze capture			*/
302f7018c21STomi Valkeinen #define VFAC_CTL1_FREEZE_CAPTURE_SYNC	0x08	/* sync freeze capture			*/
303f7018c21STomi Valkeinen #define VFAC_CTL1_VALIDFRAME_SRC	0x10	/* select valid frame source		*/
304f7018c21STomi Valkeinen #define VFAC_CTL1_PHILIPS		0x40	/* select Philips mode			*/
305f7018c21STomi Valkeinen #define VFAC_CTL1_MODVINTERPOLCLK	0x80	/* modify vertical interpolation clocl	*/
306f7018c21STomi Valkeinen 
307f7018c21STomi Valkeinen #define VFAC_CTL2		0xe9
308f7018c21STomi Valkeinen #define VFAC_CTL2_INVERT_VIDDATAVALID	0x01	/* invert video data valid		*/
309f7018c21STomi Valkeinen #define VFAC_CTL2_INVERT_GRAPHREADY	0x02	/* invert graphic ready output sig	*/
310f7018c21STomi Valkeinen #define VFAC_CTL2_INVERT_DATACLK	0x04	/* invert data clock signal		*/
311f7018c21STomi Valkeinen #define VFAC_CTL2_INVERT_HSYNC		0x08	/* invert hsync input			*/
312f7018c21STomi Valkeinen #define VFAC_CTL2_INVERT_VSYNC		0x10	/* invert vsync input			*/
313f7018c21STomi Valkeinen #define VFAC_CTL2_INVERT_FRAME		0x20	/* invert frame odd/even input		*/
314f7018c21STomi Valkeinen #define VFAC_CTL2_INVERT_BLANK		0x40	/* invert blank output			*/
315f7018c21STomi Valkeinen #define VFAC_CTL2_INVERT_OVSYNC		0x80	/* invert other vsync input		*/
316f7018c21STomi Valkeinen 
317f7018c21STomi Valkeinen #define VFAC_CTL3		0xea
318f7018c21STomi Valkeinen #define VFAC_CTL3_CAP_LARGE_FIFO	0x01	/* large capture fifo			*/
319f7018c21STomi Valkeinen #define VFAC_CTL3_CAP_INTERLACE		0x02	/* capture odd and even fields		*/
320f7018c21STomi Valkeinen #define VFAC_CTL3_CAP_HOLD_4NS		0x00	/* hold capture data for 4ns		*/
321f7018c21STomi Valkeinen #define VFAC_CTL3_CAP_HOLD_2NS		0x04	/* hold capture data for 2ns		*/
322f7018c21STomi Valkeinen #define VFAC_CTL3_CAP_HOLD_6NS		0x08	/* hold capture data for 6ns		*/
323f7018c21STomi Valkeinen #define VFAC_CTL3_CAP_HOLD_0NS		0x0c	/* hold capture data for 0ns		*/
324f7018c21STomi Valkeinen #define VFAC_CTL3_CHROMAKEY		0x20	/* capture data will be chromakeyed	*/
325f7018c21STomi Valkeinen #define VFAC_CTL3_CAP_IRQ		0x40	/* enable capture interrupt		*/
326f7018c21STomi Valkeinen 
327f7018c21STomi Valkeinen #define CAP_MEM_START		0xeb		/* 18 bits				*/
328f7018c21STomi Valkeinen #define CAP_MAP_WIDTH		0xed		/* high 6 bits				*/
329f7018c21STomi Valkeinen #define CAP_PITCH		0xee		/* 8 bits				*/
330f7018c21STomi Valkeinen 
331f7018c21STomi Valkeinen #define CAP_CTL_MISC		0xef
332f7018c21STomi Valkeinen #define CAP_CTL_MISC_HDIV		0x01
333f7018c21STomi Valkeinen #define CAP_CTL_MISC_HDIV4		0x02
334f7018c21STomi Valkeinen #define CAP_CTL_MISC_ODDEVEN		0x04
335f7018c21STomi Valkeinen #define CAP_CTL_MISC_HSYNCDIV2		0x08
336f7018c21STomi Valkeinen #define CAP_CTL_MISC_SYNCTZHIGH		0x10
337f7018c21STomi Valkeinen #define CAP_CTL_MISC_SYNCTZOR		0x20
338f7018c21STomi Valkeinen #define CAP_CTL_MISC_DISPUSED		0x80
339f7018c21STomi Valkeinen 
340f7018c21STomi Valkeinen #define REG_BANK		0xfa
341f7018c21STomi Valkeinen #define REG_BANK_X			0x00
342f7018c21STomi Valkeinen #define REG_BANK_Y			0x01
343f7018c21STomi Valkeinen #define REG_BANK_W			0x02
344f7018c21STomi Valkeinen #define REG_BANK_T			0x03
345f7018c21STomi Valkeinen #define REG_BANK_J			0x04
346f7018c21STomi Valkeinen #define REG_BANK_K			0x05
347f7018c21STomi Valkeinen 
348f7018c21STomi Valkeinen /*
349f7018c21STomi Valkeinen  * Bus-master
350f7018c21STomi Valkeinen  */
351f7018c21STomi Valkeinen #define BM_VID_ADDR_LOW		0xbc040
352f7018c21STomi Valkeinen #define BM_VID_ADDR_HIGH	0xbc044
353f7018c21STomi Valkeinen #define BM_ADDRESS_LOW		0xbc080
354f7018c21STomi Valkeinen #define BM_ADDRESS_HIGH		0xbc084
355f7018c21STomi Valkeinen #define BM_LENGTH		0xbc088
356f7018c21STomi Valkeinen #define BM_CONTROL		0xbc08c
357f7018c21STomi Valkeinen #define BM_CONTROL_ENABLE		0x01	/* enable transfer			*/
358f7018c21STomi Valkeinen #define BM_CONTROL_IRQEN		0x02	/* enable IRQ at end of transfer	*/
359f7018c21STomi Valkeinen #define BM_CONTROL_INIT			0x04	/* initialise status & count		*/
360f7018c21STomi Valkeinen #define BM_COUNT		0xbc090		/* read-only				*/
361f7018c21STomi Valkeinen 
362f7018c21STomi Valkeinen /*
363f7018c21STomi Valkeinen  * TV registers
364f7018c21STomi Valkeinen  */
365f7018c21STomi Valkeinen #define TV_VBLANK_EVEN_START	0xbe43c
366f7018c21STomi Valkeinen #define TV_VBLANK_EVEN_END	0xbe440
367f7018c21STomi Valkeinen #define TV_VBLANK_ODD_START	0xbe444
368f7018c21STomi Valkeinen #define TV_VBLANK_ODD_END	0xbe448
369f7018c21STomi Valkeinen #define TV_SYNC_YGAIN		0xbe44c
370f7018c21STomi Valkeinen #define TV_UV_GAIN		0xbe450
371f7018c21STomi Valkeinen #define TV_PED_UVDET		0xbe454
372f7018c21STomi Valkeinen #define TV_UV_BURST_AMP		0xbe458
373f7018c21STomi Valkeinen #define TV_HSYNC_START		0xbe45c
374f7018c21STomi Valkeinen #define TV_HSYNC_END		0xbe460
375f7018c21STomi Valkeinen #define TV_Y_DELAY1		0xbe464
376f7018c21STomi Valkeinen #define TV_Y_DELAY2		0xbe468
377f7018c21STomi Valkeinen #define TV_UV_DELAY1		0xbe46c
378f7018c21STomi Valkeinen #define TV_BURST_START		0xbe470
379f7018c21STomi Valkeinen #define TV_BURST_END		0xbe474
380f7018c21STomi Valkeinen #define TV_HBLANK_START		0xbe478
381f7018c21STomi Valkeinen #define TV_HBLANK_END		0xbe47c
382f7018c21STomi Valkeinen #define TV_PED_EVEN_START	0xbe480
383f7018c21STomi Valkeinen #define TV_PED_EVEN_END		0xbe484
384f7018c21STomi Valkeinen #define TV_PED_ODD_START	0xbe488
385f7018c21STomi Valkeinen #define TV_PED_ODD_END		0xbe48c
386f7018c21STomi Valkeinen #define TV_VSYNC_EVEN_START	0xbe490
387f7018c21STomi Valkeinen #define TV_VSYNC_EVEN_END	0xbe494
388f7018c21STomi Valkeinen #define TV_VSYNC_ODD_START	0xbe498
389f7018c21STomi Valkeinen #define TV_VSYNC_ODD_END	0xbe49c
390f7018c21STomi Valkeinen #define TV_SCFL			0xbe4a0
391f7018c21STomi Valkeinen #define TV_SCFH			0xbe4a4
392f7018c21STomi Valkeinen #define TV_SCP			0xbe4a8
393f7018c21STomi Valkeinen #define TV_DELAYBYPASS		0xbe4b4
394f7018c21STomi Valkeinen #define TV_EQL_END		0xbe4bc
395f7018c21STomi Valkeinen #define TV_SERR_START		0xbe4c0
396f7018c21STomi Valkeinen #define TV_SERR_END		0xbe4c4
397f7018c21STomi Valkeinen #define TV_CTL			0xbe4dc	/* reflects a previous register- MVFCLR, MVPCLR etc P241*/
398f7018c21STomi Valkeinen #define TV_VSYNC_VGA_HS		0xbe4e8
399f7018c21STomi Valkeinen #define TV_FLICK_XMIN		0xbe514
400f7018c21STomi Valkeinen #define TV_FLICK_XMAX		0xbe518
401f7018c21STomi Valkeinen #define TV_FLICK_YMIN		0xbe51c
402f7018c21STomi Valkeinen #define TV_FLICK_YMAX		0xbe520
403f7018c21STomi Valkeinen 
404f7018c21STomi Valkeinen /*
405f7018c21STomi Valkeinen  * Graphics Co-processor
406f7018c21STomi Valkeinen  */
407f7018c21STomi Valkeinen #define CO_REG_CONTROL		0xbf011
408f7018c21STomi Valkeinen #define CO_CTRL_BUSY			0x80
409f7018c21STomi Valkeinen #define CO_CTRL_CMDFULL			0x04
410f7018c21STomi Valkeinen #define CO_CTRL_FIFOEMPTY		0x02
411f7018c21STomi Valkeinen #define CO_CTRL_READY			0x01
412f7018c21STomi Valkeinen 
413f7018c21STomi Valkeinen #define CO_REG_SRC_WIDTH	0xbf018
414f7018c21STomi Valkeinen #define CO_REG_PIXFMT		0xbf01c
415f7018c21STomi Valkeinen #define CO_PIXFMT_32BPP			0x03
416f7018c21STomi Valkeinen #define CO_PIXFMT_24BPP			0x02
417f7018c21STomi Valkeinen #define CO_PIXFMT_16BPP			0x01
418f7018c21STomi Valkeinen #define CO_PIXFMT_8BPP			0x00
419f7018c21STomi Valkeinen 
420f7018c21STomi Valkeinen #define CO_REG_FGMIX		0xbf048
421f7018c21STomi Valkeinen #define CO_FG_MIX_ZERO			0x00
422f7018c21STomi Valkeinen #define CO_FG_MIX_SRC_AND_DST		0x01
423f7018c21STomi Valkeinen #define CO_FG_MIX_SRC_AND_NDST		0x02
424f7018c21STomi Valkeinen #define CO_FG_MIX_SRC			0x03
425f7018c21STomi Valkeinen #define CO_FG_MIX_NSRC_AND_DST		0x04
426f7018c21STomi Valkeinen #define CO_FG_MIX_DST			0x05
427f7018c21STomi Valkeinen #define CO_FG_MIX_SRC_XOR_DST		0x06
428f7018c21STomi Valkeinen #define CO_FG_MIX_SRC_OR_DST		0x07
429f7018c21STomi Valkeinen #define CO_FG_MIX_NSRC_AND_NDST		0x08
430f7018c21STomi Valkeinen #define CO_FG_MIX_SRC_XOR_NDST		0x09
431f7018c21STomi Valkeinen #define CO_FG_MIX_NDST			0x0a
432f7018c21STomi Valkeinen #define CO_FG_MIX_SRC_OR_NDST		0x0b
433f7018c21STomi Valkeinen #define CO_FG_MIX_NSRC			0x0c
434f7018c21STomi Valkeinen #define CO_FG_MIX_NSRC_OR_DST		0x0d
435f7018c21STomi Valkeinen #define CO_FG_MIX_NSRC_OR_NDST		0x0e
436f7018c21STomi Valkeinen #define CO_FG_MIX_ONES			0x0f
437f7018c21STomi Valkeinen 
438f7018c21STomi Valkeinen #define CO_REG_FGCOLOUR		0xbf058
439f7018c21STomi Valkeinen #define CO_REG_BGCOLOUR		0xbf05c
440f7018c21STomi Valkeinen #define CO_REG_PIXWIDTH		0xbf060
441f7018c21STomi Valkeinen #define CO_REG_PIXHEIGHT	0xbf062
442f7018c21STomi Valkeinen #define CO_REG_X_PHASE		0xbf078
443f7018c21STomi Valkeinen #define CO_REG_CMD_L		0xbf07c
444f7018c21STomi Valkeinen #define CO_CMD_L_PATTERN_FGCOL		0x8000
445f7018c21STomi Valkeinen #define CO_CMD_L_INC_LEFT		0x0004
446f7018c21STomi Valkeinen #define CO_CMD_L_INC_UP			0x0002
447f7018c21STomi Valkeinen 
448f7018c21STomi Valkeinen #define CO_REG_CMD_H		0xbf07e
449f7018c21STomi Valkeinen #define CO_CMD_H_BGSRCMAP		0x8000	/* otherwise bg colour */
450f7018c21STomi Valkeinen #define CO_CMD_H_FGSRCMAP		0x2000	/* otherwise fg colour */
451f7018c21STomi Valkeinen #define CO_CMD_H_BLITTER		0x0800
452f7018c21STomi Valkeinen 
453f7018c21STomi Valkeinen #define CO_REG_SRC1_PTR		0xbf170
454f7018c21STomi Valkeinen #define CO_REG_SRC2_PTR		0xbf174
455f7018c21STomi Valkeinen #define CO_REG_DEST_PTR		0xbf178
456f7018c21STomi Valkeinen #define CO_REG_DEST_WIDTH	0xbf218
457f7018c21STomi Valkeinen 
458f7018c21STomi Valkeinen /*
459f7018c21STomi Valkeinen  * Private structure
460f7018c21STomi Valkeinen  */
461f7018c21STomi Valkeinen struct cfb_info;
462f7018c21STomi Valkeinen 
463f7018c21STomi Valkeinen struct cyberpro_info {
464f7018c21STomi Valkeinen 	struct device	*dev;
465f7018c21STomi Valkeinen 	struct i2c_adapter *i2c;
466f7018c21STomi Valkeinen 	unsigned char	__iomem *regs;
467f7018c21STomi Valkeinen 	char		__iomem *fb;
468f7018c21STomi Valkeinen 	char		dev_name[32];
469f7018c21STomi Valkeinen 	unsigned int	fb_size;
470f7018c21STomi Valkeinen 	unsigned int	chip_id;
471f7018c21STomi Valkeinen 	unsigned int	irq;
472f7018c21STomi Valkeinen 
473f7018c21STomi Valkeinen 	/*
474f7018c21STomi Valkeinen 	 * The following is a pointer to be passed into the
475f7018c21STomi Valkeinen 	 * functions below.  The modules outside the main
476f7018c21STomi Valkeinen 	 * cyber2000fb.c driver have no knowledge as to what
477f7018c21STomi Valkeinen 	 * is within this structure.
478f7018c21STomi Valkeinen 	 */
479f7018c21STomi Valkeinen 	struct cfb_info *info;
480f7018c21STomi Valkeinen };
481f7018c21STomi Valkeinen 
482f7018c21STomi Valkeinen #define ID_IGA_1682		0
483f7018c21STomi Valkeinen #define ID_CYBERPRO_2000	1
484f7018c21STomi Valkeinen #define ID_CYBERPRO_2010	2
485f7018c21STomi Valkeinen #define ID_CYBERPRO_5000	3
486f7018c21STomi Valkeinen 
487f7018c21STomi Valkeinen /*
488f7018c21STomi Valkeinen  * Note! Writing to the Cyber20x0 registers from an interrupt
489f7018c21STomi Valkeinen  * routine is definitely a bad idea atm.
490f7018c21STomi Valkeinen  */
491f7018c21STomi Valkeinen int cyber2000fb_attach(struct cyberpro_info *info, int idx);
492f7018c21STomi Valkeinen void cyber2000fb_detach(int idx);
493f7018c21STomi Valkeinen void cyber2000fb_enable_extregs(struct cfb_info *cfb);
494f7018c21STomi Valkeinen void cyber2000fb_disable_extregs(struct cfb_info *cfb);
495