Home | History | Annotate | Line # | Download | only in sbus
p9100reg.h revision 1.3.66.2
      1  1.3.66.2      yamt /*	$NetBSD: p9100reg.h,v 1.3.66.2 2009/06/20 07:20:28 yamt Exp $ */
      2       1.1  macallan 
      3       1.1  macallan /*-
      4       1.1  macallan  * Copyright (c) 1998 The NetBSD Foundation, Inc.
      5       1.1  macallan  * All rights reserved.
      6       1.1  macallan  *
      7       1.1  macallan  * This code is derived from software contributed to The NetBSD Foundation
      8       1.1  macallan  * by Matt Thomas.
      9       1.1  macallan  *
     10       1.1  macallan  * Redistribution and use in source and binary forms, with or without
     11       1.1  macallan  * modification, are permitted provided that the following conditions
     12       1.1  macallan  * are met:
     13       1.1  macallan  * 1. Redistributions of source code must retain the above copyright
     14       1.1  macallan  *    notice, this list of conditions and the following disclaimer.
     15       1.1  macallan  * 2. Redistributions in binary form must reproduce the above copyright
     16       1.1  macallan  *    notice, this list of conditions and the following disclaimer in the
     17       1.1  macallan  *    documentation and/or other materials provided with the distribution.
     18       1.1  macallan  *
     19       1.1  macallan  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     20       1.1  macallan  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21       1.1  macallan  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22       1.1  macallan  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23       1.1  macallan  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24       1.1  macallan  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25       1.1  macallan  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26       1.1  macallan  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27       1.1  macallan  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28       1.1  macallan  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29       1.1  macallan  * POSSIBILITY OF SUCH DAMAGE.
     30       1.1  macallan  */
     31       1.1  macallan 
     32       1.1  macallan 
     33       1.1  macallan #ifndef P9100_REG_H
     34       1.1  macallan #define P9100_REG_H
     35       1.1  macallan 
     36       1.1  macallan /* The Tadpole 3GX Technical Reference Manual lies.  The ramdac registers
     37       1.1  macallan  * are map in 4 byte increments, not 8.
     38       1.1  macallan  */
     39       1.1  macallan #define	SCRN_RPNT_CTL_1	0x0138	/* Screen Respaint Timing Control 1 */
     40       1.1  macallan #define	VIDEO_ENABLED	0x00000020
     41       1.1  macallan #define	PWRUP_CNFG	0x0194	/* Power Up Configuration */
     42       1.1  macallan #define	DAC_CMAP_WRIDX	0x0200	/* IBM RGB528 Palette Address (Write) */
     43       1.1  macallan #define	DAC_CMAP_DATA	0x0204	/* IBM RGB528 Palette Data */
     44       1.1  macallan #define	DAC_PXL_MASK	0x0208	/* IBM RGB528 Pixel Mask */
     45       1.1  macallan #define	DAC_CMAP_RDIDX	0x020c	/* IBM RGB528 Palette Address (Read) */
     46       1.1  macallan #define	DAC_INDX_LO	0x0210	/* IBM RGB528 Index Low */
     47       1.1  macallan #define	DAC_INDX_HI	0x0214	/* IBM RGB528 Index High */
     48       1.1  macallan #define	DAC_INDX_DATA	0x0218	/* IBM RGB528 Index Data (Indexed Registers) */
     49       1.1  macallan #define	DAC_INDX_CTL	0x021c	/* IBM RGB528 Index Control */
     50       1.2  macallan 	#define DAC_INDX_AUTOINCR	0x01
     51       1.3  macallan 
     52       1.3  macallan #define DAC_VERSION	0x01
     53  1.3.66.2      yamt #define DAC_MISC_CLK    0x02
     54  1.3.66.2      yamt #define DAC_POWER_MGT	0x05
     55       1.3  macallan 	#define DAC_POWER_SCLK_DISABLE	0x10
     56       1.3  macallan 	#define DAC_POWER_DDOT_DISABLE	0x08
     57       1.3  macallan 	#define DAC_POWER_SYNC_DISABLE	0x04
     58       1.3  macallan 	/* Disable internal DAC clock */
     59       1.3  macallan 	#define DAC_POWER_ICLK_DISABLE	0x02
     60       1.3  macallan 	/* Disable internal DAC power */
     61       1.3  macallan 	#define DAC_POWER_IPWR_DISABLE	0x01
     62  1.3.66.2      yamt #define DAC_OPERATION   0x06
     63  1.3.66.2      yamt 	#define DAC_SYNC_ON_GREEN       0x08
     64  1.3.66.2      yamt #define DAC_PALETTE_CTRL 0x07
     65  1.3.66.2      yamt #define DAC_PIXEL_FMT   0x0a
     66  1.3.66.2      yamt #define DAC_8BIT_CTRL   0x0b
     67  1.3.66.2      yamt 	#define DAC8_DIRECT_COLOR       0x01
     68  1.3.66.2      yamt #define DAC_16BIT_CTRL  0x0c
     69  1.3.66.2      yamt 	#define DAC16_INDIRECT_COLOR    0x00
     70  1.3.66.2      yamt 	#define DAC16_DYNAMIC_COLOR     0x40
     71  1.3.66.2      yamt 	#define DAC16_DIRECT_COLOR      0xc0
     72  1.3.66.2      yamt 	#define DAC16_BYPASS_POLARITY   0x20
     73  1.3.66.2      yamt 	#define DAC16_BIT_FILL_LINEAR   0x04
     74  1.3.66.2      yamt 	#define DAC16_555               0x00
     75  1.3.66.2      yamt 	#define DAC16_565               0x02
     76  1.3.66.2      yamt 	#define DAC16_CONTIGUOUS        0x01
     77  1.3.66.2      yamt #define DAC_24BIT_CTRL  0x0d
     78  1.3.66.2      yamt 	#define DAC24_DIRECT_COLOR      0x01
     79  1.3.66.2      yamt #define DAC_32BIT_CTRL  0x0e
     80  1.3.66.2      yamt 	#define DAC32_BYPASS_POLARITY   0x04
     81  1.3.66.2      yamt 	#define DAC32_INDIRECT_COLOR    0x00
     82  1.3.66.2      yamt 	#define DAC32_DYNAMIC_COLOR     0x01
     83  1.3.66.2      yamt 	#define DAC32_DIRECT_COLOR      0x03
     84  1.3.66.2      yamt #define DAC_VCO_DIV     0x16
     85  1.3.66.2      yamt #define DAC_PLL0        0x20
     86  1.3.66.2      yamt #define DAC_MISC_1      0x70
     87  1.3.66.2      yamt #define DAC_MISC_2      0x71
     88  1.3.66.2      yamt #define DAC_MISC_3      0x72
     89  1.3.66.2      yamt 
     90       1.2  macallan #define DAC_CURSOR_CTL	0x30
     91       1.2  macallan 	#define DAC_CURSOR_OFF	0x00
     92       1.2  macallan 	#define DAC_CURSOR_WIN	0x02
     93       1.2  macallan 	#define DAC_CURSOR_X11	0x03
     94       1.2  macallan 	#define DAC_CURSOR_64	0x04	/* clear for 32x32 cursor */
     95       1.2  macallan #define DAC_CURSOR_X		0x31	/* 8-low, 8-high */
     96       1.2  macallan #define DAC_CURSOR_Y		0x33	/* 8-low, 8-high */
     97       1.2  macallan #define DAC_CURSOR_HOT_X	0x35	/* hotspot */
     98       1.2  macallan #define DAC_CURSOR_HOT_Y	0x36
     99       1.2  macallan #define DAC_CURSOR_COL_1	0x40	/* red. green and blue */
    100       1.2  macallan #define DAC_CURSOR_COL_2	0x43
    101       1.2  macallan #define DAC_CURSOR_COL_3	0x46
    102       1.2  macallan #define DAC_PIX_PLL		0x8e
    103       1.2  macallan #define DAC_CURSOR_DATA		0x100
    104       1.1  macallan 
    105  1.3.66.2      yamt /* main registers */
    106  1.3.66.2      yamt #define SYS_CONF        0x0004  /* System Configuration Register */
    107  1.3.66.2      yamt         #define BUFFER_WRITE_1  0x0200  /* writes got o buffer 1 */
    108  1.3.66.2      yamt         #define BUFFER_WRITE_0  0x0000  /* writes go to buffer 0 */
    109  1.3.66.2      yamt         #define BUFFER_READ_1   0x0400  /* read from buffer 1 */
    110  1.3.66.2      yamt         #define BUFFER_READ_0   0x0000
    111  1.3.66.2      yamt         #define MEM_SWAP_BITS   0x0800  /* swap bits when accessing VRAM */
    112  1.3.66.2      yamt         #define MEM_SWAP_BYTES  0x1000  /* swap bytes when accessing VRAM */
    113  1.3.66.2      yamt         #define MEM_SWAP_HWORDS 0x2000  /* swap halfwords when accessing VRAM */
    114  1.3.66.2      yamt         #define SHIFT_0         14
    115  1.3.66.2      yamt         #define SHIFT_1         17
    116  1.3.66.2      yamt         #define SHIFT_2         20
    117  1.3.66.2      yamt         #define SHIFT_3         29
    118  1.3.66.2      yamt         #define PIXEL_SHIFT     26
    119  1.3.66.2      yamt         #define SWAP_SHIFT      11
    120  1.3.66.2      yamt         /* this is what the 3GX manual says */
    121  1.3.66.2      yamt         #define SC_8BIT         2
    122  1.3.66.2      yamt         #define SC_16BIT        3
    123  1.3.66.2      yamt         #define SC_24BIT        7
    124  1.3.66.2      yamt         #define SC_32BIT        5
    125  1.3.66.2      yamt 
    126  1.3.66.2      yamt /* video controller registers */
    127  1.3.66.2      yamt #define VID_HCOUNTER    0x104
    128  1.3.66.2      yamt #define VID_HTOTAL      0x108
    129  1.3.66.2      yamt #define VID_HSRE        0x10c   /* hsync raising edge */
    130  1.3.66.2      yamt #define VID_HBRE        0x110   /* hblank raising edge */
    131  1.3.66.2      yamt #define VID_HBFE        0x114   /* hblank falling edge */
    132  1.3.66.2      yamt #define VID_HCNTPRLD    0x118   /* hcounter preload */
    133  1.3.66.2      yamt #define VID_VCOUNTER    0x11c   /* vcounter */
    134  1.3.66.2      yamt #define VID_VLENGTH     0x120   /* lines, including blanks */
    135  1.3.66.2      yamt #define VID_VSRE        0x124   /* vsync raising edge */
    136  1.3.66.2      yamt #define VID_VBRE        0x128   /* vblank raising edge */
    137  1.3.66.2      yamt #define VID_VBFE        0x12c   /* vblank falling edge */
    138  1.3.66.2      yamt #define VID_VCNTPRLD    0x130   /* vcounter preload */
    139  1.3.66.2      yamt #define VID_SRADDR      0x134   /* screen repaint address */
    140  1.3.66.2      yamt #define VID_SRTC        0x138   /* screen repaint timing control */
    141  1.3.66.2      yamt #define VID_QSFCNTR     0x13c   /* QSF counter */
    142  1.3.66.2      yamt 
    143  1.3.66.2      yamt #define VID_MEM_CONFIG  0x184   /* memory config */
    144  1.3.66.2      yamt #define VID_RFPERIOD    0x188   /* refresh period */
    145  1.3.66.2      yamt #define VID_RFCOUNT     0x18c   /* refresh counter */
    146  1.3.66.2      yamt #define VID_RLMAX       0x190   /* RAS low max */
    147  1.3.66.2      yamt #define VID_RLCUR       0x194   /* RAS low current */
    148  1.3.66.2      yamt #define VID_DACSYNC     0x198   /* read after last DAC access */
    149  1.3.66.2      yamt 
    150       1.1  macallan #define ENGINE_STATUS	0x2000	/* drawing engine status register */
    151       1.1  macallan 	#define BLITTER_BUSY	0x80000000
    152       1.2  macallan 	#define ENGINE_BUSY	0x40000000
    153       1.2  macallan #define COMMAND_BLIT		0x2004
    154       1.2  macallan #define COMMAND_QUAD		0x2008
    155       1.2  macallan /* pixel data for monochrome colour expansion */
    156       1.2  macallan #define PIXEL_1			0x2080
    157       1.1  macallan /* apparently bits 2-6 control how many pixels we write - n+1 */
    158       1.1  macallan 
    159       1.1  macallan /* drawing engine registers */
    160  1.3.66.2      yamt #define COORD_INDEX		0x218c
    161       1.1  macallan #define WINDOW_OFFSET		0x2190
    162       1.1  macallan 
    163       1.1  macallan #define FOREGROUND_COLOR	0x2200
    164       1.1  macallan #define BACKGROUND_COLOR	0x2204
    165       1.1  macallan #define PLANE_MASK			0x2208
    166       1.1  macallan #define DRAW_MODE			0x220c
    167       1.1  macallan #define PATTERN_ORIGIN_X	0x2210
    168       1.1  macallan #define PATTERN_ORIGIN_Y	0x2214
    169       1.1  macallan #define RASTER_OP			0x2218
    170       1.1  macallan 	#define ROP_NO_SOLID		0x02000	/* if set use pattern instead of color for quad operations */
    171       1.1  macallan 	#define ROP_2BIT_PATTERN	0x04000 /* 4-colour pattern instead of mono */
    172       1.1  macallan 	#define ROP_PIX1_TRANS		0x08000	/* transparent background in mono */
    173       1.1  macallan 	#define ROP_OVERSIZE		0x10000
    174       1.1  macallan 	#define ROP_PATTERN			0x20000		/* the manual says pattern enable */
    175       1.1  macallan 	#define ROP_TRANS			0x20000		/* but XFree86 says trans */
    176       1.1  macallan 	#define ROP_SRC 			0xCC
    177       1.1  macallan 	#define ROP_PAT				0xF0
    178       1.1  macallan 	#define ROP_DST 			0xAA
    179       1.1  macallan 	#define ROP_SET				0xff
    180       1.1  macallan 
    181       1.1  macallan #define PIXEL_8				0x221c
    182       1.1  macallan #define WINDOW_MIN			0x2220
    183       1.1  macallan #define WINDOW_MAX			0x2224
    184       1.1  macallan 
    185       1.1  macallan #define PATTERN0			0x2280
    186       1.1  macallan #define PATTERN1			0x2284
    187       1.1  macallan #define PATTERN2			0x2288
    188       1.1  macallan #define PATTERN3			0x228c
    189       1.1  macallan #define USER0				0x2290
    190       1.1  macallan #define USER1				0x2294
    191       1.1  macallan #define USER2				0x2298
    192       1.1  macallan #define USER3				0x229c
    193       1.1  macallan #define BYTE_CLIP_MIN		0x22a0
    194       1.1  macallan #define BYTE_CLIP_MAX		0x22a4
    195       1.1  macallan 
    196       1.1  macallan /* coordinate registers */
    197       1.1  macallan #define ABS_X0		0x3008
    198       1.1  macallan #define ABS_Y0		0x3010
    199       1.1  macallan #define ABS_XY0		0x3018
    200       1.1  macallan #define REL_X0		0x3028
    201       1.1  macallan #define REL_Y0		0x3030
    202       1.1  macallan #define REL_XY0		0x3038
    203       1.1  macallan 
    204       1.1  macallan #define ABS_X1		0x3048
    205       1.1  macallan #define ABS_Y1		0x3050
    206       1.1  macallan #define ABS_XY1		0x3058
    207       1.1  macallan #define REL_X1		0x3068
    208       1.1  macallan #define REL_Y1		0x3070
    209       1.1  macallan #define REL_XY1		0x3078
    210       1.1  macallan 
    211       1.1  macallan #define ABS_X2		0x3088
    212       1.1  macallan #define ABS_Y2		0x3090
    213       1.1  macallan #define ABS_XY2		0x3098
    214       1.1  macallan #define REL_X2		0x30a8
    215       1.1  macallan #define REL_Y2		0x30b0
    216       1.1  macallan #define REL_XY2		0x30b8
    217       1.1  macallan 
    218       1.1  macallan #define ABS_X3		0x30c8
    219       1.1  macallan #define ABS_Y3		0x30d0
    220       1.1  macallan #define ABS_XY3		0x30d8
    221       1.1  macallan #define REL_X3		0x30e8
    222       1.1  macallan #define REL_Y3		0x30f0
    223       1.1  macallan #define REL_XY3		0x30f8
    224       1.1  macallan 
    225       1.1  macallan /* meta-coordinates */
    226       1.1  macallan #define POINT_RTW_X		0x3208
    227       1.1  macallan #define POINT_RTW_Y		0x3210
    228       1.1  macallan #define POINT_RTW_XY	0x3218
    229       1.1  macallan #define POINT_RTP_X		0x3228
    230       1.1  macallan #define POINT_RTP_Y		0x3220
    231       1.1  macallan #define POINT_RTP_XY	0x3238
    232       1.1  macallan 
    233       1.1  macallan #define LINE_RTW_X		0x3248
    234       1.1  macallan #define LINE_RTW_Y		0x3250
    235       1.1  macallan #define LINE_RTW_XY		0x3258
    236       1.1  macallan #define LINE_RTP_X		0x3268
    237       1.1  macallan #define LINE_RTP_Y		0x3260
    238       1.1  macallan #define LINE_RTP_XY		0x3278
    239       1.1  macallan 
    240       1.1  macallan #define TRIANGLE_RTW_X	0x3288
    241       1.1  macallan #define TRIANGLE_RTW_Y	0x3290
    242       1.1  macallan #define TRIANGLE_RTW_XY	0x3298
    243       1.1  macallan #define TRIANGLE_RTP_X	0x32a8
    244       1.1  macallan #define TRIANGLE_RTP_Y	0x32a0
    245       1.1  macallan #define TRIANGLE_RTP_XY	0x32b8
    246       1.1  macallan 
    247       1.1  macallan #define QUAD_RTW_X		0x32c8
    248       1.1  macallan #define QUAD_RTW_Y		0x32d0
    249       1.1  macallan #define QUAD_RTW_XY		0x32d8
    250       1.1  macallan #define QUAD_RTP_X		0x32e8
    251       1.1  macallan #define QUAD_RTP_Y		0x32e0
    252       1.1  macallan #define QUAD_RTP_XY		0x32f8
    253       1.1  macallan 
    254       1.1  macallan #define RECT_RTW_X		0x3308
    255       1.1  macallan #define RECT_RTW_Y		0x3310
    256       1.1  macallan #define RECT_RTW_XY		0x3318
    257       1.1  macallan #define RECT_RTP_X		0x3328
    258       1.1  macallan #define RECT_RTP_Y		0x3320
    259       1.1  macallan #define RECT_RTP_XY		0x3338
    260       1.1  macallan 
    261       1.1  macallan #endif
    262