162306a36Sopenharmony_ci/*
262306a36Sopenharmony_ci * linux/include/video/neo_reg.h -- NeoMagic Framebuffer Driver
362306a36Sopenharmony_ci *
462306a36Sopenharmony_ci * Copyright (c) 2001  Denis Oliver Kropp <dok@convergence.de>
562306a36Sopenharmony_ci *
662306a36Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General
762306a36Sopenharmony_ci * Public License.  See the file COPYING in the main directory of this
862306a36Sopenharmony_ci * archive for more details.
962306a36Sopenharmony_ci */
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci#define NEO_BS0_BLT_BUSY        0x00000001
1262306a36Sopenharmony_ci#define NEO_BS0_FIFO_AVAIL      0x00000002
1362306a36Sopenharmony_ci#define NEO_BS0_FIFO_PEND       0x00000004
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci#define NEO_BC0_DST_Y_DEC       0x00000001
1662306a36Sopenharmony_ci#define NEO_BC0_X_DEC           0x00000002
1762306a36Sopenharmony_ci#define NEO_BC0_SRC_TRANS       0x00000004
1862306a36Sopenharmony_ci#define NEO_BC0_SRC_IS_FG       0x00000008
1962306a36Sopenharmony_ci#define NEO_BC0_SRC_Y_DEC       0x00000010
2062306a36Sopenharmony_ci#define NEO_BC0_FILL_PAT        0x00000020
2162306a36Sopenharmony_ci#define NEO_BC0_SRC_MONO        0x00000040
2262306a36Sopenharmony_ci#define NEO_BC0_SYS_TO_VID      0x00000080
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ci#define NEO_BC1_DEPTH8          0x00000100
2562306a36Sopenharmony_ci#define NEO_BC1_DEPTH16         0x00000200
2662306a36Sopenharmony_ci#define NEO_BC1_X_320           0x00000400
2762306a36Sopenharmony_ci#define NEO_BC1_X_640           0x00000800
2862306a36Sopenharmony_ci#define NEO_BC1_X_800           0x00000c00
2962306a36Sopenharmony_ci#define NEO_BC1_X_1024          0x00001000
3062306a36Sopenharmony_ci#define NEO_BC1_X_1152          0x00001400
3162306a36Sopenharmony_ci#define NEO_BC1_X_1280          0x00001800
3262306a36Sopenharmony_ci#define NEO_BC1_X_1600          0x00001c00
3362306a36Sopenharmony_ci#define NEO_BC1_DST_TRANS       0x00002000
3462306a36Sopenharmony_ci#define NEO_BC1_MSTR_BLT        0x00004000
3562306a36Sopenharmony_ci#define NEO_BC1_FILTER_Z        0x00008000
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ci#define NEO_BC2_WR_TR_DST       0x00800000
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci#define NEO_BC3_SRC_XY_ADDR     0x01000000
4062306a36Sopenharmony_ci#define NEO_BC3_DST_XY_ADDR     0x02000000
4162306a36Sopenharmony_ci#define NEO_BC3_CLIP_ON         0x04000000
4262306a36Sopenharmony_ci#define NEO_BC3_FIFO_EN         0x08000000
4362306a36Sopenharmony_ci#define NEO_BC3_BLT_ON_ADDR     0x10000000
4462306a36Sopenharmony_ci#define NEO_BC3_SKIP_MAPPING    0x80000000
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci#define NEO_MODE1_DEPTH8        0x0100
4762306a36Sopenharmony_ci#define NEO_MODE1_DEPTH16       0x0200
4862306a36Sopenharmony_ci#define NEO_MODE1_DEPTH24       0x0300
4962306a36Sopenharmony_ci#define NEO_MODE1_X_320         0x0400
5062306a36Sopenharmony_ci#define NEO_MODE1_X_640         0x0800
5162306a36Sopenharmony_ci#define NEO_MODE1_X_800         0x0c00
5262306a36Sopenharmony_ci#define NEO_MODE1_X_1024        0x1000
5362306a36Sopenharmony_ci#define NEO_MODE1_X_1152        0x1400
5462306a36Sopenharmony_ci#define NEO_MODE1_X_1280        0x1800
5562306a36Sopenharmony_ci#define NEO_MODE1_X_1600        0x1c00
5662306a36Sopenharmony_ci#define NEO_MODE1_BLT_ON_ADDR   0x2000
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_ci/* These are offseted in MMIO space by par->CursorOff */
5962306a36Sopenharmony_ci#define NEOREG_CURSCNTL		0x00
6062306a36Sopenharmony_ci#define NEOREG_CURSX		0x04
6162306a36Sopenharmony_ci#define NEOREG_CURSY		0x08
6262306a36Sopenharmony_ci#define NEOREG_CURSBGCOLOR	0x0C
6362306a36Sopenharmony_ci#define NEOREG_CURSFGCOLOR	0x10
6462306a36Sopenharmony_ci#define NEOREG_CURSMEMPOS	0x14
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_ci#define NEO_CURS_DISABLE	0x00000000
6762306a36Sopenharmony_ci#define NEO_CURS_ENABLE		0x00000001
6862306a36Sopenharmony_ci#define NEO_ICON64_ENABLE	0x00000008
6962306a36Sopenharmony_ci#define NEO_ICON128_ENABLE	0x0000000C
7062306a36Sopenharmony_ci#define NEO_ICON_BLANK		0x00000010
7162306a36Sopenharmony_ci
7262306a36Sopenharmony_ci#define NEO_GR01_SUPPRESS_VSYNC 0x10
7362306a36Sopenharmony_ci#define NEO_GR01_SUPPRESS_HSYNC 0x20
7462306a36Sopenharmony_ci
7562306a36Sopenharmony_ci#ifdef __KERNEL__
7662306a36Sopenharmony_ci
7762306a36Sopenharmony_ci#ifdef NEOFB_DEBUG
7862306a36Sopenharmony_ci# define DBG(x)		printk (KERN_DEBUG "neofb: %s\n", (x));
7962306a36Sopenharmony_ci#else
8062306a36Sopenharmony_ci# define DBG(x)
8162306a36Sopenharmony_ci#endif
8262306a36Sopenharmony_ci
8362306a36Sopenharmony_ci#define PCI_CHIP_NM2070 0x0001
8462306a36Sopenharmony_ci#define PCI_CHIP_NM2090 0x0002
8562306a36Sopenharmony_ci#define PCI_CHIP_NM2093 0x0003
8662306a36Sopenharmony_ci#define PCI_CHIP_NM2097 0x0083
8762306a36Sopenharmony_ci#define PCI_CHIP_NM2160 0x0004
8862306a36Sopenharmony_ci#define PCI_CHIP_NM2200 0x0005
8962306a36Sopenharmony_ci#define PCI_CHIP_NM2230 0x0025
9062306a36Sopenharmony_ci#define PCI_CHIP_NM2360 0x0006
9162306a36Sopenharmony_ci#define PCI_CHIP_NM2380 0x0016
9262306a36Sopenharmony_ci
9362306a36Sopenharmony_ci/* --------------------------------------------------------------------- */
9462306a36Sopenharmony_ci
9562306a36Sopenharmony_citypedef volatile struct {
9662306a36Sopenharmony_ci	__u32 bltStat;
9762306a36Sopenharmony_ci	__u32 bltCntl;
9862306a36Sopenharmony_ci	__u32 xpColor;
9962306a36Sopenharmony_ci	__u32 fgColor;
10062306a36Sopenharmony_ci	__u32 bgColor;
10162306a36Sopenharmony_ci	__u32 pitch;
10262306a36Sopenharmony_ci	__u32 clipLT;
10362306a36Sopenharmony_ci	__u32 clipRB;
10462306a36Sopenharmony_ci	__u32 srcBitOffset;
10562306a36Sopenharmony_ci	__u32 srcStart;
10662306a36Sopenharmony_ci	__u32 reserved0;
10762306a36Sopenharmony_ci	__u32 dstStart;
10862306a36Sopenharmony_ci	__u32 xyExt;
10962306a36Sopenharmony_ci
11062306a36Sopenharmony_ci	__u32 reserved1[19];
11162306a36Sopenharmony_ci
11262306a36Sopenharmony_ci	__u32 pageCntl;
11362306a36Sopenharmony_ci	__u32 pageBase;
11462306a36Sopenharmony_ci	__u32 postBase;
11562306a36Sopenharmony_ci	__u32 postPtr;
11662306a36Sopenharmony_ci	__u32 dataPtr;
11762306a36Sopenharmony_ci} Neo2200;
11862306a36Sopenharmony_ci
11962306a36Sopenharmony_ci#define MMIO_SIZE 0x200000
12062306a36Sopenharmony_ci
12162306a36Sopenharmony_ci#define NEO_EXT_CR_MAX 0x85
12262306a36Sopenharmony_ci#define NEO_EXT_GR_MAX 0xC7
12362306a36Sopenharmony_ci
12462306a36Sopenharmony_cistruct neofb_par {
12562306a36Sopenharmony_ci	struct vgastate state;
12662306a36Sopenharmony_ci	unsigned int ref_count;
12762306a36Sopenharmony_ci
12862306a36Sopenharmony_ci	unsigned char MiscOutReg;	/* Misc */
12962306a36Sopenharmony_ci	unsigned char CRTC[25];		/* Crtc Controller */
13062306a36Sopenharmony_ci	unsigned char Sequencer[5];	/* Video Sequencer */
13162306a36Sopenharmony_ci	unsigned char Graphics[9];	/* Video Graphics */
13262306a36Sopenharmony_ci	unsigned char Attribute[21];	/* Video Attribute */
13362306a36Sopenharmony_ci
13462306a36Sopenharmony_ci	unsigned char GeneralLockReg;
13562306a36Sopenharmony_ci	unsigned char ExtCRTDispAddr;
13662306a36Sopenharmony_ci	unsigned char ExtCRTOffset;
13762306a36Sopenharmony_ci	unsigned char SysIfaceCntl1;
13862306a36Sopenharmony_ci	unsigned char SysIfaceCntl2;
13962306a36Sopenharmony_ci	unsigned char ExtColorModeSelect;
14062306a36Sopenharmony_ci	unsigned char biosMode;
14162306a36Sopenharmony_ci
14262306a36Sopenharmony_ci	unsigned char PanelDispCntlReg1;
14362306a36Sopenharmony_ci	unsigned char PanelDispCntlReg2;
14462306a36Sopenharmony_ci	unsigned char PanelDispCntlReg3;
14562306a36Sopenharmony_ci	unsigned char PanelDispCntlRegRead;
14662306a36Sopenharmony_ci	unsigned char PanelVertCenterReg1;
14762306a36Sopenharmony_ci	unsigned char PanelVertCenterReg2;
14862306a36Sopenharmony_ci	unsigned char PanelVertCenterReg3;
14962306a36Sopenharmony_ci	unsigned char PanelVertCenterReg4;
15062306a36Sopenharmony_ci	unsigned char PanelVertCenterReg5;
15162306a36Sopenharmony_ci	unsigned char PanelHorizCenterReg1;
15262306a36Sopenharmony_ci	unsigned char PanelHorizCenterReg2;
15362306a36Sopenharmony_ci	unsigned char PanelHorizCenterReg3;
15462306a36Sopenharmony_ci	unsigned char PanelHorizCenterReg4;
15562306a36Sopenharmony_ci	unsigned char PanelHorizCenterReg5;
15662306a36Sopenharmony_ci
15762306a36Sopenharmony_ci	int ProgramVCLK;
15862306a36Sopenharmony_ci	unsigned char VCLK3NumeratorLow;
15962306a36Sopenharmony_ci	unsigned char VCLK3NumeratorHigh;
16062306a36Sopenharmony_ci	unsigned char VCLK3Denominator;
16162306a36Sopenharmony_ci	unsigned char VerticalExt;
16262306a36Sopenharmony_ci	int wc_cookie;
16362306a36Sopenharmony_ci	u8 __iomem *mmio_vbase;
16462306a36Sopenharmony_ci	u8 cursorOff;
16562306a36Sopenharmony_ci	u8 *cursorPad;		/* Must die !! */
16662306a36Sopenharmony_ci
16762306a36Sopenharmony_ci	Neo2200 __iomem *neo2200;
16862306a36Sopenharmony_ci
16962306a36Sopenharmony_ci	/* Panels size */
17062306a36Sopenharmony_ci	int NeoPanelWidth;
17162306a36Sopenharmony_ci	int NeoPanelHeight;
17262306a36Sopenharmony_ci
17362306a36Sopenharmony_ci	int maxClock;
17462306a36Sopenharmony_ci
17562306a36Sopenharmony_ci	int pci_burst;
17662306a36Sopenharmony_ci	int lcd_stretch;
17762306a36Sopenharmony_ci	int internal_display;
17862306a36Sopenharmony_ci	int external_display;
17962306a36Sopenharmony_ci	int libretto;
18062306a36Sopenharmony_ci	u32 palette[16];
18162306a36Sopenharmony_ci};
18262306a36Sopenharmony_ci
18362306a36Sopenharmony_citypedef struct {
18462306a36Sopenharmony_ci	int x_res;
18562306a36Sopenharmony_ci	int y_res;
18662306a36Sopenharmony_ci	int mode;
18762306a36Sopenharmony_ci} biosMode;
18862306a36Sopenharmony_ci
18962306a36Sopenharmony_ci#endif
190