diff options
author | Y.C. Chen <yc_chen@aspeedtech.com> | 2014-03-19 09:12:26 +0800 |
---|---|---|
committer | Y.C. Chen <yc_chen@aspeedtech.com> | 2014-03-19 09:12:26 +0800 |
commit | b308902b4a14de08e6d7077c70060a15e87b4fd8 (patch) | |
tree | d2bbf6a7b3e0681b894b8d25b8a49be1e48cd5fe | |
parent | f4fa79c12c14854d786dc0427f5a40061e006495 (diff) |
Support AST2400
-rw-r--r-- | src/ast.h | 1 | ||||
-rw-r--r-- | src/ast_2dtool.c | 3 | ||||
-rw-r--r-- | src/ast_accel.c | 4 | ||||
-rw-r--r-- | src/ast_driver.c | 10 | ||||
-rw-r--r-- | src/ast_mode.c | 6 | ||||
-rw-r--r-- | src/ast_vgatool.c | 30 |
6 files changed, 29 insertions, 25 deletions
@@ -67,6 +67,7 @@ typedef enum _CHIP_ID { AST2200, AST2150, AST2300, + AST2400, AST1180 } CHIP_ID; diff --git a/src/ast_2dtool.c b/src/ast_2dtool.c index 603697c..210d75c 100644 --- a/src/ast_2dtool.c +++ b/src/ast_2dtool.c @@ -248,7 +248,7 @@ bEnable2D(ScrnInfoPtr pScrn, ASTRecPtr pAST) ULONG ulData; PFN_bENABLE_CMDQ pfnEnableCMDQ = bEnableCMDQ; - if (pAST->jChipType == AST2300) + if ( (pAST->jChipType == AST2300) || (pAST->jChipType == AST2400) ) pfnEnableCMDQ = bEnableCMDQ2300; switch (pAST->jChipType) @@ -258,6 +258,7 @@ bEnable2D(ScrnInfoPtr pScrn, ASTRecPtr pAST) case AST2200: case AST2150: case AST2300: + case AST2400: *(ULONG *) (pAST->MMIOVirtualAddr + 0xF004) = 0x1e6e0000; *(ULONG *) (pAST->MMIOVirtualAddr + 0xF000) = 0x1; diff --git a/src/ast_accel.c b/src/ast_accel.c index a8fd206..71eeb79 100644 --- a/src/ast_accel.c +++ b/src/ast_accel.c @@ -197,7 +197,7 @@ ASTAccelInit(ScreenPtr pScreen) /* Solid Lines */ if (pAST->ENGCaps & ENG_CAP_SolidLine) { - if ( (pAST->jChipType == AST2300) || (pAST->jChipType == AST1180) ) + if ( (pAST->jChipType == AST2300) || (pAST->jChipType == AST2400) || (pAST->jChipType == AST1180) ) { infoPtr->SubsequentSolidTwoPointLine = AIPSubsequentSolidTwoPointLine; } @@ -214,7 +214,7 @@ ASTAccelInit(ScreenPtr pScreen) /* Dashed Lines */ if (pAST->ENGCaps & ENG_CAP_DashedLine) { - if ( (pAST->jChipType == AST2300) || (pAST->jChipType == AST1180) ) + if ( (pAST->jChipType == AST2300) || (pAST->jChipType == AST2400) || (pAST->jChipType == AST1180) ) { infoPtr->SubsequentDashedTwoPointLine = AIPSubsequentDashedTwoPointLine; } diff --git a/src/ast_driver.c b/src/ast_driver.c index 3f81558..e79577e 100644 --- a/src/ast_driver.c +++ b/src/ast_driver.c @@ -663,7 +663,9 @@ ASTPreInit(ScrnInfoPtr pScrn, int flags) bASTRegInit(pScrn); /* Get Chip Type */ - if (PCI_DEV_REVISION(pAST->PciInfo) >= 0x20) + if (PCI_DEV_REVISION(pAST->PciInfo) >= 0x30) + pAST->jChipType = AST2400; + else if (PCI_DEV_REVISION(pAST->PciInfo) >= 0x20) pAST->jChipType = AST2300; else if (PCI_DEV_REVISION(pAST->PciInfo) >= 0x10) GetChipType(pScrn); @@ -713,7 +715,7 @@ ASTPreInit(ScrnInfoPtr pScrn, int flags) clockRanges->doubleScanAllowed = FALSE; /* Add for AST2100, ycchen@061807 */ - if ((pAST->jChipType == AST2100) || (pAST->jChipType == AST2200) || (pAST->jChipType == AST2300) || (pAST->jChipType == AST1180)) + if ((pAST->jChipType == AST2100) || (pAST->jChipType == AST2200) || (pAST->jChipType == AST2300) || (pAST->jChipType == AST2400) || (pAST->jChipType == AST1180)) { maxPitch = 1920; maxHeight = 1200; @@ -1029,7 +1031,7 @@ ASTScreenInit(SCREEN_INIT_ARGS_DECL) xf86DPMSInit(pScreen, ASTDisplayPowerManagementSet, 0); #ifdef AstVideo - if ( (pAST->jChipType == AST1180) || (pAST->jChipType == AST2300) ) + if ( (pAST->jChipType == AST1180) || (pAST->jChipType == AST2300) || (pAST->jChipType == AST2400) ) { xf86DrvMsg(pScrn->scrnIndex, X_INFO,"AST Initial Video()\n"); ASTInitVideo(pScreen); @@ -1223,7 +1225,7 @@ ASTValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags) if ( (mode->CrtcHDisplay == 1600) && (mode->CrtcVDisplay == 900) ) return MODE_OK; - if ( (pAST->jChipType == AST2100) || (pAST->jChipType == AST2200) || (pAST->jChipType == AST2300) || (pAST->jChipType == AST1180) ) + if ( (pAST->jChipType == AST2100) || (pAST->jChipType == AST2200) || (pAST->jChipType == AST2300) || (pAST->jChipType == AST2400) || (pAST->jChipType == AST1180) ) { if ( (mode->CrtcHDisplay == 1920) && (mode->CrtcVDisplay == 1080) ) return MODE_OK; diff --git a/src/ast_mode.c b/src/ast_mode.c index 5911bb5..de6f4f1 100644 --- a/src/ast_mode.c +++ b/src/ast_mode.c @@ -694,7 +694,7 @@ void vSetStdReg(ScrnInfoPtr pScrn, DisplayModePtr mode, PVBIOS_MODE_INFO pVGAMod } - + } void @@ -795,7 +795,7 @@ void vSetDCLKReg(ScrnInfoPtr pScrn, DisplayModePtr mode, PVBIOS_MODE_INFO pVGAMo pAST = ASTPTR(pScrn); pEnhModePtr = pVGAModeInfo->pEnhTableEntry; - if ((pAST->jChipType == AST2100) || (pAST->jChipType == AST1100) || (pAST->jChipType == AST2200) || (pAST->jChipType == AST2150) || (pAST->jChipType == AST2300)) + if ((pAST->jChipType == AST2100) || (pAST->jChipType == AST1100) || (pAST->jChipType == AST2200) || (pAST->jChipType == AST2150) || (pAST->jChipType == AST2300) || (pAST->jChipType == AST2400)) pDCLKPtr = &DCLKTable_AST2100[pEnhModePtr->DCLKIndex]; else pDCLKPtr = &DCLKTable[pEnhModePtr->DCLKIndex]; @@ -847,7 +847,7 @@ void vSetExtReg(ScrnInfoPtr pScrn, DisplayModePtr mode, PVBIOS_MODE_INFO pVGAMod #endif /* Set Threshold */ - if (pAST->jChipType == AST2300) + if ((pAST->jChipType == AST2300) || (pAST->jChipType == AST2400)) { SetIndexReg(CRTC_PORT,0xA7, 0x78); SetIndexReg(CRTC_PORT,0xA6, 0x60); diff --git a/src/ast_vgatool.c b/src/ast_vgatool.c index fa9d1e2..ccbe986 100644 --- a/src/ast_vgatool.c +++ b/src/ast_vgatool.c @@ -126,7 +126,7 @@ GetDRAMInfo(ScrnInfoPtr pScrn) pAST->ulDRAMBusWidth = 32; /* Get DRAM Type */ - if (pAST->jChipType == AST2300) + if ((pAST->jChipType == AST2300) || (pAST->jChipType == AST2400)) { switch (ulData & 0x03) { @@ -236,7 +236,7 @@ GetMaxDCLK(ScrnInfoPtr pScrn) /* Modify DARM utilization to 60% for AST1100/2100 16bits DRAM, ycchen@032508 */ if ( ((pAST->jChipType == AST2100) || (pAST->jChipType == AST1100) || (pAST->jChipType == AST2200) || (pAST->jChipType == AST2150)) && (ulDRAMBusWidth == 16) ) DRAMEfficiency = 600; - else if (pAST->jChipType == AST2300) + else if ((pAST->jChipType == AST2300) || (pAST->jChipType == AST2400)) DRAMEfficiency = 400; ulDRAMBandwidth = ulMCLK * ulDRAMBusWidth * 2 / 8; ActualDRAMBandwidth = ulDRAMBandwidth * DRAMEfficiency / 1000; @@ -259,7 +259,7 @@ GetMaxDCLK(ScrnInfoPtr pScrn) } /* Add for AST2100, ycchen@061807 */ - if ((pAST->jChipType == AST2100) || (pAST->jChipType == AST2200) || (pAST->jChipType == AST2300) || (pAST->jChipType == AST1180) ) + if ((pAST->jChipType == AST2100) || (pAST->jChipType == AST2200) || (pAST->jChipType == AST2300) || (pAST->jChipType == AST2400) || (pAST->jChipType == AST1180) ) { if (ulDCLK > 200) ulDCLK = 200; } @@ -334,14 +334,14 @@ GetScratchOptions(ScrnInfoPtr pScrn) else { pAST->SupportWideScreen = FALSE; - if (pAST->jChipType == AST2300) /* for AST1300 */ - { - *(ULONG *) (pAST->MMIOVirtualAddr + 0xF004) = 0x1e6e0000; - *(ULONG *) (pAST->MMIOVirtualAddr + 0xF000) = 0x1; - ulData = *(ULONG *) (pAST->MMIOVirtualAddr + 0x1207c); - if ((ulData & 0x0300) == 0) /* AST1300 */ - pAST->SupportWideScreen = TRUE; - } + *(ULONG *) (pAST->MMIOVirtualAddr + 0xF004) = 0x1e6e0000; + *(ULONG *) (pAST->MMIOVirtualAddr + 0xF000) = 0x1; + ulData = *(ULONG *) (pAST->MMIOVirtualAddr + 0x1207c); + ulData &= 0x0300; + if ((pAST->jChipType == AST2300) && (ulData == 0x0000)) /* AST1300 */ + pAST->SupportWideScreen = TRUE; + if ((pAST->jChipType == AST2400) && (ulData == 0x0100)) /* AST1400 */ + pAST->SupportWideScreen = TRUE; } } /* switch case */ @@ -721,7 +721,7 @@ void vSetDefExtReg(ScrnInfoPtr pScrn) } /* Set Ext. Reg */ - if (pAST->jChipType == AST2300) + if ((pAST->jChipType == AST2300) || (pAST->jChipType == AST2400)) { if (PCI_DEV_REVISION(pAST->PciInfo) > 0x20) pjExtRegInfo = ExtRegInfo_AST2300; @@ -749,7 +749,7 @@ void vSetDefExtReg(ScrnInfoPtr pScrn) /* Enable RAMDAC for A1, ycchen@113005 */ jReg = 0x04; - if (pAST->jChipType == AST2300) + if ((pAST->jChipType == AST2300) || (pAST->jChipType == AST2400)) jReg |= 0x20; SetIndexRegMask(CRTC_PORT,0xB6, 0xFF, jReg); @@ -2546,7 +2546,7 @@ void vGetDefaultSettings(ScrnInfoPtr pScrn) ASTRecPtr pAST = ASTPTR(pScrn); ULONG ulData; - if (pAST->jChipType == AST2300) + if ((pAST->jChipType == AST2300) || (pAST->jChipType == AST2400)) { *(ULONG *) (pAST->MMIOVirtualAddr + 0xF004) = 0x1e6e0000; *(ULONG *) (pAST->MMIOVirtualAddr + 0xF000) = 0x1; @@ -2604,7 +2604,7 @@ Bool InitVGA(ScrnInfoPtr pScrn, ULONG Flags) if (Flags == 0) vGetDefaultSettings(pScrn); - if (pAST->jChipType == AST2300) + if ((pAST->jChipType == AST2300) || (pAST->jChipType == AST2400)) vInitAST2300DRAMReg(pScrn); else vInitDRAMReg(pScrn); |