115fb4814Smrg/*
215fb4814Smrg * Copyright (c) 2005 ASPEED Technology Inc.
315fb4814Smrg *
415fb4814Smrg * Permission to use, copy, modify, distribute, and sell this software and its
515fb4814Smrg * documentation for any purpose is hereby granted without fee, provided that
615fb4814Smrg * the above copyright notice appear in all copies and that both that
715fb4814Smrg * copyright notice and this permission notice appear in supporting
815fb4814Smrg * documentation, and that the name of the authors not be used in
915fb4814Smrg * advertising or publicity pertaining to distribution of the software without
1015fb4814Smrg * specific, written prior permission.  The authors makes no representations
1115fb4814Smrg * about the suitability of this software for any purpose.  It is provided
1215fb4814Smrg * "as is" without express or implied warranty.
1315fb4814Smrg *
1415fb4814Smrg * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
1515fb4814Smrg * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
1615fb4814Smrg * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
1715fb4814Smrg * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
1815fb4814Smrg * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
1915fb4814Smrg * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2015fb4814Smrg * PERFORMANCE OF THIS SOFTWARE.
2115fb4814Smrg */
2215fb4814Smrg
2315fb4814Smrg/* Mode Limitation */
24de78e416Smrg#define MAX_HResolution		1920
2515fb4814Smrg#define MAX_VResolution		1200
267fe5393cSmrg
2715fb4814Smrg/* Std. Table Index Definition */
2815fb4814Smrg#define TextModeIndex 		0
2915fb4814Smrg#define EGAModeIndex 		1
3015fb4814Smrg#define VGAModeIndex 		2
3115fb4814Smrg#define HiCModeIndex 		3
3215fb4814Smrg#define TrueCModeIndex 		4
3315fb4814Smrg
3415fb4814Smrg/* DCLK Index */
3515fb4814Smrg#define VCLK25_175     		0x00
3615fb4814Smrg#define VCLK28_322     		0x01
3715fb4814Smrg#define VCLK31_5       		0x02
3815fb4814Smrg#define VCLK36         		0x03
3915fb4814Smrg#define VCLK40         		0x04
4015fb4814Smrg#define VCLK49_5       		0x05
4115fb4814Smrg#define VCLK50         		0x06
4215fb4814Smrg#define VCLK56_25      		0x07
4315fb4814Smrg#define VCLK65		 	0x08
4415fb4814Smrg#define VCLK75	        	0x09
4515fb4814Smrg#define VCLK78_75      		0x0A
4615fb4814Smrg#define VCLK94_5       		0x0B
4715fb4814Smrg#define VCLK108        		0x0C
4815fb4814Smrg#define VCLK135        		0x0D
4915fb4814Smrg#define VCLK157_5      		0x0E
5015fb4814Smrg#define VCLK162        		0x0F
51de78e416Smrg/* #define VCLK193_25     		0x10 */
52de78e416Smrg#define VCLK154     		0x10
53b410ddbeSmrg#define VCLK83_5    		0x11
54b410ddbeSmrg#define VCLK106_5   		0x12
55b410ddbeSmrg#define VCLK146_25  		0x13
56b410ddbeSmrg#define VCLK148_5   		0x14
57b4d38c65Smrg#define VCLK71      		0x15
58b4d38c65Smrg#define VCLK88_75   		0x16
59b4d38c65Smrg#define VCLK119     		0x17
607fe5393cSmrg#define VCLK85_5     		0x18
617fe5393cSmrg#define VCLK97_75     		0x19
62cf503b78Smrg#define VCLK118_25     		0x1A
6315fb4814Smrg
6415fb4814Smrg/* Flags Definition */
6515fb4814Smrg#define Charx8Dot               0x00000001
6615fb4814Smrg#define HalfDCLK                0x00000002
6715fb4814Smrg#define DoubleScanMode          0x00000004
6815fb4814Smrg#define LineCompareOff          0x00000008
6915fb4814Smrg#define HBorder                 0x00000020
7015fb4814Smrg#define VBorder                 0x00000010
7158e54220Smrg#define WideScreenMode		0x00000100
7258e54220Smrg#define NewModeInfo		0x00000200
7358e54220Smrg#define NHSync			0x00000400
7458e54220Smrg#define PHSync			0x00000800
7558e54220Smrg#define NVSync			0x00001000
7658e54220Smrg#define PVSync			0x00002000
7758e54220Smrg#define	SyncPP			(PVSync | PHSync)
7858e54220Smrg#define	SyncPN			(PVSync | NHSync)
7958e54220Smrg#define	SyncNP			(NVSync | PHSync)
8058e54220Smrg#define	SyncNN			(NVSync | NHSync)
8158e54220Smrg#define AST2500PreCatchCRT		0x00004000
8215fb4814Smrg
8315fb4814Smrg/* DAC Definition */
8415fb4814Smrg#define DAC_NUM_TEXT		64
8515fb4814Smrg#define DAC_NUM_EGA		64
8615fb4814Smrg#define DAC_NUM_VGA		256
8715fb4814Smrg
88f010a93dSmrg/* Data Structure declaration for internal use */
8915fb4814Smrgtypedef struct {
907fe5393cSmrg
917fe5393cSmrg    UCHAR MISC;
9215fb4814Smrg    UCHAR SEQ[4];
9315fb4814Smrg    UCHAR CRTC[25];
947fe5393cSmrg    UCHAR AR[20];
9515fb4814Smrg    UCHAR GR[9];
967fe5393cSmrg
9715fb4814Smrg} VBIOS_STDTABLE_STRUCT, *PVBIOS_STDTABLE_STRUCT;
9815fb4814Smrg
9915fb4814Smrgtypedef struct {
1007fe5393cSmrg
10115fb4814Smrg    ULONG HT;
10215fb4814Smrg    ULONG HDE;
10315fb4814Smrg    ULONG HFP;
10415fb4814Smrg    ULONG HSYNC;
10515fb4814Smrg    ULONG VT;
10615fb4814Smrg    ULONG VDE;
10715fb4814Smrg    ULONG VFP;
10815fb4814Smrg    ULONG VSYNC;
1097fe5393cSmrg    ULONG DCLKIndex;
11015fb4814Smrg    ULONG Flags;
11115fb4814Smrg
11215fb4814Smrg    ULONG ulRefreshRate;
11315fb4814Smrg    ULONG ulRefreshRateIndex;
11415fb4814Smrg    ULONG ulModeID;
1157fe5393cSmrg
11615fb4814Smrg} VBIOS_ENHTABLE_STRUCT, *PVBIOS_ENHTABLE_STRUCT;
11715fb4814Smrg
11815fb4814Smrgtypedef struct {
11915fb4814Smrg    UCHAR Param1;
12015fb4814Smrg    UCHAR Param2;
1217fe5393cSmrg    UCHAR Param3;
12215fb4814Smrg} VBIOS_DCLK_INFO, *PVBIOS_DCLK_INFO;
12315fb4814Smrg
12415fb4814Smrgtypedef struct {
12515fb4814Smrg    UCHAR DACR;
12615fb4814Smrg    UCHAR DACG;
1277fe5393cSmrg    UCHAR DACB;
12815fb4814Smrg} VBIOS_DAC_INFO, *PVBIOS_DAC_INFO;
12915fb4814Smrg
13015fb4814Smrgtypedef struct {
13115fb4814Smrg    PVBIOS_STDTABLE_STRUCT pStdTableEntry;
13215fb4814Smrg    PVBIOS_ENHTABLE_STRUCT pEnhTableEntry;
1337fe5393cSmrg
13415fb4814Smrg} VBIOS_MODE_INFO, *PVBIOS_MODE_INFO;
135