xref: /netbsd/sys/dev/sbus/p9100reg.h (revision 0ea32fba)
1*0ea32fbaSmacallan /*	$NetBSD: p9100reg.h,v 1.2 2005/11/12 23:25:46 macallan Exp $ */
29efeaffaSmacallan 
39efeaffaSmacallan /*-
49efeaffaSmacallan  * Copyright (c) 1998 The NetBSD Foundation, Inc.
59efeaffaSmacallan  * All rights reserved.
69efeaffaSmacallan  *
79efeaffaSmacallan  * This code is derived from software contributed to The NetBSD Foundation
89efeaffaSmacallan  * by Matt Thomas.
99efeaffaSmacallan  *
109efeaffaSmacallan  * Redistribution and use in source and binary forms, with or without
119efeaffaSmacallan  * modification, are permitted provided that the following conditions
129efeaffaSmacallan  * are met:
139efeaffaSmacallan  * 1. Redistributions of source code must retain the above copyright
149efeaffaSmacallan  *    notice, this list of conditions and the following disclaimer.
159efeaffaSmacallan  * 2. Redistributions in binary form must reproduce the above copyright
169efeaffaSmacallan  *    notice, this list of conditions and the following disclaimer in the
179efeaffaSmacallan  *    documentation and/or other materials provided with the distribution.
189efeaffaSmacallan  * 3. All advertising materials mentioning features or use of this software
199efeaffaSmacallan  *    must display the following acknowledgement:
209efeaffaSmacallan  *        This product includes software developed by the NetBSD
219efeaffaSmacallan  *        Foundation, Inc. and its contributors.
229efeaffaSmacallan  * 4. Neither the name of The NetBSD Foundation nor the names of its
239efeaffaSmacallan  *    contributors may be used to endorse or promote products derived
249efeaffaSmacallan  *    from this software without specific prior written permission.
259efeaffaSmacallan  *
269efeaffaSmacallan  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
279efeaffaSmacallan  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
289efeaffaSmacallan  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
299efeaffaSmacallan  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
309efeaffaSmacallan  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
319efeaffaSmacallan  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
329efeaffaSmacallan  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
339efeaffaSmacallan  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
349efeaffaSmacallan  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
359efeaffaSmacallan  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
369efeaffaSmacallan  * POSSIBILITY OF SUCH DAMAGE.
379efeaffaSmacallan  */
389efeaffaSmacallan 
399efeaffaSmacallan 
409efeaffaSmacallan #ifndef P9100_REG_H
419efeaffaSmacallan #define P9100_REG_H
429efeaffaSmacallan 
439efeaffaSmacallan /* The Tadpole 3GX Technical Reference Manual lies.  The ramdac registers
449efeaffaSmacallan  * are map in 4 byte increments, not 8.
459efeaffaSmacallan  */
469efeaffaSmacallan #define	SCRN_RPNT_CTL_1	0x0138	/* Screen Respaint Timing Control 1 */
479efeaffaSmacallan #define	VIDEO_ENABLED	0x00000020
489efeaffaSmacallan #define	PWRUP_CNFG	0x0194	/* Power Up Configuration */
499efeaffaSmacallan #define	DAC_CMAP_WRIDX	0x0200	/* IBM RGB528 Palette Address (Write) */
509efeaffaSmacallan #define	DAC_CMAP_DATA	0x0204	/* IBM RGB528 Palette Data */
519efeaffaSmacallan #define	DAC_PXL_MASK	0x0208	/* IBM RGB528 Pixel Mask */
529efeaffaSmacallan #define	DAC_CMAP_RDIDX	0x020c	/* IBM RGB528 Palette Address (Read) */
539efeaffaSmacallan #define	DAC_INDX_LO	0x0210	/* IBM RGB528 Index Low */
549efeaffaSmacallan #define	DAC_INDX_HI	0x0214	/* IBM RGB528 Index High */
559efeaffaSmacallan #define	DAC_INDX_DATA	0x0218	/* IBM RGB528 Index Data (Indexed Registers) */
569efeaffaSmacallan #define	DAC_INDX_CTL	0x021c	/* IBM RGB528 Index Control */
57*0ea32fbaSmacallan 	#define DAC_INDX_AUTOINCR	0x01
58*0ea32fbaSmacallan 
59*0ea32fbaSmacallan #define DAC_CURSOR_CTL	0x30
60*0ea32fbaSmacallan 	#define DAC_CURSOR_OFF	0x00
61*0ea32fbaSmacallan 	#define DAC_CURSOR_WIN	0x02
62*0ea32fbaSmacallan 	#define DAC_CURSOR_X11	0x03
63*0ea32fbaSmacallan 	#define DAC_CURSOR_64	0x04	/* clear for 32x32 cursor */
64*0ea32fbaSmacallan #define DAC_CURSOR_X		0x31	/* 8-low, 8-high */
65*0ea32fbaSmacallan #define DAC_CURSOR_Y		0x33	/* 8-low, 8-high */
66*0ea32fbaSmacallan #define DAC_CURSOR_HOT_X	0x35	/* hotspot */
67*0ea32fbaSmacallan #define DAC_CURSOR_HOT_Y	0x36
68*0ea32fbaSmacallan #define DAC_CURSOR_COL_1	0x40	/* red. green and blue */
69*0ea32fbaSmacallan #define DAC_CURSOR_COL_2	0x43
70*0ea32fbaSmacallan #define DAC_CURSOR_COL_3	0x46
71*0ea32fbaSmacallan #define DAC_PIX_PLL		0x8e
72*0ea32fbaSmacallan #define DAC_CURSOR_DATA		0x100
739efeaffaSmacallan 
749efeaffaSmacallan #define ENGINE_STATUS	0x2000	/* drawing engine status register */
759efeaffaSmacallan 	#define BLITTER_BUSY	0x80000000
769efeaffaSmacallan 	#define ENGINE_BUSY	0x40000000
779efeaffaSmacallan #define COMMAND_BLIT		0x2004
789efeaffaSmacallan #define COMMAND_QUAD		0x2008
79*0ea32fbaSmacallan /* pixel data for monochrome colour expansion */
80*0ea32fbaSmacallan #define PIXEL_1			0x2080
819efeaffaSmacallan /* apparently bits 2-6 control how many pixels we write - n+1 */
829efeaffaSmacallan 
839efeaffaSmacallan /* drawing engine registers */
849efeaffaSmacallan #define COORD_INDEX			0x218c
859efeaffaSmacallan #define WINDOW_OFFSET		0x2190
869efeaffaSmacallan 
879efeaffaSmacallan #define FOREGROUND_COLOR	0x2200
889efeaffaSmacallan #define BACKGROUND_COLOR	0x2204
899efeaffaSmacallan #define PLANE_MASK			0x2208
909efeaffaSmacallan #define DRAW_MODE			0x220c
919efeaffaSmacallan #define PATTERN_ORIGIN_X	0x2210
929efeaffaSmacallan #define PATTERN_ORIGIN_Y	0x2214
939efeaffaSmacallan #define RASTER_OP			0x2218
949efeaffaSmacallan 	#define ROP_NO_SOLID		0x02000	/* if set use pattern instead of color for quad operations */
959efeaffaSmacallan 	#define ROP_2BIT_PATTERN	0x04000 /* 4-colour pattern instead of mono */
969efeaffaSmacallan 	#define ROP_PIX1_TRANS		0x08000	/* transparent background in mono */
979efeaffaSmacallan 	#define ROP_OVERSIZE		0x10000
989efeaffaSmacallan 	#define ROP_PATTERN			0x20000		/* the manual says pattern enable */
999efeaffaSmacallan 	#define ROP_TRANS			0x20000		/* but XFree86 says trans */
1009efeaffaSmacallan 	#define ROP_SRC 			0xCC
1019efeaffaSmacallan 	#define ROP_PAT				0xF0
1029efeaffaSmacallan 	#define ROP_DST 			0xAA
1039efeaffaSmacallan 	#define ROP_SET				0xff
1049efeaffaSmacallan 
1059efeaffaSmacallan #define PIXEL_8				0x221c
1069efeaffaSmacallan #define WINDOW_MIN			0x2220
1079efeaffaSmacallan #define WINDOW_MAX			0x2224
1089efeaffaSmacallan 
1099efeaffaSmacallan #define PATTERN0			0x2280
1109efeaffaSmacallan #define PATTERN1			0x2284
1119efeaffaSmacallan #define PATTERN2			0x2288
1129efeaffaSmacallan #define PATTERN3			0x228c
1139efeaffaSmacallan #define USER0				0x2290
1149efeaffaSmacallan #define USER1				0x2294
1159efeaffaSmacallan #define USER2				0x2298
1169efeaffaSmacallan #define USER3				0x229c
1179efeaffaSmacallan #define BYTE_CLIP_MIN		0x22a0
1189efeaffaSmacallan #define BYTE_CLIP_MAX		0x22a4
1199efeaffaSmacallan 
1209efeaffaSmacallan /* coordinate registers */
1219efeaffaSmacallan #define ABS_X0		0x3008
1229efeaffaSmacallan #define ABS_Y0		0x3010
1239efeaffaSmacallan #define ABS_XY0		0x3018
1249efeaffaSmacallan #define REL_X0		0x3028
1259efeaffaSmacallan #define REL_Y0		0x3030
1269efeaffaSmacallan #define REL_XY0		0x3038
1279efeaffaSmacallan 
1289efeaffaSmacallan #define ABS_X1		0x3048
1299efeaffaSmacallan #define ABS_Y1		0x3050
1309efeaffaSmacallan #define ABS_XY1		0x3058
1319efeaffaSmacallan #define REL_X1		0x3068
1329efeaffaSmacallan #define REL_Y1		0x3070
1339efeaffaSmacallan #define REL_XY1		0x3078
1349efeaffaSmacallan 
1359efeaffaSmacallan #define ABS_X2		0x3088
1369efeaffaSmacallan #define ABS_Y2		0x3090
1379efeaffaSmacallan #define ABS_XY2		0x3098
1389efeaffaSmacallan #define REL_X2		0x30a8
1399efeaffaSmacallan #define REL_Y2		0x30b0
1409efeaffaSmacallan #define REL_XY2		0x30b8
1419efeaffaSmacallan 
1429efeaffaSmacallan #define ABS_X3		0x30c8
1439efeaffaSmacallan #define ABS_Y3		0x30d0
1449efeaffaSmacallan #define ABS_XY3		0x30d8
1459efeaffaSmacallan #define REL_X3		0x30e8
1469efeaffaSmacallan #define REL_Y3		0x30f0
1479efeaffaSmacallan #define REL_XY3		0x30f8
1489efeaffaSmacallan 
1499efeaffaSmacallan /* meta-coordinates */
1509efeaffaSmacallan #define POINT_RTW_X		0x3208
1519efeaffaSmacallan #define POINT_RTW_Y		0x3210
1529efeaffaSmacallan #define POINT_RTW_XY	0x3218
1539efeaffaSmacallan #define POINT_RTP_X		0x3228
1549efeaffaSmacallan #define POINT_RTP_Y		0x3220
1559efeaffaSmacallan #define POINT_RTP_XY	0x3238
1569efeaffaSmacallan 
1579efeaffaSmacallan #define LINE_RTW_X		0x3248
1589efeaffaSmacallan #define LINE_RTW_Y		0x3250
1599efeaffaSmacallan #define LINE_RTW_XY		0x3258
1609efeaffaSmacallan #define LINE_RTP_X		0x3268
1619efeaffaSmacallan #define LINE_RTP_Y		0x3260
1629efeaffaSmacallan #define LINE_RTP_XY		0x3278
1639efeaffaSmacallan 
1649efeaffaSmacallan #define TRIANGLE_RTW_X	0x3288
1659efeaffaSmacallan #define TRIANGLE_RTW_Y	0x3290
1669efeaffaSmacallan #define TRIANGLE_RTW_XY	0x3298
1679efeaffaSmacallan #define TRIANGLE_RTP_X	0x32a8
1689efeaffaSmacallan #define TRIANGLE_RTP_Y	0x32a0
1699efeaffaSmacallan #define TRIANGLE_RTP_XY	0x32b8
1709efeaffaSmacallan 
1719efeaffaSmacallan #define QUAD_RTW_X		0x32c8
1729efeaffaSmacallan #define QUAD_RTW_Y		0x32d0
1739efeaffaSmacallan #define QUAD_RTW_XY		0x32d8
1749efeaffaSmacallan #define QUAD_RTP_X		0x32e8
1759efeaffaSmacallan #define QUAD_RTP_Y		0x32e0
1769efeaffaSmacallan #define QUAD_RTP_XY		0x32f8
1779efeaffaSmacallan 
1789efeaffaSmacallan #define RECT_RTW_X		0x3308
1799efeaffaSmacallan #define RECT_RTW_Y		0x3310
1809efeaffaSmacallan #define RECT_RTW_XY		0x3318
1819efeaffaSmacallan #define RECT_RTP_X		0x3328
1829efeaffaSmacallan #define RECT_RTP_Y		0x3320
1839efeaffaSmacallan #define RECT_RTP_XY		0x3338
1849efeaffaSmacallan 
1859efeaffaSmacallan #endif
186