Home | History | Annotate | Line # | Download | only in ic
      1  1.4       rin /*	$NetBSD: i128reg.h,v 1.5 2020/04/16 23:29:53 rin Exp $ */
      2  1.1  macallan 
      3  1.1  macallan /*-
      4  1.1  macallan  * Copyright (c) 2007 Michael Lorenz
      5  1.1  macallan  * All rights reserved.
      6  1.1  macallan  *
      7  1.1  macallan  * Redistribution and use in source and binary forms, with or without
      8  1.1  macallan  * modification, are permitted provided that the following conditions
      9  1.1  macallan  * are met:
     10  1.1  macallan  * 1. Redistributions of source code must retain the above copyright
     11  1.1  macallan  *    notice, this list of conditions and the following disclaimer.
     12  1.1  macallan  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.1  macallan  *    notice, this list of conditions and the following disclaimer in the
     14  1.1  macallan  *    documentation and/or other materials provided with the distribution.
     15  1.1  macallan  *
     16  1.1  macallan  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     17  1.1  macallan  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     18  1.1  macallan  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     19  1.1  macallan  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     20  1.1  macallan  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     21  1.1  macallan  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     22  1.1  macallan  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     23  1.1  macallan  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     24  1.1  macallan  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     25  1.1  macallan  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     26  1.1  macallan  * POSSIBILITY OF SUCH DAMAGE.
     27  1.1  macallan  */
     28  1.1  macallan 
     29  1.5       rin #include <sys/cdefs.h>
     30  1.5       rin __KERNEL_RCSID(0, "$NetBSD: i128reg.h,v 1.5 2020/04/16 23:29:53 rin Exp $");
     31  1.5       rin 
     32  1.1  macallan /*
     33  1.1  macallan  * register definition for Number Nine Imagine 128 graphics controllers
     34  1.1  macallan  *
     35  1.1  macallan  * adapted from XFree86's i128 driver source
     36  1.1  macallan  */
     37  1.1  macallan 
     38  1.1  macallan #ifndef I128REG_H
     39  1.1  macallan #define I128REG_H
     40  1.1  macallan 
     41  1.1  macallan #define INTP     0x4000
     42  1.1  macallan #define  INTP_DD_INT 0x01	/* drawing op completed  */
     43  1.1  macallan #define  INTP_CL_INT 0x02
     44  1.1  macallan #define INTM     0x4004
     45  1.1  macallan #define  INTM_DD_MSK 0x01
     46  1.1  macallan #define  INTM_CL_MSK 0x02
     47  1.1  macallan #define FLOW     0x4008
     48  1.1  macallan #define  FLOW_DEB    0x01	/* drawing engine busy   */
     49  1.1  macallan #define  FLOW_MCB    0x02	/* mem controller busy   */
     50  1.1  macallan #define  FLOW_CLP    0x04
     51  1.1  macallan #define  FLOW_PRV    0x08	/* prev cmd still running or cache ready */
     52  1.1  macallan #define BUSY     0x400C
     53  1.1  macallan #define  BUSY_BUSY   0x01	/* command pipeline busy */
     54  1.1  macallan #define XYW_AD   0x4010
     55  1.1  macallan #define Z_CTRL   0x4018
     56  1.1  macallan #define BUF_CTRL 0x4020
     57  1.1  macallan #define  BC_AMV      0x02
     58  1.1  macallan #define  BC_MP       0x04
     59  1.1  macallan #define  BC_AMD      0x08
     60  1.1  macallan #define  BC_SEN_MSK  0x0300
     61  1.1  macallan #define  BC_SEN_DB   0x0000
     62  1.1  macallan #define  BC_SEN_VB   0x0100
     63  1.1  macallan #define  BC_SEN_MB   0x0200
     64  1.1  macallan #define  BC_SEN_CB   0x0300
     65  1.1  macallan #define  BC_DEN_MSK  0x0C00
     66  1.1  macallan #define  BC_DEN_DB   0x0000
     67  1.1  macallan #define  BC_DEN_VB   0x0400
     68  1.1  macallan #define  BC_DEN_MB   0x0800
     69  1.1  macallan #define  BC_DEN_CB   0x0C00
     70  1.1  macallan #define  BC_DSE      0x1000
     71  1.1  macallan #define  BC_VSE      0x2000
     72  1.1  macallan #define  BC_MSE      0x4000
     73  1.1  macallan #define  BC_PS_MSK   0x001F0000
     74  1.1  macallan #define  BC_MDM_MSK  0x00600000
     75  1.1  macallan #define  BC_MDM_KEY  0x00200000
     76  1.1  macallan #define  BC_MDM_PLN  0x00400000
     77  1.1  macallan #define  BC_BLK_ENA  0x00800000
     78  1.1  macallan #define  BC_PSIZ_MSK 0x03000000
     79  1.1  macallan #define  BC_PSIZ_8B  0x00000000
     80  1.1  macallan #define  BC_PSIZ_16B 0x01000000
     81  1.1  macallan #define  BC_PSIZ_32B 0x02000000
     82  1.1  macallan #define  BC_PSIZ_NOB 0x03000000
     83  1.1  macallan #define  BC_CO       0x40000000
     84  1.1  macallan #define  BC_CR       0x80000000
     85  1.1  macallan #define DE_PGE   0x4024
     86  1.1  macallan #define  DP_DVP_MSK  0x0000001F
     87  1.1  macallan #define  DP_MP_MSK   0x000F0000
     88  1.1  macallan #define DE_SORG   0x4028
     89  1.1  macallan #define DE_DORG   0x402C
     90  1.1  macallan #define DE_MSRC   0x4030
     91  1.1  macallan #define DE_WKEY   0x4038
     92  1.1  macallan #define DE_KYDAT  0x403C
     93  1.1  macallan #define DE_ZPTCH  0x403C
     94  1.1  macallan #define DE_SPTCH  0x4040
     95  1.1  macallan #define DE_DPTCH  0x4044
     96  1.1  macallan #define CMD       0x4048
     97  1.1  macallan #define  CMD_OPC_MSK 0x000000FF
     98  1.1  macallan #define  CMD_ROP_MSK 0x0000FF00
     99  1.1  macallan #define  CMD_STL_MSK 0x001F0000
    100  1.1  macallan #define  CMD_CLP_MSK 0x00E00000
    101  1.1  macallan #define  CMD_PAT_MSK 0x0F000000
    102  1.1  macallan #define  CMD_HDF_MSK 0x70000000
    103  1.1  macallan #define CMD_OPC   0x4050
    104  1.1  macallan #define  CO_NOOP     0x00
    105  1.1  macallan #define  CO_BITBLT   0x01
    106  1.1  macallan #define  CO_LINE     0x02
    107  1.1  macallan #define  CO_ELINE    0x03
    108  1.1  macallan #define  CO_TRIAN    0x04
    109  1.1  macallan #define  CO_RXFER    0x06
    110  1.1  macallan #define  CO_WXFER    0x07
    111  1.1  macallan #define CMD_ROP   0x4054
    112  1.1  macallan #define  CR_CLEAR    0x00
    113  1.1  macallan #define  CR_NOR      0x01
    114  1.1  macallan #define  CR_AND_INV  0x02
    115  1.1  macallan #define  CR_COPY_INV 0x03
    116  1.1  macallan #define  CR_AND_REV  0x04
    117  1.1  macallan #define  CR_INVERT   0x05
    118  1.1  macallan #define  CR_XOR      0x06
    119  1.1  macallan #define  CR_NAND     0x07
    120  1.1  macallan #define  CR_AND      0x08
    121  1.1  macallan #define  CR_EQUIV    0x09
    122  1.1  macallan #define  CR_NOOP     0x0A
    123  1.1  macallan #define  CR_OR_INV   0x0B
    124  1.1  macallan #define  CR_COPY     0x0C
    125  1.1  macallan #define  CR_OR_REV   0x0D
    126  1.1  macallan #define  CR_OR       0x0E
    127  1.1  macallan #define  CR_SET      0x0F
    128  1.1  macallan #define CMD_STYLE 0x4058
    129  1.1  macallan #define  CS_SOLID    0x01
    130  1.1  macallan #define  CS_TRNSP    0x02
    131  1.1  macallan #define  CS_STP_NO   0x00
    132  1.1  macallan #define  CS_STP_PL   0x04
    133  1.1  macallan #define  CS_STP_PA32 0x08
    134  1.1  macallan #define  CS_STP_PA8  0x0C
    135  1.1  macallan #define  CS_EDI      0x10
    136  1.1  macallan #define CMD_PATRN 0x405C
    137  1.1  macallan #define  CP_APAT_NO  0x00
    138  1.1  macallan #define  CP_APAT_8X  0x01
    139  1.1  macallan #define  CP_APAT_32X 0x02
    140  1.1  macallan #define  CP_NLST     0x04
    141  1.1  macallan #define  CP_PRST     0x08
    142  1.1  macallan #define CMD_CLP   0x4060
    143  1.1  macallan #define  CC_NOCLP    0x00
    144  1.1  macallan #define  CC_CLPRECI  0x02
    145  1.1  macallan #define  CC_CLPRECO  0x03
    146  1.1  macallan #define  CC_CLPSTOP  0x04
    147  1.1  macallan #define CMD_HDF   0x4064
    148  1.1  macallan #define  CH_BIT_SWP  0x01
    149  1.1  macallan #define  CH_BYT_SWP  0x02
    150  1.1  macallan #define  CH_WRD_SWP  0x04
    151  1.1  macallan #define FORE      0x4068
    152  1.1  macallan #define BACK      0x406C
    153  1.1  macallan #define MASK      0x4070
    154  1.1  macallan #define RMSK      0x4074
    155  1.1  macallan #define LPAT      0x4078
    156  1.1  macallan #define PCTRL     0x407C
    157  1.1  macallan #define  PC_PLEN_MSK  0x0000001F
    158  1.1  macallan #define  PC_PSCL_MSK  0x000000E0
    159  1.1  macallan #define  PC_SPTR_MSK  0x00001F00
    160  1.1  macallan #define  PC_SSCL_MSK  0x0000E000
    161  1.1  macallan #define  PC_STATE_MSK 0xFFFF0000
    162  1.2  macallan #define CLPTL     0x4080		/* clipping top/left */
    163  1.1  macallan #define  CLPTLY_MSK   0x0000FFFF
    164  1.1  macallan #define  CLPTLX_MSK   0xFFFF0000
    165  1.2  macallan #define CLPBR     0x4084		/* clipping bottom/right */
    166  1.1  macallan #define  CLPBRY_MSK   0x0000FFFF
    167  1.1  macallan #define  CLPBRX_MSK   0xFFFF0000
    168  1.1  macallan #define XY0_SRC   0x4088
    169  1.1  macallan #define XY1_DST   0x408C      /* trigger */
    170  1.1  macallan #define XY2_WH    0x4090
    171  1.1  macallan #define XY3_DIR   0x4094
    172  1.1  macallan #define  DIR_LR_TB    0x00000000
    173  1.1  macallan #define  DIR_LR_BT    0x00000001
    174  1.1  macallan #define  DIR_RL_TB    0x00000002
    175  1.1  macallan #define  DIR_RL_BT    0x00000003
    176  1.1  macallan #define  DIR_BT		0x00000001
    177  1.1  macallan #define  DIR_RL		0x00000002
    178  1.1  macallan #define XY4_ZM    0x4098
    179  1.1  macallan #define  ZOOM_NONE    0x00000000
    180  1.1  macallan #define  XY_Y_DATA    0x0000FFFF
    181  1.1  macallan #define  XY_X_DATA    0xFFFF0000
    182  1.1  macallan #define  XY_I_DATA1   0x0000FFFF
    183  1.1  macallan #define  XY_I_DATA2   0xFFFF0000
    184  1.1  macallan #define DL_ADR    0x40F8
    185  1.1  macallan #define DL_CNTRL  0x40FC
    186  1.1  macallan #define ACNTRL    0x416C
    187  1.1  macallan 
    188  1.1  macallan /* wait until the blitter can accept another command */
    189  1.1  macallan #define I128_READY(tag, regh) \
    190  1.1  macallan 	do {} while ((bus_space_read_4(tag, regh, BUSY) & BUSY_BUSY) != 0);
    191  1.1  macallan 
    192  1.1  macallan /* wait until it's safe to access video memory */
    193  1.1  macallan #define I128_DONE(tag, regh) \
    194  1.1  macallan 	do {} while ((bus_space_read_4(tag, regh, FLOW) & 0x0f) != 0);
    195  1.1  macallan 
    196  1.1  macallan #endif /* I128REG_H */
    197