xref: /netbsd-src/sys/arch/hp300/dev/topcatreg.h (revision 894f3323997877266aac6807d93c20c9e3c24eed)
1 /*	$OpenBSD: topcatreg.h,v 1.2 2005/01/24 21:36:39 miod Exp $	*/
2 /*	$NetBSD: topcatreg.h,v 1.5 2024/04/29 14:58:32 tsutsui Exp $	*/
3 
4 /*
5  * Copyright (c) 1988 University of Utah.
6  * Copyright (c) 1990, 1993
7  *	The Regents of the University of California.  All rights reserved.
8  *
9  * This code is derived from software contributed to Berkeley by
10  * the Systems Programming Group of the University of Utah Computer
11  * Science Department.
12  *
13  * Redistribution and use in source and binary forms, with or without
14  * modification, are permitted provided that the following conditions
15  * are met:
16  * 1. Redistributions of source code must retain the above copyright
17  *    notice, this list of conditions and the following disclaimer.
18  * 2. Redistributions in binary form must reproduce the above copyright
19  *    notice, this list of conditions and the following disclaimer in the
20  *    documentation and/or other materials provided with the distribution.
21  * 3. Neither the name of the University nor the names of its contributors
22  *    may be used to endorse or promote products derived from this software
23  *    without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35  * SUCH DAMAGE.
36  *
37  * from: Utah $Hdr: grf_tcreg.h 1.11 92/01/21$
38  *
39  *	@(#)grf_tcreg.h	8.1 (Berkeley) 6/10/93
40  */
41 
42 #define tccm_waitbusy(regaddr) \
43 do { \
44 	while (((volatile struct tcboxfb *)(regaddr))->cmap_busy & 0x04) \
45 		DELAY(100); \
46 } while (/* CONSTCOND */0)
47 
48 #define tc_waitbusy(regaddr,planes) \
49 do { \
50 	while (((volatile struct tcboxfb *)(regaddr))->busy & planes) \
51 		DELAY(100); \
52 } while (/* CONSTCOND */0)
53 
54 struct tcboxfb {
55 	struct diofbreg regs;
56 	uint8_t f2[0x4040-0x5f-1];
57 	uint8_t vblank;			/* vertical blanking	      0x4040 */
58 	uint8_t :8,:8,:8;
59 	uint8_t busy;			/* window move active	      0x4044 */
60 	uint8_t :8,:8,:8;
61 	uint8_t vtrace_request;		/* vert retrace intr request  0x4048 */
62 	uint8_t :8,:8,:8;
63 	uint8_t move_request;		/* window move intr request   0x404C */
64 	uint8_t f3[0x4080-0x404c-1];
65 	uint8_t nblank;			/* display enable planes      0x4080 */
66 	uint8_t f4[0x4088-0x4080-1];
67 	uint8_t wen;			/* write enable plane	      0x4088 */
68 	uint8_t f5[0x408c-0x4088-1];
69 	uint8_t ren;			/* read enable plane          0x408c */
70 	uint8_t f6[0x4090-0x408c-1];
71 	uint8_t fben;			/* frame buffer write enable  0x4090 */
72 	uint8_t f7[0x409c-0x4090-1];
73 	uint8_t wmove;			/* start window move	      0x409c */
74 	uint8_t f8[0x40a0-0x409c-1];
75 	uint8_t blink;			/* enable blink planes	      0x40a0 */
76 	uint8_t f9[0x40a8-0x40a0-1];
77 	uint8_t altframe;		/* enable alternate frame     0x40a8 */
78 	uint8_t f10[0x40ac-0x40a8-1];
79 	uint8_t curon;			/* cursor control register    0x40ac */
80 	uint8_t f11[0x40ea-0x40ac-1];
81 	uint8_t prr;			/* pixel replacement rule     0x40ea */
82 	uint8_t f12[0x40ef-0x40ea-1];
83 	uint8_t wmrr;			/* move replacement rule      0x40ef */
84 	uint8_t f13[0x40f2-0x40ef-1];
85 	uint16_t source_x;		/* source x pixel #	      0x40f2 */
86 	uint8_t f14[0x40f6-0x40f2-2];
87 	uint16_t source_y;		/* source y pixel #	      0x40f6 */
88 	uint8_t f15[0x40fa-0x40f6-2];
89 	uint16_t dest_x;		/* dest x pixel #	      0x40fa */
90 	uint8_t f16[0x40fe -0x40fa-2];
91 	uint16_t dest_y;		/* dest y pixel #	      0x40fe */
92 	uint8_t f17[0x4102-0x40fe -2];
93 	uint16_t wwidth;		/* block mover pixel width    0x4102 */
94 	uint8_t f18[0x4106-0x4102-2];
95 	uint16_t wheight;		/* block mover pixel height   0x4106 */
96   /* Catseye */
97 	uint8_t f19[0x4206-0x4106-2];
98 	uint16_t rug_cmdstat;		/* RUG Command/Status	      0x4206 */
99 	uint8_t f20[0x4510-0x4206-2];
100 	uint16_t vb_select;		/* Vector/BitBlt Select	      0x4510 */
101 	uint16_t tcntrl;		/* Three Operand Control      0x4512 */
102 	uint16_t acntrl;		/* BitBlt Mode		      0x4514 */
103 	uint16_t pncntrl;		/* Plane Control	      0x4516 */
104 	uint8_t f21[0x4800-0x4516-2];
105 	uint16_t catseye_status;	/* Catseye Status	      0x4800 */
106   /* End of Catseye */
107 	uint8_t f22[0x6002-0x4800-2];
108 	uint16_t cmap_busy;		/* Color Ram busy	      0x6002 */
109 	uint8_t f23[0x60b2-0x6002-2];
110 	uint16_t rdata;			/* color map red data	      0x60b2 */
111 	uint16_t gdata;			/* color map green data       0x60b4 */
112 	uint16_t bdata;			/* color map blue data	      0x60b6 */
113 	uint16_t cindex;		/* color map index	      0x60b8 */
114 	uint16_t plane_mask;		/* plane mask select	      0x60ba */
115 	uint8_t f24[0x60f0-0x60ba-2];
116 	uint16_t strobe;		/* color map trigger	      0x60f0 */
117 };
118