1/*	$NetBSD: zxvar.h,v 1.5 2009/09/17 16:28:13 tsutsui Exp $	*/
2
3/*
4 *  Copyright (c) 2002 The NetBSD Foundation, Inc.
5 *  All rights reserved.
6 *
7 *  This code is derived from software contributed to The NetBSD Foundation
8 *  by Andrew Doran.
9 *
10 *  Redistribution and use in source and binary forms, with or without
11 *  modification, are permitted provided that the following conditions
12 *  are met:
13 *  1. Redistributions of source code must retain the above copyright
14 *     notice, this list of conditions and the following disclaimer.
15 *  2. Redistributions in binary form must reproduce the above copyright
16 *     notice, this list of conditions and the following disclaimer in the
17 *     documentation and/or other materials provided with the distribution.
18 *
19 *  THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 *  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 *  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 *  PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 *  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 *  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 *  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 *  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 *  POSSIBILITY OF SUCH DAMAGE.
30 */
31
32/*
33 * Copyright (C) 1999, 2000 Jakub Jelinek (jakub@redhat.com)
34 *
35 * Permission is hereby granted, free of charge, to any person obtaining a copy
36 * of this software and associated documentation files (the "Software"), to deal
37 * in the Software without restriction, including without limitation the rights
38 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
39 * copies of the Software, and to permit persons to whom the Software is
40 * furnished to do so, subject to the following conditions:
41 *
42 * The above copyright notice and this permission notice shall be included in
43 * all copies or substantial portions of the Software.
44 *
45 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
46 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
47 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
48 * JAKUB JELINEK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
49 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
50 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
51 *
52 */
53
54#ifndef _DEV_SBUS_ZXVAR_H_
55#define _DEV_SBUS_ZXVAR_H_
56
57/*
58 * Sun (and Linux) compatible offsets for mmap().
59 */
60#define ZX_FB0_VOFF		0x00000000
61#define ZX_LC0_VOFF		0x00800000
62#define ZX_LD0_VOFF		0x00801000
63#define ZX_LX0_CURSOR_VOFF	0x00802000
64#define ZX_FB1_VOFF		0x00803000
65#define ZX_LC1_VOFF		0x01003000
66#define ZX_LD1_VOFF		0x01004000
67#define ZX_LX0_VERT_VOFF	0x01005000
68#define ZX_LX_KRN_VOFF		0x01006000
69#define ZX_LC0_KRN_VOFF		0x01007000
70#define ZX_LC1_KRN_VOFF		0x01008000
71#define ZX_LD_GBL_VOFF		0x01009000
72
73#define	ZX_WID_SHARED_8	0
74#define	ZX_WID_SHARED_24	1
75#define	ZX_WID_DBL_8		2
76#define	ZX_WID_DBL_24		3
77
78/*
79 * Per-instance data.
80 */
81struct zx_softc {
82	device_t	sc_dv;
83	struct fbdevice	sc_fb;
84	bus_space_tag_t	sc_bt;
85
86	bus_space_handle_t sc_bhzc;
87	bus_space_handle_t sc_bhzx;
88	bus_space_handle_t sc_bhzdss0;
89	bus_space_handle_t sc_bhzdss1;
90	bus_space_handle_t sc_bhzcu;
91
92	int		sc_flags;
93	uint8_t		*sc_cmap;
94	uint32_t	*sc_pixels;
95	bus_addr_t	sc_paddr;
96	int		sc_shiftx;
97	int		sc_shifty;
98
99	struct fbcurpos	sc_curpos;
100	struct fbcurpos	sc_curhot;
101	struct fbcurpos sc_cursize;
102	uint8_t		sc_curcmap[8];
103	uint32_t	sc_curbits[2][32];
104
105#if NWSDISPLAY > 0
106	uint32_t sc_width;
107	uint32_t sc_height;	/* display width / height */
108	uint32_t sc_stride;
109	int sc_mode;
110	uint32_t sc_bg;
111	struct vcons_data vd;
112#endif
113};
114#define	ZX_BLANKED	0x01
115#define	ZX_CURSOR	0x02
116
117#endif	/* !_DEV_SBUS_ZXVAR_H_ */
118