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