Home | History | Annotate | Line # | Download | only in dev
p4reg.h revision 1.3.48.1
      1  1.3.48.1    skrll /*	$NetBSD: p4reg.h,v 1.3.48.1 2004/08/03 10:42:04 skrll 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  *
     52       1.1   jeremy  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     53       1.1   jeremy  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     54       1.1   jeremy  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     55       1.1   jeremy  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     56       1.1   jeremy  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     57       1.1   jeremy  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     58       1.1   jeremy  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     59       1.1   jeremy  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     60       1.1   jeremy  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     61       1.1   jeremy  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     62       1.1   jeremy  */
     63       1.1   jeremy 
     64       1.1   jeremy /*
     65       1.3      gwr  * P4 framebuffer register.  Most Sun framebuffers have a P4
     66       1.3      gwr  * register at the beginning of the physical space occupied
     67       1.3      gwr  * by the framebuffer that identifies its type, size, etc.
     68       1.1   jeremy  */
     69       1.1   jeremy 
     70       1.3      gwr #define P4_REG_DIAG		0x80
     71       1.3      gwr #define P4_REG_READBACKCLR	0x40
     72       1.3      gwr #define P4_REG_VIDEO		0x20
     73       1.3      gwr #define P4_REG_SYNC		0x10
     74       1.3      gwr #define P4_REG_VTRACE		0x08
     75       1.3      gwr #define	P4_REG_INT		0x04	/* r: pending */
     76       1.3      gwr #define	P4_REG_INTCLR		0x04	/* w: clear it */
     77       1.3      gwr #define	P4_REG_INTEN		0x02
     78       1.3      gwr #define P4_REG_FIRSTHALF	0x01
     79       1.3      gwr #define P4_REG_RESET		0x01
     80       1.3      gwr 
     81       1.3      gwr #define P4_FBTYPE_MASK	0x7f000000
     82       1.3      gwr #define	P4_FBTYPE(x)		((x) >> 24)
     83       1.3      gwr 
     84       1.3      gwr #define	P4_ID_MASK		0xf0
     85       1.3      gwr #define P4_ID(x)		(P4_FBTYPE((x)) == P4_ID_COLOR24 ? \
     86       1.3      gwr 				    P4_ID_COLOR24 : \
     87       1.3      gwr 				    P4_FBTYPE((x)) & P4_ID_MASK)
     88       1.3      gwr 
     89       1.3      gwr #define P4_NOTFOUND		-1	/* no P4 register */
     90       1.3      gwr #define P4_ID_BW		0x00	/* BW2: monochrome */
     91       1.3      gwr #define P4_ID_FASTCOLOR 	0x60	/* CG6: accelerated 8-bit color */
     92       1.3      gwr #define P4_ID_COLOR8P1		0x40	/* CG4: 8-bit color + overlay */
     93       1.3      gwr #define P4_ID_COLOR24		0x45	/* CG8: 24-bit color + overlay */
     94       1.3      gwr 
     95       1.3      gwr #define P4_SIZE_MASK		0x0f
     96       1.3      gwr #define P4_SIZE(x)		(P4_FBTYPE((x)) & P4_SIZE_MASK)
     97       1.3      gwr #define P4_SIZE_1600X1280	0x00
     98       1.3      gwr #define P4_SIZE_1152X900	0x01
     99       1.3      gwr #define P4_SIZE_1024X1024	0x02
    100       1.3      gwr #define P4_SIZE_1280X1024	0x03
    101       1.3      gwr #define P4_SIZE_1440X1440	0x04
    102       1.3      gwr #define P4_SIZE_640X480	0x05
    103       1.3      gwr 
    104       1.3      gwr /* Offset of bwtwo framebuffer from P4 register */
    105       1.3      gwr #define	P4_BW_OFF		0x00100000
    106       1.1   jeremy 
    107       1.1   jeremy /* Offsets for color framebuffers */
    108       1.3      gwr #define P4_COLOR_OFF_OVERLAY	0x00100000
    109       1.3      gwr #define P4_COLOR_OFF_ENABLE	0x00300000
    110       1.3      gwr #define P4_COLOR_OFF_COLOR	0x00500000
    111       1.3      gwr #define P4_COLOR_OFF_END	0x00700000
    112       1.3      gwr #define P4_COLOR_OFF_CMAP	0xfff00000	/* (-0x00100000) */
    113