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