xref: /netbsd/sys/dev/sun/pfourreg.h (revision 6550d01e)
1 /*	$NetBSD: pfourreg.h,v 1.4 2008/04/28 20:23:58 martin Exp $	*/
2 
3 /*-
4  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
5  * All rights reserved.
6  *
7  * This code is derived from software contributed to The NetBSD Foundation
8  * by Jason R. Thorpe.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  * 1. Redistributions of source code must retain the above copyright
14  *    notice, this list of conditions and the following disclaimer.
15  * 2. Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in the
17  *    documentation and/or other materials provided with the distribution.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  */
31 
32 /*
33  * Copyright (c) 1995 Theo de Raadt
34  * All rights reserved.
35  *
36  * Redistribution and use in source and binary forms, with or without
37  * modification, are permitted provided that the following conditions
38  * are met:
39  * 1. Redistributions of source code must retain the above copyright
40  *    notice, this list of conditions and the following disclaimer.
41  * 2. Redistributions in binary form must reproduce the above copyright
42  *    notice, this list of conditions and the following disclaimer in the
43  *    documentation and/or other materials provided with the distribution.
44  *
45  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
46  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
47  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
48  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
49  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
50  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
51  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
52  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
53  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
54  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
55  */
56 
57 /*
58  * pfour framebuffer registers.
59  */
60 
61 /* Offset of bwtwo framebuffer from pfour register */
62 #define PFOUR_BW_OFF		0x00100000
63 
64 /* Offsets for color framebuffers */
65 #define PFOUR_COLOR_OFF_OVERLAY	0x00100000
66 #define PFOUR_COLOR_OFF_ENABLE	0x00300000
67 #define PFOUR_COLOR_OFF_COLOR	0x00500000
68 #define PFOUR_COLOR_OFF_END	0x00700000
69 #define PFOUR_COLOR_OFF_CMAP	0xfff00000	/* (-0x00100000) */
70 
71 #define PFOUR_REG_DIAG		0x80
72 #define PFOUR_REG_READBACKCLR	0x40
73 #define PFOUR_REG_VIDEO		0x20
74 #define PFOUR_REG_SYNC		0x10
75 #define PFOUR_REG_VTRACE	0x08
76 #define PFOUR_REG_INT		0x04
77 #define PFOUR_REG_INTCLR	0x04
78 #define PFOUR_REG_INTEN		0x02
79 #define PFOUR_REG_FIRSTHALF	0x01
80 #define PFOUR_REG_RESET		0x01
81 
82 #define PFOUR_FBTYPE_MASK	0x7f000000
83 #define	PFOUR_FBTYPE(x)		((x) >> 24)
84 
85 #define	PFOUR_ID_MASK		0xf0
86 #define PFOUR_ID(x)		(PFOUR_FBTYPE((x)) == PFOUR_ID_COLOR24 ? \
87 				    PFOUR_ID_COLOR24 : \
88 				    PFOUR_FBTYPE((x)) & PFOUR_ID_MASK)
89 #define PFOUR_ID_BW		0x00	/* monochrome */
90 #define PFOUR_ID_FASTCOLOR	0x60	/* accelerated 8-bit color */
91 #define PFOUR_ID_COLOR8P1	0x40	/* 8-bit color + overlay */
92 #define PFOUR_ID_COLOR24	0x45	/* 24-bit color + overlay */
93 
94 #define PFOUR_SIZE_MASK		0x0f
95 #define PFOUR_SIZE(x)		(PFOUR_FBTYPE((x)) & PFOUR_SIZE_MASK)
96 #define PFOUR_SIZE_1152X900	0x01
97 #define PFOUR_SIZE_1024X1024	0x02
98 #define PFOUR_SIZE_1280X1024	0x03
99 #define PFOUR_SIZE_1600X1280	0x00
100 #define PFOUR_SIZE_1440X1440	0x04
101 #define PFOUR_SIZE_640X480	0x05
102 
103 #define PFOUR_NOTPFOUR		-1
104