xref: /openbsd/sys/arch/sparc64/dev/creatorvar.h (revision b9ac102e)
1 /*	$OpenBSD: creatorvar.h,v 1.11 2006/05/15 21:38:36 miod Exp $	*/
2 
3 /*
4  * Copyright (c) 2002 Jason L. Wright (jason@thought.net),
5  *  Federico G. Schwindt (fgsch@openbsd.org)
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  * 1. Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the distribution.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20  * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
21  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
25  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
26  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 /* device types */
31 #define FFB_CREATOR		0	/* Creator/Creator3d */
32 #define FFB_AFB			1	/* Elite3D */
33 
34 #define	CREATOR_CFFLAG_NOACCEL	0x1
35 
36 struct creator_softc {
37 	struct sunfb sc_sunfb;
38 	bus_space_tag_t sc_bt;
39 	bus_space_handle_t sc_pixel_h;
40 	bus_space_handle_t sc_fbc_h;
41 	bus_space_handle_t sc_dac_h;
42 	bus_addr_t sc_addrs[FFB_NREGS];
43 	bus_size_t sc_sizes[FFB_NREGS];
44 	int sc_nscreens, sc_nreg;
45 	int sc_console;
46 	int sc_node;
47 	int sc_type;
48 	u_int sc_mode;
49 	int32_t sc_fifo_cache, sc_fg_cache;
50 	u_int32_t sc_dacrev;
51 	u_int sc_curs_enabled, sc_curs_fg, sc_curs_bg;
52 	struct wsdisplay_curpos sc_curs_pos, sc_curs_hot, sc_curs_size;
53 	u_char sc_curs_image[512], sc_curs_mask[512];
54 };
55 
56 #define	CREATOR_CURS_MAX	64
57 
58 #define	FBC_WRITE(sc,r,v) \
59     bus_space_write_4((sc)->sc_bt, (sc)->sc_fbc_h, (r), (v))
60 #define	FBC_READ(sc,r) \
61     bus_space_read_4((sc)->sc_bt, (sc)->sc_fbc_h, (r))
62 
63 #define	DAC_WRITE(sc,r,v) \
64     bus_space_write_4((sc)->sc_bt, (sc)->sc_dac_h, (r), (v))
65 #define	DAC_READ(sc,r) \
66     bus_space_read_4((sc)->sc_bt, (sc)->sc_dac_h, (r))
67