diff options
author | Y.C. Chen <yc_chen@aspeedtech.com> | 2010-11-10 14:08:55 +0800 |
---|---|---|
committer | Y.C. Chen <yc_chen@aspeedtech.com> | 2010-11-10 14:08:55 +0800 |
commit | b4466dad5d60c4a79b775c6e6de989563f7eac45 (patch) | |
tree | 68d39683838a699f942eb53a367809f701a4156f /src/ast_vgatool.h | |
parent | e387e54fd65b7db984975bf7a97cf30b5f1b9b9e (diff) |
xf86-video-ast-0.92.02
Diffstat (limited to 'src/ast_vgatool.h')
-rw-r--r-- | src/ast_vgatool.h | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/src/ast_vgatool.h b/src/ast_vgatool.h index 42c866a..53cb4c7 100644 --- a/src/ast_vgatool.h +++ b/src/ast_vgatool.h @@ -27,14 +27,23 @@ #define VIDEOMEM_SIZE_64M 0x04000000 #define VIDEOMEM_SIZE_128M 0x08000000 +#define DRAM_SIZE_016M 0x01000000 +#define DRAM_SIZE_032M 0x02000000 +#define DRAM_SIZE_064M 0x04000000 +#define DRAM_SIZE_128M 0x08000000 +#define DRAM_SIZE_256M 0x10000000 + #define DRAMTYPE_512Mx16 0 #define DRAMTYPE_1Gx16 1 #define DRAMTYPE_512Mx32 2 #define DRAMTYPE_1Gx32 3 +#define DRAMTYPE_2Gx16 6 +#define DRAMTYPE_4Gx16 7 #define AR_PORT_WRITE (pAST->RelocateIO + 0x40) #define MISC_PORT_WRITE (pAST->RelocateIO + 0x42) #define SEQ_PORT (pAST->RelocateIO + 0x44) +#define DAC_INDEX_READ (pAST->MMIOVirtualAddr + 0x3c7) #define DAC_INDEX_WRITE (pAST->RelocateIO + 0x48) #define DAC_DATA (pAST->RelocateIO + 0x49) #define GR_PORT (pAST->RelocateIO + 0x4E) @@ -62,6 +71,19 @@ SetIndexReg(base,index,__Temp); \ } while (0) +#define VGA_GET_PALETTE_INDEX(index, red, green, blue) \ +{ \ + UCHAR __junk; \ + SetReg(DAC_INDEX_READ,(UCHAR)(index)); \ + __junk = GetReg(SEQ_PORT); \ + red = GetReg(DAC_DATA); \ + __junk = GetReg(SEQ_PORT); \ + green = GetReg(DAC_DATA); \ + __junk = GetReg(SEQ_PORT); \ + blue = GetReg(DAC_DATA); \ + __junk = GetReg(SEQ_PORT); \ +} + #define VGA_LOAD_PALETTE_INDEX(index, red, green, blue) \ { \ UCHAR __junk; \ @@ -74,3 +96,69 @@ SetReg(DAC_DATA,(UCHAR)(blue)); \ __junk = GetReg(SEQ_PORT); \ } + +/* Reg. Definition */ +#define AST1180_MEM_BASE 0x40000000 +#define AST1180_MMC_BASE 0x80FC8000 +#define AST1180_SCU_BASE 0x80FC8200 +#define AST1180_GFX_BASE 0x80FC9000 +#define AST1180_VIDEO_BASE 0x80FCD000 + +/* AST1180 GFX */ +#define AST1180_VGA1_CTRL 0x60 +#define AST1180_VGA1_CTRL2 0x64 +#define AST1180_VGA1_STATUS 0x68 +#define AST1180_VGA1_PLL 0x6C +#define AST1180_VGA1_HTREG 0x70 +#define AST1180_VGA1_HRREG 0x74 +#define AST1180_VGA1_VTREG 0x78 +#define AST1180_VGA1_VRREG 0x7C +#define AST1180_VGA1_STARTADDR 0x80 +#define AST1180_VGA1_OFFSET 0x84 +#define AST1180_VGA1_THRESHOLD 0x88 + +#define AST1180_HWC1_OFFSET 0x90 +#define AST1180_HWC1_POSITION 0x94 +#define AST1180_HWC1_PATTERNADDR 0x98 + +#define CRT_LOW_THRESHOLD_VALUE 0x40 +#define CRT_HIGH_THRESHOLD_VALUE 0x7E + +/* GFX Ctrl Reg */ +#define AST1180_ENABLECRT 0x00000001 +#define AST1180_ENABLEHWC 0x00000002 +#define AST1180_MONOHWC 0x00000000 +#define AST1180_ALPHAHWC 0x00000400 +#define AST1180_HSYNCOFF 0x00040000 +#define AST1180_VSYNCOFF 0x00080000 +#define AST1180_VGAOFF 0x00100000 + +#define ReadAST1180SOC(addr, data) \ +{ \ + *(ULONG *) (pAST->MMIOVirtualAddr + 0xF004) = (addr) & 0xFFFF0000; \ + *(ULONG *) (pAST->MMIOVirtualAddr + 0xF000) = 0x1; \ + data = (*(ULONG *) (pAST->MMIOVirtualAddr + 0x10000 + ((addr) & 0x0000FFFF))); \ +} + +#define WriteAST1180SOC(addr, data) \ +{ \ + ULONG temp; \ + *(ULONG *) (pAST->MMIOVirtualAddr + 0xF004) = (addr) & 0xFFFF0000; \ + *(ULONG *) (pAST->MMIOVirtualAddr + 0xF000) = 0x1; \ + *(ULONG *) (pAST->MMIOVirtualAddr + 0x10000 + ((addr) & 0x0000FFFF)) = (data); \ + temp = *(ULONG *) (pAST->MMIOVirtualAddr + 0x10000 + ((addr) & 0x0000FFFF)); \ +} + +#define ReadAST1180MEM(addr, data) \ +{ \ + *(ULONG *) (pAST->MMIOVirtualAddr + 0xF004) = (addr) & 0xFFFF0000; \ + *(ULONG *) (pAST->MMIOVirtualAddr + 0xF000) = 0x1; \ + data = (*(ULONG *) (pAST->MMIOVirtualAddr + 0x10000 + ((addr) & 0x0000FFFF))); \ +} + +#define WriteAST1180MEM(addr, data) \ +{ \ + *(ULONG *) (pAST->MMIOVirtualAddr + 0xF004) = (addr) & 0xFFFF0000; \ + *(ULONG *) (pAST->MMIOVirtualAddr + 0xF000) = 0x1; \ + *(ULONG *) (pAST->MMIOVirtualAddr + 0x10000 + ((addr) & 0x0000FFFF)) = (data); \ +} |