xref: /original-bsd/sys/sparc/sbus/cgsixreg.h (revision 95ecee29)
1 /*
2  * Copyright (c) 1993 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * This software was developed by the Computer Systems Engineering group
6  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
7  * contributed to Berkeley.
8  *
9  * All advertising materials mentioning features or use of this software
10  * must display the following acknowledgement:
11  *	This product includes software developed by the University of
12  *	California, Lawrence Berkeley Laboratory.
13  *
14  * %sccs.include.redist.c%
15  *
16  *	@(#)cgsixreg.h	8.1 (Berkeley) 10/30/93
17  *
18  * from: $Header: cgsixreg.h,v 1.1 93/10/12 15:29:24 torek Exp $
19  */
20 
21 /*
22  * CG6 display registers.  (Note, I got tired of writing `cgsix' about
23  * halfway through and changed everything to cg6, but I probably missed
24  * some.  Unfortunately, the way config works, we need to spell out `six'
25  * in some places anyway.)
26  *
27  * The cg6 is a complicated beastie.  We have been unable to extract any
28  * documentation and most of the following are guesses based on a limited
29  * amount of reverse engineering.
30  *
31  * A cg6 is composed of numerous groups of control registers, all with TLAs:
32  *	FBC - frame buffer control?
33  *	FHC - fbc hardware configuration?
34  *	DHC - ???
35  *	TEC - transform engine control?
36  *	THC - TEC Hardware Configuration (this is where our action goes)
37  *	ROM - a 64Kbyte ROM with who knows what in it.
38  *	colormap - see below
39  *	frame buffer memory (video RAM)
40  *	possible other stuff
41  *
42  * Like the cg3, the cg6 uses a Brooktree Video DAC (see btreg.h).
43  */
44 
45 /*
46  * The layout of the THC.
47  */
48 struct cg6_thc {
49 	u_int	thc_xxx0[512];	/* ??? */
50 	u_int	thc_hsync1;	/* horizontal sync timing */
51 	u_int	thc_hsync2;	/* more hsync timing */
52 	u_int	thc_hsync3;	/* yet more hsync timing */
53 	u_int	thc_vsync1;	/* vertical sync timing */
54 	u_int	thc_vsync2;	/* only two of these */
55 	u_int	thc_refresh;	/* refresh counter */
56 	u_int	thc_misc;	/* miscellaneous control & status */
57 	u_int	thc_xxx1[56];	/* ??? */
58 	u_int	thc_cursxy;	/* cursor x,y position (16 bits each) */
59 	u_int	thc_cursmask[32];	/* cursor mask bits */
60 	u_int	thc_cursbits[32];	/* what to show where mask enabled */
61 };
62 
63 /* bits in thc_misc */
64 #define	THC_MISC_XXX0		0xfff00000	/* unused */
65 #define	THC_MISC_REVMASK	0x000f0000	/* cg6 revision? */
66 #define	THC_MISC_REVSHIFT	16
67 #define	THC_MISC_XXX1		0x0000e000	/* unused */
68 #define	THC_MISC_RESET		0x00001000	/* ??? */
69 #define	THC_MISC_XXX2		0x00000800	/* unused */
70 #define	THC_MISC_VIDEN		0x00000400	/* video enable */
71 #define	THC_MISC_SYNC		0x00000200	/* not sure what ... */
72 #define	THC_MISC_VSYNC		0x00000100	/* ... these really are */
73 #define	THC_MISC_SYNCEN		0x00000080	/* sync enable */
74 #define	THC_MISC_CURSRES	0x00000040	/* cursor resolution */
75 #define	THC_MISC_INTEN		0x00000020	/* v.retrace intr enable */
76 #define	THC_MISC_INTR		0x00000010	/* intr pending / ack bit */
77 #define	THC_MISC_XXX		0x0000000f	/* ??? */
78 
79 /* cursor x / y position value for `off' */
80 #define	THC_CURSOFF	(65536-32)	/* i.e., USHRT_MAX+1-32 */
81 
82 /*
83  * This structure exists only to compute the layout of the CG6
84  * hardware.  Each of the individual substructures lives on a
85  * separate `page' (where a `page' is at least 4K), and many are
86  * very far apart.  We avoid large offsets (which make for lousy
87  * code) by using pointers to the individual interesting pieces,
88  * and map them in independently (to avoid using up PTEs unnecessarily).
89  */
90 struct cg6_layout {
91 	/* ROM at 0 */
92 	union {
93 		long un_id;		/* ID = ?? */
94 		char un_rom[65536];	/* 64K rom */
95 		char un_pad[0x200000];
96 	} cg6_rom_un;
97 
98 	/* Brooktree DAC at 0x200000 */
99 	union {
100 		struct bt_regs un_btregs;
101 		char un_pad[0x040000];
102 	} cg6_bt_un;
103 
104 	/* DHC, whatever that is, at 0x240000 */
105 	union {
106 		char un_pad[0x40000];
107 	} cg6_dhc_un;
108 
109 	/* ALT, whatever that is, at 0x280000 */
110 	union {
111 		char un_pad[0x80000];
112 	} cg6_alt_un;
113 
114 	/* FHC, whatever that is, at 0x300000 */
115 	union {
116 		char un_pad[0x1000];
117 	} cg6_fhc_un;
118 
119 	/* THC at 0x301000 */
120 	union {
121 		struct cg6_thc un_thc;
122 		char un_pad[0x400000 - 0x1000];
123 	} cg6_thc_un;
124 
125 	/* FBC at 0x700000 */
126 	union {
127 		char un_pad[0x1000];
128 	} cg6_fbc_un;
129 
130 	/* TEC at 0x701000 */
131 	union {
132 		char un_pad[0x100000 - 0x1000];
133 	} cg6_tec_un;
134 
135 	/* Video RAM at 0x800000 */
136 	char	cg6_ram[1024 * 1024];	/* approx.? */
137 };
138