11.1Stsutsui/*	$OpenBSD: topcatreg.h,v 1.2 2005/01/24 21:36:39 miod Exp $	*/
21.5Stsutsui/*	$NetBSD: topcatreg.h,v 1.5 2024/04/29 14:58:32 tsutsui Exp $	*/
31.1Stsutsui
41.1Stsutsui/*
51.1Stsutsui * Copyright (c) 1988 University of Utah.
61.1Stsutsui * Copyright (c) 1990, 1993
71.1Stsutsui *	The Regents of the University of California.  All rights reserved.
81.1Stsutsui *
91.1Stsutsui * This code is derived from software contributed to Berkeley by
101.1Stsutsui * the Systems Programming Group of the University of Utah Computer
111.1Stsutsui * Science Department.
121.1Stsutsui *
131.1Stsutsui * Redistribution and use in source and binary forms, with or without
141.1Stsutsui * modification, are permitted provided that the following conditions
151.1Stsutsui * are met:
161.1Stsutsui * 1. Redistributions of source code must retain the above copyright
171.1Stsutsui *    notice, this list of conditions and the following disclaimer.
181.1Stsutsui * 2. Redistributions in binary form must reproduce the above copyright
191.1Stsutsui *    notice, this list of conditions and the following disclaimer in the
201.1Stsutsui *    documentation and/or other materials provided with the distribution.
211.1Stsutsui * 3. Neither the name of the University nor the names of its contributors
221.1Stsutsui *    may be used to endorse or promote products derived from this software
231.1Stsutsui *    without specific prior written permission.
241.1Stsutsui *
251.1Stsutsui * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
261.1Stsutsui * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
271.1Stsutsui * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
281.1Stsutsui * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
291.1Stsutsui * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
301.1Stsutsui * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
311.1Stsutsui * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
321.1Stsutsui * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
331.1Stsutsui * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
341.1Stsutsui * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
351.1Stsutsui * SUCH DAMAGE.
361.1Stsutsui *
371.1Stsutsui * from: Utah $Hdr: grf_tcreg.h 1.11 92/01/21$
381.1Stsutsui *
391.1Stsutsui *	@(#)grf_tcreg.h	8.1 (Berkeley) 6/10/93
401.1Stsutsui */
411.1Stsutsui
421.1Stsutsui#define tccm_waitbusy(regaddr) \
431.1Stsutsuido { \
441.1Stsutsui	while (((volatile struct tcboxfb *)(regaddr))->cmap_busy & 0x04) \
451.5Stsutsui		DELAY(100); \
461.2Stsutsui} while (/* CONSTCOND */0)
471.1Stsutsui
481.1Stsutsui#define tc_waitbusy(regaddr,planes) \
491.1Stsutsuido { \
501.1Stsutsui	while (((volatile struct tcboxfb *)(regaddr))->busy & planes) \
511.5Stsutsui		DELAY(100); \
521.2Stsutsui} while (/* CONSTCOND */0)
531.1Stsutsui
541.1Stsutsuistruct tcboxfb {
551.1Stsutsui	struct diofbreg regs;
561.2Stsutsui	uint8_t f2[0x4040-0x5f-1];
571.2Stsutsui	uint8_t vblank;			/* vertical blanking	      0x4040 */
581.2Stsutsui	uint8_t :8,:8,:8;
591.2Stsutsui	uint8_t busy;			/* window move active	      0x4044 */
601.2Stsutsui	uint8_t :8,:8,:8;
611.2Stsutsui	uint8_t vtrace_request;		/* vert retrace intr request  0x4048 */
621.2Stsutsui	uint8_t :8,:8,:8;
631.2Stsutsui	uint8_t move_request;		/* window move intr request   0x404C */
641.2Stsutsui	uint8_t f3[0x4080-0x404c-1];
651.2Stsutsui	uint8_t nblank;			/* display enable planes      0x4080 */
661.2Stsutsui	uint8_t f4[0x4088-0x4080-1];
671.3Stsutsui	uint8_t wen;			/* write enable plane	      0x4088 */
681.2Stsutsui	uint8_t f5[0x408c-0x4088-1];
691.2Stsutsui	uint8_t ren;			/* read enable plane          0x408c */
701.2Stsutsui	uint8_t f6[0x4090-0x408c-1];
711.2Stsutsui	uint8_t fben;			/* frame buffer write enable  0x4090 */
721.2Stsutsui	uint8_t f7[0x409c-0x4090-1];
731.3Stsutsui	uint8_t wmove;			/* start window move	      0x409c */
741.2Stsutsui	uint8_t f8[0x40a0-0x409c-1];
751.3Stsutsui	uint8_t blink;			/* enable blink planes	      0x40a0 */
761.2Stsutsui	uint8_t f9[0x40a8-0x40a0-1];
771.2Stsutsui	uint8_t altframe;		/* enable alternate frame     0x40a8 */
781.2Stsutsui	uint8_t f10[0x40ac-0x40a8-1];
791.2Stsutsui	uint8_t curon;			/* cursor control register    0x40ac */
801.2Stsutsui	uint8_t f11[0x40ea-0x40ac-1];
811.2Stsutsui	uint8_t prr;			/* pixel replacement rule     0x40ea */
821.2Stsutsui	uint8_t f12[0x40ef-0x40ea-1];
831.2Stsutsui	uint8_t wmrr;			/* move replacement rule      0x40ef */
841.2Stsutsui	uint8_t f13[0x40f2-0x40ef-1];
851.3Stsutsui	uint16_t source_x;		/* source x pixel #	      0x40f2 */
861.2Stsutsui	uint8_t f14[0x40f6-0x40f2-2];
871.3Stsutsui	uint16_t source_y;		/* source y pixel #	      0x40f6 */
881.2Stsutsui	uint8_t f15[0x40fa-0x40f6-2];
891.3Stsutsui	uint16_t dest_x;		/* dest x pixel #	      0x40fa */
901.2Stsutsui	uint8_t f16[0x40fe -0x40fa-2];
911.3Stsutsui	uint16_t dest_y;		/* dest y pixel #	      0x40fe */
921.2Stsutsui	uint8_t f17[0x4102-0x40fe -2];
931.2Stsutsui	uint16_t wwidth;		/* block mover pixel width    0x4102 */
941.2Stsutsui	uint8_t f18[0x4106-0x4102-2];
951.2Stsutsui	uint16_t wheight;		/* block mover pixel height   0x4106 */
961.1Stsutsui  /* Catseye */
971.2Stsutsui	uint8_t f19[0x4206-0x4106-2];
981.4Sandvar	uint16_t rug_cmdstat;		/* RUG Command/Status	      0x4206 */
991.2Stsutsui	uint8_t f20[0x4510-0x4206-2];
1001.2Stsutsui	uint16_t vb_select;		/* Vector/BitBlt Select	      0x4510 */
1011.2Stsutsui	uint16_t tcntrl;		/* Three Operand Control      0x4512 */
1021.2Stsutsui	uint16_t acntrl;		/* BitBlt Mode		      0x4514 */
1031.2Stsutsui	uint16_t pncntrl;		/* Plane Control	      0x4516 */
1041.2Stsutsui	uint8_t f21[0x4800-0x4516-2];
1051.2Stsutsui	uint16_t catseye_status;	/* Catseye Status	      0x4800 */
1061.1Stsutsui  /* End of Catseye */
1071.2Stsutsui	uint8_t f22[0x6002-0x4800-2];
1081.2Stsutsui	uint16_t cmap_busy;		/* Color Ram busy	      0x6002 */
1091.2Stsutsui	uint8_t f23[0x60b2-0x6002-2];
1101.3Stsutsui	uint16_t rdata;			/* color map red data	      0x60b2 */
1111.2Stsutsui	uint16_t gdata;			/* color map green data       0x60b4 */
1121.3Stsutsui	uint16_t bdata;			/* color map blue data	      0x60b6 */
1131.3Stsutsui	uint16_t cindex;		/* color map index	      0x60b8 */
1141.2Stsutsui	uint16_t plane_mask;		/* plane mask select	      0x60ba */
1151.2Stsutsui	uint8_t f24[0x60f0-0x60ba-2];
1161.3Stsutsui	uint16_t strobe;		/* color map trigger	      0x60f0 */
1171.1Stsutsui};
118