Home | History | Annotate | Line # | Download | only in dev
p4reg.h revision 1.5.76.1
      1  1.5.76.1     yamt /*	$NetBSD: p4reg.h,v 1.5.76.1 2008/05/18 12:32:54 yamt 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  *
     19       1.2  thorpej  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     20       1.2  thorpej  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21       1.2  thorpej  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22       1.2  thorpej  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23       1.2  thorpej  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24       1.2  thorpej  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25       1.2  thorpej  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26       1.2  thorpej  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27       1.2  thorpej  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28       1.2  thorpej  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29       1.2  thorpej  * POSSIBILITY OF SUCH DAMAGE.
     30       1.2  thorpej  */
     31       1.1   jeremy 
     32       1.1   jeremy /*
     33       1.1   jeremy  * Copyright (c) 1995 Theo de Raadt
     34       1.1   jeremy  * All rights reserved.
     35       1.1   jeremy  *
     36       1.1   jeremy  * Redistribution and use in source and binary forms, with or without
     37       1.1   jeremy  * modification, are permitted provided that the following conditions
     38       1.1   jeremy  * are met:
     39       1.1   jeremy  * 1. Redistributions of source code must retain the above copyright
     40       1.1   jeremy  *    notice, this list of conditions and the following disclaimer.
     41       1.1   jeremy  * 2. Redistributions in binary form must reproduce the above copyright
     42       1.1   jeremy  *    notice, this list of conditions and the following disclaimer in the
     43       1.1   jeremy  *    documentation and/or other materials provided with the distribution.
     44       1.1   jeremy  *
     45       1.1   jeremy  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     46       1.1   jeremy  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     47       1.1   jeremy  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     48       1.1   jeremy  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     49       1.1   jeremy  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     50       1.1   jeremy  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     51       1.1   jeremy  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     52       1.1   jeremy  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     53       1.1   jeremy  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     54       1.1   jeremy  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     55       1.1   jeremy  */
     56       1.1   jeremy 
     57       1.1   jeremy /*
     58       1.3      gwr  * P4 framebuffer register.  Most Sun framebuffers have a P4
     59       1.3      gwr  * register at the beginning of the physical space occupied
     60       1.3      gwr  * by the framebuffer that identifies its type, size, etc.
     61       1.1   jeremy  */
     62       1.1   jeremy 
     63       1.3      gwr #define P4_REG_DIAG		0x80
     64       1.3      gwr #define P4_REG_READBACKCLR	0x40
     65       1.3      gwr #define P4_REG_VIDEO		0x20
     66       1.3      gwr #define P4_REG_SYNC		0x10
     67       1.3      gwr #define P4_REG_VTRACE		0x08
     68       1.3      gwr #define	P4_REG_INT		0x04	/* r: pending */
     69       1.3      gwr #define	P4_REG_INTCLR		0x04	/* w: clear it */
     70       1.3      gwr #define	P4_REG_INTEN		0x02
     71       1.3      gwr #define P4_REG_FIRSTHALF	0x01
     72       1.3      gwr #define P4_REG_RESET		0x01
     73       1.3      gwr 
     74       1.3      gwr #define P4_FBTYPE_MASK	0x7f000000
     75       1.3      gwr #define	P4_FBTYPE(x)		((x) >> 24)
     76       1.3      gwr 
     77       1.3      gwr #define	P4_ID_MASK		0xf0
     78       1.3      gwr #define P4_ID(x)		(P4_FBTYPE((x)) == P4_ID_COLOR24 ? \
     79       1.3      gwr 				    P4_ID_COLOR24 : \
     80       1.3      gwr 				    P4_FBTYPE((x)) & P4_ID_MASK)
     81       1.3      gwr 
     82       1.3      gwr #define P4_NOTFOUND		-1	/* no P4 register */
     83       1.3      gwr #define P4_ID_BW		0x00	/* BW2: monochrome */
     84       1.3      gwr #define P4_ID_FASTCOLOR 	0x60	/* CG6: accelerated 8-bit color */
     85       1.3      gwr #define P4_ID_COLOR8P1		0x40	/* CG4: 8-bit color + overlay */
     86       1.3      gwr #define P4_ID_COLOR24		0x45	/* CG8: 24-bit color + overlay */
     87       1.3      gwr 
     88       1.3      gwr #define P4_SIZE_MASK		0x0f
     89       1.3      gwr #define P4_SIZE(x)		(P4_FBTYPE((x)) & P4_SIZE_MASK)
     90       1.3      gwr #define P4_SIZE_1600X1280	0x00
     91       1.3      gwr #define P4_SIZE_1152X900	0x01
     92       1.3      gwr #define P4_SIZE_1024X1024	0x02
     93       1.3      gwr #define P4_SIZE_1280X1024	0x03
     94       1.3      gwr #define P4_SIZE_1440X1440	0x04
     95       1.3      gwr #define P4_SIZE_640X480	0x05
     96       1.3      gwr 
     97       1.3      gwr /* Offset of bwtwo framebuffer from P4 register */
     98       1.3      gwr #define	P4_BW_OFF		0x00100000
     99       1.1   jeremy 
    100       1.1   jeremy /* Offsets for color framebuffers */
    101       1.3      gwr #define P4_COLOR_OFF_OVERLAY	0x00100000
    102       1.3      gwr #define P4_COLOR_OFF_ENABLE	0x00300000
    103       1.3      gwr #define P4_COLOR_OFF_COLOR	0x00500000
    104       1.3      gwr #define P4_COLOR_OFF_END	0x00700000
    105       1.3      gwr #define P4_COLOR_OFF_CMAP	0xfff00000	/* (-0x00100000) */
    106