i128reg.h revision 1.1 1 1.1 macallan /* $NetBSD: i128reg.h,v 1.1 2007/08/26 00:34:34 macallan 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 * 3. Neither the name of The NetBSD Foundation nor the names of its
16 1.1 macallan * contributors may be used to endorse or promote products derived
17 1.1 macallan * from this software without specific prior written permission.
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 #include <sys/cdefs.h>
33 1.1 macallan __KERNEL_RCSID(0, "$NetBSD: i128reg.h,v 1.1 2007/08/26 00:34:34 macallan Exp $");
34 1.1 macallan
35 1.1 macallan /*
36 1.1 macallan * register definition for Number Nine Imagine 128 graphics controllers
37 1.1 macallan *
38 1.1 macallan * adapted from XFree86's i128 driver source
39 1.1 macallan */
40 1.1 macallan
41 1.1 macallan #ifndef I128REG_H
42 1.1 macallan #define I128REG_H
43 1.1 macallan
44 1.1 macallan #define INTP 0x4000
45 1.1 macallan #define INTP_DD_INT 0x01 /* drawing op completed */
46 1.1 macallan #define INTP_CL_INT 0x02
47 1.1 macallan #define INTM 0x4004
48 1.1 macallan #define INTM_DD_MSK 0x01
49 1.1 macallan #define INTM_CL_MSK 0x02
50 1.1 macallan #define FLOW 0x4008
51 1.1 macallan #define FLOW_DEB 0x01 /* drawing engine busy */
52 1.1 macallan #define FLOW_MCB 0x02 /* mem controller busy */
53 1.1 macallan #define FLOW_CLP 0x04
54 1.1 macallan #define FLOW_PRV 0x08 /* prev cmd still running or cache ready */
55 1.1 macallan #define BUSY 0x400C
56 1.1 macallan #define BUSY_BUSY 0x01 /* command pipeline busy */
57 1.1 macallan #define XYW_AD 0x4010
58 1.1 macallan #define Z_CTRL 0x4018
59 1.1 macallan #define BUF_CTRL 0x4020
60 1.1 macallan #define BC_AMV 0x02
61 1.1 macallan #define BC_MP 0x04
62 1.1 macallan #define BC_AMD 0x08
63 1.1 macallan #define BC_SEN_MSK 0x0300
64 1.1 macallan #define BC_SEN_DB 0x0000
65 1.1 macallan #define BC_SEN_VB 0x0100
66 1.1 macallan #define BC_SEN_MB 0x0200
67 1.1 macallan #define BC_SEN_CB 0x0300
68 1.1 macallan #define BC_DEN_MSK 0x0C00
69 1.1 macallan #define BC_DEN_DB 0x0000
70 1.1 macallan #define BC_DEN_VB 0x0400
71 1.1 macallan #define BC_DEN_MB 0x0800
72 1.1 macallan #define BC_DEN_CB 0x0C00
73 1.1 macallan #define BC_DSE 0x1000
74 1.1 macallan #define BC_VSE 0x2000
75 1.1 macallan #define BC_MSE 0x4000
76 1.1 macallan #define BC_PS_MSK 0x001F0000
77 1.1 macallan #define BC_MDM_MSK 0x00600000
78 1.1 macallan #define BC_MDM_KEY 0x00200000
79 1.1 macallan #define BC_MDM_PLN 0x00400000
80 1.1 macallan #define BC_BLK_ENA 0x00800000
81 1.1 macallan #define BC_PSIZ_MSK 0x03000000
82 1.1 macallan #define BC_PSIZ_8B 0x00000000
83 1.1 macallan #define BC_PSIZ_16B 0x01000000
84 1.1 macallan #define BC_PSIZ_32B 0x02000000
85 1.1 macallan #define BC_PSIZ_NOB 0x03000000
86 1.1 macallan #define BC_CO 0x40000000
87 1.1 macallan #define BC_CR 0x80000000
88 1.1 macallan #define DE_PGE 0x4024
89 1.1 macallan #define DP_DVP_MSK 0x0000001F
90 1.1 macallan #define DP_MP_MSK 0x000F0000
91 1.1 macallan #define DE_SORG 0x4028
92 1.1 macallan #define DE_DORG 0x402C
93 1.1 macallan #define DE_MSRC 0x4030
94 1.1 macallan #define DE_WKEY 0x4038
95 1.1 macallan #define DE_KYDAT 0x403C
96 1.1 macallan #define DE_ZPTCH 0x403C
97 1.1 macallan #define DE_SPTCH 0x4040
98 1.1 macallan #define DE_DPTCH 0x4044
99 1.1 macallan #define CMD 0x4048
100 1.1 macallan #define CMD_OPC_MSK 0x000000FF
101 1.1 macallan #define CMD_ROP_MSK 0x0000FF00
102 1.1 macallan #define CMD_STL_MSK 0x001F0000
103 1.1 macallan #define CMD_CLP_MSK 0x00E00000
104 1.1 macallan #define CMD_PAT_MSK 0x0F000000
105 1.1 macallan #define CMD_HDF_MSK 0x70000000
106 1.1 macallan #define CMD_OPC 0x4050
107 1.1 macallan #define CO_NOOP 0x00
108 1.1 macallan #define CO_BITBLT 0x01
109 1.1 macallan #define CO_LINE 0x02
110 1.1 macallan #define CO_ELINE 0x03
111 1.1 macallan #define CO_TRIAN 0x04
112 1.1 macallan #define CO_RXFER 0x06
113 1.1 macallan #define CO_WXFER 0x07
114 1.1 macallan #define CMD_ROP 0x4054
115 1.1 macallan #define CR_CLEAR 0x00
116 1.1 macallan #define CR_NOR 0x01
117 1.1 macallan #define CR_AND_INV 0x02
118 1.1 macallan #define CR_COPY_INV 0x03
119 1.1 macallan #define CR_AND_REV 0x04
120 1.1 macallan #define CR_INVERT 0x05
121 1.1 macallan #define CR_XOR 0x06
122 1.1 macallan #define CR_NAND 0x07
123 1.1 macallan #define CR_AND 0x08
124 1.1 macallan #define CR_EQUIV 0x09
125 1.1 macallan #define CR_NOOP 0x0A
126 1.1 macallan #define CR_OR_INV 0x0B
127 1.1 macallan #define CR_COPY 0x0C
128 1.1 macallan #define CR_OR_REV 0x0D
129 1.1 macallan #define CR_OR 0x0E
130 1.1 macallan #define CR_SET 0x0F
131 1.1 macallan #define CMD_STYLE 0x4058
132 1.1 macallan #define CS_SOLID 0x01
133 1.1 macallan #define CS_TRNSP 0x02
134 1.1 macallan #define CS_STP_NO 0x00
135 1.1 macallan #define CS_STP_PL 0x04
136 1.1 macallan #define CS_STP_PA32 0x08
137 1.1 macallan #define CS_STP_PA8 0x0C
138 1.1 macallan #define CS_EDI 0x10
139 1.1 macallan #define CMD_PATRN 0x405C
140 1.1 macallan #define CP_APAT_NO 0x00
141 1.1 macallan #define CP_APAT_8X 0x01
142 1.1 macallan #define CP_APAT_32X 0x02
143 1.1 macallan #define CP_NLST 0x04
144 1.1 macallan #define CP_PRST 0x08
145 1.1 macallan #define CMD_CLP 0x4060
146 1.1 macallan #define CC_NOCLP 0x00
147 1.1 macallan #define CC_CLPRECI 0x02
148 1.1 macallan #define CC_CLPRECO 0x03
149 1.1 macallan #define CC_CLPSTOP 0x04
150 1.1 macallan #define CMD_HDF 0x4064
151 1.1 macallan #define CH_BIT_SWP 0x01
152 1.1 macallan #define CH_BYT_SWP 0x02
153 1.1 macallan #define CH_WRD_SWP 0x04
154 1.1 macallan #define FORE 0x4068
155 1.1 macallan #define BACK 0x406C
156 1.1 macallan #define MASK 0x4070
157 1.1 macallan #define RMSK 0x4074
158 1.1 macallan #define LPAT 0x4078
159 1.1 macallan #define PCTRL 0x407C
160 1.1 macallan #define PC_PLEN_MSK 0x0000001F
161 1.1 macallan #define PC_PSCL_MSK 0x000000E0
162 1.1 macallan #define PC_SPTR_MSK 0x00001F00
163 1.1 macallan #define PC_SSCL_MSK 0x0000E000
164 1.1 macallan #define PC_STATE_MSK 0xFFFF0000
165 1.1 macallan #define CLPTL 0x4080
166 1.1 macallan #define CLPTLY_MSK 0x0000FFFF
167 1.1 macallan #define CLPTLX_MSK 0xFFFF0000
168 1.1 macallan #define CLPBR 0x4084
169 1.1 macallan #define CLPBRY_MSK 0x0000FFFF
170 1.1 macallan #define CLPBRX_MSK 0xFFFF0000
171 1.1 macallan #define XY0_SRC 0x4088
172 1.1 macallan #define XY1_DST 0x408C /* trigger */
173 1.1 macallan #define XY2_WH 0x4090
174 1.1 macallan #define XY3_DIR 0x4094
175 1.1 macallan #define DIR_LR_TB 0x00000000
176 1.1 macallan #define DIR_LR_BT 0x00000001
177 1.1 macallan #define DIR_RL_TB 0x00000002
178 1.1 macallan #define DIR_RL_BT 0x00000003
179 1.1 macallan #define DIR_BT 0x00000001
180 1.1 macallan #define DIR_RL 0x00000002
181 1.1 macallan #define XY4_ZM 0x4098
182 1.1 macallan #define ZOOM_NONE 0x00000000
183 1.1 macallan #define XY_Y_DATA 0x0000FFFF
184 1.1 macallan #define XY_X_DATA 0xFFFF0000
185 1.1 macallan #define XY_I_DATA1 0x0000FFFF
186 1.1 macallan #define XY_I_DATA2 0xFFFF0000
187 1.1 macallan #define DL_ADR 0x40F8
188 1.1 macallan #define DL_CNTRL 0x40FC
189 1.1 macallan #define ACNTRL 0x416C
190 1.1 macallan
191 1.1 macallan /* wait until the blitter can accept another command */
192 1.1 macallan #define I128_READY(tag, regh) \
193 1.1 macallan do {} while ((bus_space_read_4(tag, regh, BUSY) & BUSY_BUSY) != 0);
194 1.1 macallan
195 1.1 macallan /* wait until it's safe to access video memory */
196 1.1 macallan #define I128_DONE(tag, regh) \
197 1.1 macallan do {} while ((bus_space_read_4(tag, regh, FLOW) & 0x0f) != 0);
198 1.1 macallan
199 1.1 macallan #endif /* I128REG_H */
200