--- .empty Thu Jan 1 00:00:00 1970 +++ NEW/xc/programs/Xserver/hw/cg14.2screen/cg14.h Thu Jan 1 00:00:00 1970 @@ -0,0 +1,90 @@ +#ifndef _CG14_H_b07ebac6_ +#define _CG14_H_b07ebac6_ + +#define CG14_REGS_CTL 0x0000 +#define CG14_REGS_CURS 0x1000 +#define CG14_REGS_DAC 0x2000 +#define CG14_REGS_XLUT 0x3000 +#define CG14_REGS_CLUT1 0x4000 +#define CG14_REGS_CLUT2 0x5000 +#define CG14_REGS_CLUT3 0x6000 +#define CG14_REGS_CLUTINCR 0xf000 + +/* main control registers */ +struct cg14ctl { + volatile unsigned char mctl; +#define CG14_MCTL_ENABLEINTR 0x80 +#define CG14_MCTL_ENABLEVID 0x40 +#define CG14_MCTL_PIXMODE_MASK 0x30 +#define CG14_MCTL_PIXMODE_8 0x00 +#define CG14_MCTL_PIXMODE_16 0x20 +#define CG14_MCTL_PIXMODE_32 0x30 +#define CG14_MCTL_TMR 0x0c +#define CG14_MCTL_ENABLETMR 0x02 +#define CG14_MCTL_rev0RESET 0x01 +#define CG14_MCTL_POWERCTL 0x01 + volatile unsigned char ppr; /* packed pixel register */ + volatile unsigned char tmsr0; /* test status reg. 0 */ + volatile unsigned char tmsr1; /* test status reg. 1 */ + volatile unsigned char msr; /* master status register */ + volatile unsigned char fsr; /* fault status register */ + volatile unsigned char rsr; /* revision status register */ +#define CG14_RSR_REVMASK 0xf0 +#define CG14_RSR_IMPLMASK 0x0f + volatile unsigned char ctl_ccr; /* clock control register */ + /* believed to actually be longer */ + } ; + +/* hardware cursor control */ +struct cg14curs { + volatile unsigned int plane0[32]; + volatile unsigned int plane1[32]; + volatile unsigned char ctl; +#define CG14_CURS_ENABLE 0x4 +#define CG14_CURS_DOUBLEBUFFER 0x2 + volatile unsigned char pad0[3]; + volatile unsigned short int x; + volatile unsigned short int y; + volatile unsigned int color0; + volatile unsigned int color1; + volatile unsigned int pad[444]; + volatile unsigned int plane0incr[32]; + volatile unsigned int plane1incr[32]; + } ; + +/* DAC - what do these do? */ +struct cg14dac { + volatile unsigned char addr; /* "address register" */ + volatile unsigned char pad0[255]; + volatile unsigned char gammalut; /* "gamma LUT" */ + volatile unsigned char pad1[255]; + volatile unsigned char regsel; /* "register select" */ + volatile unsigned char pad2[255]; + volatile unsigned char mode; /* "mode register" */ + } ; + +/* XLUT - lookup tables affecting X channel stuff */ +struct cg14xlut { + volatile unsigned char lut[256]; + volatile unsigned char lutd[256]; + volatile unsigned char pad0[0x800-256-256]; + volatile unsigned char lutinc[256]; + volatile unsigned char lutincd[256]; + } ; + +/* CLUT - lookup tables for colour channels */ +struct cg14clut { + volatile unsigned int lut[256]; + volatile unsigned int lutd[256]; + volatile unsigned int lutinc[256]; + volatile unsigned int lutincd[256]; + } ; + +extern void *fbregs; +extern volatile struct cg14ctl *ctl; +extern volatile struct cg14xlut *xlut; +extern volatile struct cg14clut *clut1; +extern void *vram_cbgr; +extern void *vram_px32; + +#endif