/*
* Copyright (c) 1996 Tobias Abt
* Copyright (c) 1995 Ezra Story
* Copyright (c) 1995 Kari Mettinen
* Copyright (c) 1994 Markus Wild
* Copyright (c) 1994 Lutz Vieweg
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Lutz Vieweg.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _GRF_ETREG_H
#define _GRF_ETREG_H
/*
* Written & Copyright by Kari Mettinen, Ezra Story.
*
* This is derived from Cirrus driver source
*/
/* Extension to grfvideo_mode to support text modes.
* This can be passed to both text & gfx functions
* without worry. If gv.depth == 4, then the extended
* fields for a text mode are present.
*/
struct grfettext_mode {
struct grfvideo_mode gv;
unsigned short fx; /* font x dimension */
unsigned short fy; /* font y dimension */
unsigned short cols; /* screen dimensions */
unsigned short rows;
void *fdata; /* font data */
unsigned short fdstart;
unsigned short fdend;
};
/* Tseng boards types, stored in ettype in grf_et.c.
* used to decide how to handle Pass-through, etc.
*/
#define OMNIBUS 2181
#define DOMINO 2167
#define MERLIN 2117
/*
* defines for the used register addresses (mw)
*
* NOTE: there are some registers that have different addresses when
* in mono or color mode. We only support color mode, and thus
* some addresses won't work in mono-mode!
*
* General and VGA-registers taken from retina driver. Fixed a few
* bugs in it. (SR and GR read address is Port + 1, NOT Port)
*
*/
#define SetTextPlane(ba, m) \
do { \
WGfx(ba, GCT_ID_READ_MAP_SELECT, m & 3 ); \
WSeq(ba, SEQ_ID_MAP_MASK, (1 << (m & 3))); \
} while (0)
#define setMerlinDACmode(ba, mode) \
do { \
vgaw(ba, MERLIN_VDAC_DATA, mode | \
(vgar(ba, MERLIN_VDAC_DATA) & 0x0f)); \
} while (0)
/* Special wakeup/passthrough registers on graphics boards
*
* The methods have diverged a bit for each board, so
* WPass(P) has been converted into a set of specific
* inline functions.
*/
static inline void RegWakeup(volatile void *ba) {
extern int ettype;
switch (ettype) {
case OMNIBUS:
vgaw(ba, PASS_ADDRESS_W, 0x00);
break;
case DOMINO:
vgaw(ba, PASS_ADDRESS_DOM, 0x00);
break;
case MERLIN:
break;
}
delay(200000);
}