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