20816358-disable-DP501.patch revision 1634
1634N/A--- a/src/ast.h Thu Apr 28 20:42:49 2016
1634N/A+++ b/src/ast.h Thu Apr 28 20:43:41 2016
1634N/A@@ -81,13 +81,6 @@
1522N/A AST1180
1522N/A } CHIP_ID;
1522N/A
1522N/A-typedef enum _TX_CHIPTYPE {
1522N/A- Tx_NONE,
1522N/A- Tx_Sil164,
1522N/A- Tx_Ite66121,
1522N/A- Tx_DP501
1522N/A-} TX_CHIPTYPE;
1522N/A-
1522N/A /* AST REC Info */
1522N/A #define AST_NAME "AST"
1522N/A #define AST_DRIVER_NAME "ast"
1634N/A@@ -105,10 +98,6 @@
1522N/A #define CMD_QUEUE_GUARD_BAND 0x00000020
1522N/A #define DEFAULT_HWC_NUM 0x00000002
1522N/A
1522N/A-/* Customized Info. for DVO */
1522N/A-#define HDMI_I2C_CHANNEL 1
1522N/A-#define HDMI_TX_I2C_SLAVE_ADDR 0x98
1522N/A-
1522N/A /* Patch Info */
1522N/A #define ABI_VIDEODRV_VERSION_PATCH SET_ABI_VERSION(0, 5)
1522N/A
1634N/A@@ -292,10 +281,6 @@
1522N/A int mon_h_active; /* Monitor Info. */
1522N/A int mon_v_active;
1522N/A
1522N/A- UCHAR jTxChipType; /* 3rd TX */
1522N/A- UCHAR DP501_MaxVCLK;
1522N/A- UCHAR *pDP501FWBufferVirtualAddress;
1522N/A-
1522N/A #ifdef AstVideo
1522N/A XF86VideoAdaptorPtr adaptor;
1522N/A Atom xvBrightness, xvContrast, xvColorKey, xvHue, xvSaturation;
1634N/A--- a/src/ast_driver.c Thu Apr 28 20:44:00 2016
1634N/A+++ b/src/ast_driver.c Thu Apr 28 20:44:49 2016
1634N/A@@ -1311,8 +1311,6 @@
1522N/A return;
1522N/A if (!pScrn->driverPrivate)
1522N/A return;
1522N/A- if (pAST->pDP501FWBufferVirtualAddress)
1522N/A- free(pAST->pDP501FWBufferVirtualAddress);
1522N/A free(pScrn->driverPrivate);
1522N/A pScrn->driverPrivate = 0;
1522N/A }
1634N/A@@ -1577,12 +1575,6 @@
1522N/A {
1522N/A if (pAST->jChipType == AST1180)
1522N/A Flags = ASTGetVGA2EDID(pScrn, DDC_data);
1522N/A- else if (pAST->jTxChipType == Tx_DP501)
1522N/A- {
1522N/A- Flags = ASTReadEDID_M68K(pScrn, DDC_data);
1522N/A- if (Flags == FALSE)
1522N/A- Flags = ASTGetVGAEDID(pScrn, DDC_data);
1522N/A- }
1522N/A else
1522N/A Flags = ASTGetVGAEDID(pScrn, DDC_data);
1634N/A
1634N/A@@ -1633,14 +1625,6 @@
1522N/A {
1522N/A if (pAST->jChipType == AST1180)
1522N/A Flags = ASTGetVGA2EDID(pScrn, DDC_data);
1522N/A- else if (pAST->jTxChipType == Tx_DP501)
1522N/A- {
1522N/A- pAST->DP501_MaxVCLK = 0xFF;
1522N/A- Flags = ASTReadEDID_M68K(pScrn, DDC_data);
1522N/A- if (Flags) pAST->DP501_MaxVCLK = ASTGetLinkMaxCLK(pScrn);
1522N/A- else
1522N/A- Flags = ASTGetVGAEDID(pScrn, DDC_data);
1522N/A- }
1522N/A else
1522N/A Flags = ASTGetVGAEDID(pScrn, DDC_data);
1522N/A
1634N/A--- a/src/ast_mode.c Thu Apr 28 20:45:05 2016
1634N/A+++ b/src/ast_mode.c Thu Apr 28 20:46:08 2016
1634N/A@@ -515,8 +515,6 @@
1522N/A vASTOpenKey(pScrn);
1522N/A bASTRegInit(pScrn);
1522N/A
1522N/A- vAST1000DisplayOff(pScrn);
1522N/A-
1522N/A vSetStdReg(pScrn, mode, &vgamodeinfo);
1522N/A vSetCRTCReg(pScrn, mode, &vgamodeinfo);
1522N/A vSetOffsetReg(pScrn, mode, &vgamodeinfo);
1634N/A@@ -528,7 +526,6 @@
1634N/A /* clear video buffer to avoid display noise */
1634N/A memset(pAST->FBVirtualAddr, 0x00, pAST->VideoModeInfo.ScreenPitch*pAST->VideoModeInfo.ScreenHeight);
1522N/A
1522N/A- vAST1000DisplayOn(pScrn);
1522N/A }
1522N/A
1522N/A /* post set mode */
1634N/A@@ -549,6 +546,8 @@
1522N/A }
1522N/A #endif
1522N/A
1522N/A+ vAST1000DisplayOn(pScrn);
1522N/A+
1522N/A return (TRUE);
1522N/A }
1522N/A
1634N/A--- a/src/ast_vgatool.c Thu Apr 28 20:46:28 2016
1634N/A+++ b/src/ast_vgatool.c Thu Apr 28 20:50:55 2016
1522N/A@@ -53,7 +53,6 @@
1522N/A /* Driver specific headers */
1522N/A #include "ast.h"
1522N/A #include "ast_vgatool.h"
1522N/A-#include "ast_dp501fw.h"
1522N/A
1522N/A __inline ULONG MIndwm(UCHAR *mmiobase, ULONG r)
1522N/A {
1522N/A@@ -85,315 +84,6 @@
1522N/A }
1522N/A
1522N/A /*
1522N/A- * BMCI2C
1522N/A- */
1522N/A-#define I2C_BASE 0x1e780000
1522N/A-
1522N/A-
1522N/A-static ULONG GetFWBase(ScrnInfoPtr pScrn)
1522N/A-{
1522N/A- ASTRecPtr pAST = ASTPTR(pScrn);
1522N/A- UCHAR *mmiobase;
1522N/A-
1522N/A- mmiobase = pAST->MMIOVirtualAddr;
1522N/A- return (MIndwm(mmiobase, 0x1e6e2104) & 0x7FFFFFFF);
1522N/A-}
1522N/A-
1522N/A-static void send_ack(ScrnInfoPtr pScrn)
1522N/A-{
1522N/A- ASTRecPtr pAST = ASTPTR(pScrn);
1522N/A- UCHAR SendACK;
1522N/A-
1522N/A- GetIndexRegMask(CRTC_PORT, 0x9b, 0xFF, SendACK);
1522N/A- SendACK |= 0x80;
1522N/A- SetIndexRegMask(CRTC_PORT, 0x9B, 0x00, SendACK);
1522N/A-}
1522N/A-
1522N/A-static void send_nack(ScrnInfoPtr pScrn)
1522N/A-{
1522N/A- ASTRecPtr pAST = ASTPTR(pScrn);
1522N/A- UCHAR SendACK;
1522N/A-
1522N/A- GetIndexRegMask(CRTC_PORT, 0x9b, 0xFF, SendACK);
1522N/A- SendACK &= ~0x80;
1522N/A- SetIndexRegMask(CRTC_PORT, 0x9B, 0x00, SendACK);
1522N/A-}
1522N/A-
1522N/A-static Bool wait_ack(ScrnInfoPtr pScrn)
1522N/A-{
1522N/A- ASTRecPtr pAST = ASTPTR(pScrn);
1522N/A- UCHAR WaitACK;
1522N/A- ULONG retry=0;
1522N/A-
1522N/A- do {
1522N/A- GetIndexRegMask(CRTC_PORT, 0xd2, 0xFF, WaitACK);
1522N/A- WaitACK &= 0x80;
1522N/A- DelayUS(100);
1522N/A- } while ( (!WaitACK) && (retry++ < 1000) );
1522N/A-
1522N/A- if (retry < 1000)
1522N/A- return TRUE;
1522N/A- else
1522N/A- return FALSE;
1522N/A-}
1522N/A-
1522N/A-static Bool wait_nack(ScrnInfoPtr pScrn)
1522N/A-{
1522N/A- ASTRecPtr pAST = ASTPTR(pScrn);
1522N/A- UCHAR WaitACK;
1522N/A- ULONG retry=0;
1522N/A-
1522N/A- do {
1522N/A- GetIndexRegMask(CRTC_PORT, 0xd2, 0xFF, WaitACK);
1522N/A- WaitACK &= 0x80;
1522N/A- DelayUS(100);
1522N/A- } while ( (WaitACK) && (retry++ < 1000) );
1522N/A-
1522N/A- if (retry < 1000)
1522N/A- return TRUE;
1522N/A- else
1522N/A- return FALSE;
1522N/A-}
1522N/A-
1522N/A-static void set_cmd_trigger(ScrnInfoPtr pScrn)
1522N/A-{
1522N/A- ASTRecPtr pAST = ASTPTR(pScrn);
1522N/A-
1522N/A- SetIndexRegMask(CRTC_PORT, 0x9B, ~0x40, 0x40);
1522N/A-}
1522N/A-
1522N/A-static void clear_cmd_trigger(ScrnInfoPtr pScrn)
1522N/A-{
1522N/A- ASTRecPtr pAST = ASTPTR(pScrn);
1522N/A-
1522N/A- SetIndexRegMask(CRTC_PORT, 0x9B, ~0x40, 0x00);
1522N/A-}
1522N/A-
1522N/A-static Bool write_cmd(ScrnInfoPtr pScrn, UCHAR data)
1522N/A-{
1522N/A- ASTRecPtr pAST = ASTPTR(pScrn);
1522N/A- UCHAR retry = 0;
1522N/A-
1522N/A- if (wait_nack(pScrn))
1522N/A- {
1522N/A- send_nack(pScrn);
1522N/A- SetIndexRegMask(CRTC_PORT, 0x9a, 0x00, data);
1522N/A- send_ack(pScrn);
1522N/A- set_cmd_trigger(pScrn);
1522N/A- do {
1522N/A- if (wait_ack(pScrn))
1522N/A- {
1522N/A- clear_cmd_trigger(pScrn);
1522N/A- send_nack(pScrn);
1522N/A- return TRUE;
1522N/A- }
1522N/A- } while (retry++ < 100);
1522N/A- }
1522N/A-
1522N/A- clear_cmd_trigger(pScrn);
1522N/A- send_nack(pScrn);
1522N/A- return FALSE;
1522N/A-}
1522N/A-
1522N/A-static Bool write_data(ScrnInfoPtr pScrn, UCHAR data)
1522N/A-{
1522N/A- ASTRecPtr pAST = ASTPTR(pScrn);
1522N/A-
1522N/A- if (wait_nack(pScrn))
1522N/A- {
1522N/A- send_nack(pScrn);
1522N/A- SetIndexRegMask(CRTC_PORT, 0x9a, 0x00, data);
1522N/A- send_ack(pScrn);
1522N/A- if (wait_ack(pScrn))
1522N/A- {
1522N/A- send_nack(pScrn);
1522N/A- return TRUE;
1522N/A- }
1522N/A- }
1522N/A-
1522N/A- send_nack(pScrn);
1522N/A- return FALSE;
1522N/A-}
1522N/A-
1522N/A-static void SetDP501VideoOutput(ScrnInfoPtr pScrn, UCHAR Mode)
1522N/A-{
1522N/A- write_cmd(pScrn, 0x40);
1522N/A- write_data(pScrn, Mode);
1522N/A-
1522N/A- DelayMS(10); /* delay 10ms */
1522N/A-
1522N/A-} /* SetDP501VideoOutput */
1522N/A-
1522N/A-static BOOL BackupM68KFW(ScrnInfoPtr pScrn, UCHAR *addr, ULONG size)
1522N/A-{
1522N/A- ASTRecPtr pAST = ASTPTR(pScrn);
1522N/A- UCHAR *mmiobase = pAST->MMIOVirtualAddr;
1522N/A- ULONG i, Data;
1522N/A- ULONG BootAddress;
1522N/A-
1522N/A- Data = MIndwm(mmiobase, 0x1e6e2100) & 0x01;
1522N/A- if (Data) /* FW had been load */
1522N/A- {
1522N/A- /* copy image to buffer */
1522N/A- BootAddress = GetFWBase(pScrn);
1522N/A- for (i=0; i<size; i+=4)
1522N/A- {
1522N/A- *(ULONG *)(addr + i) = MIndwm(mmiobase, BootAddress + i);
1522N/A- }
1522N/A- return TRUE;
1522N/A- } /* UEFI Driver Handling */
1522N/A-
1522N/A- return FALSE;
1522N/A-} /* BackupM68KFW */
1522N/A-
1522N/A-static BOOL LaunchM68K(ScrnInfoPtr pScrn)
1522N/A-{
1522N/A- ASTRecPtr pAST = ASTPTR(pScrn);
1522N/A- UCHAR *mmiobase = pAST->MMIOVirtualAddr;
1522N/A- ULONG i, Data, Len;
1522N/A- ULONG BootAddress;
1522N/A- UCHAR *pFWAddr;
1522N/A- UCHAR jReg;
1522N/A-
1522N/A- Data = MIndwm(mmiobase, 0x1e6e2100) & 0x03;
1522N/A- if (Data != 0x01) /* UEFI Driver Handling */
1522N/A- {
1522N/A- /* Reset Co-processor */
1522N/A- MOutdwm(mmiobase, 0x1e6e2100, 0x03);
1522N/A- do {
1522N/A- Data = MIndwm(mmiobase, 0x1e6e2100);
1522N/A- } while (Data != 0x03);
1522N/A-
1522N/A- if (pAST->pDP501FWBufferVirtualAddress)
1522N/A- {
1522N/A- pFWAddr = pAST->pDP501FWBufferVirtualAddress;
1522N/A- Len = 32*1024; /* 32K */
1522N/A- }
1522N/A- else
1522N/A- {
1522N/A- pFWAddr = AST_DP501_firmware;
1522N/A- Len = sizeof(AST_DP501_firmware) / sizeof(AST_DP501_firmware[0]);
1522N/A- }
1522N/A-
1522N/A- /* Get BootAddress */
1522N/A- MOutdwm(mmiobase, 0x1e6e2000, 0x1688a8a8); /* open passwd */
1522N/A- Data = MIndwm(mmiobase, 0x1e6e0004);
1522N/A- switch (Data & 0x03)
1522N/A- {
1522N/A- case 0x00: /* 64M */
1522N/A- BootAddress = 0x44000000;
1522N/A- break;
1522N/A- default:
1522N/A- case 0x01: /* 128MB */
1522N/A- BootAddress = 0x48000000;
1522N/A- break;
1522N/A- case 0x02: /* 256MB */
1522N/A- BootAddress = 0x50000000;
1522N/A- break;
1522N/A- case 0x03: /* 512MB */
1522N/A- BootAddress = 0x60000000;
1522N/A- break;
1522N/A- }
1522N/A- BootAddress -= 0x200000; /* - 2MB */
1522N/A-
1522N/A- /* copy image to buffer */
1522N/A- for (i=0; i<Len; i+=4)
1522N/A- {
1522N/A- Data = *(ULONG *)(pFWAddr + i);
1522N/A- MOutdwm(mmiobase, BootAddress + i, Data);
1522N/A- }
1522N/A-
1522N/A- /* Init SCU */
1522N/A- MOutdwm(mmiobase, 0x1e6e2000, 0x1688a8a8); /* open passwd */
1522N/A-
1522N/A- /* Launch FW */
1522N/A- MOutdwm(mmiobase, 0x1e6e2104, 0x80000000 + BootAddress);
1522N/A- MOutdwm(mmiobase, 0x1e6e2100, 1);
1522N/A-
1522N/A- /* Update Scratch */
1522N/A- Data = MIndwm(mmiobase, 0x1e6e2040) & 0xFFFFF1FF; /* D[11:9] = 100b: UEFI handling */
1522N/A- Data |= 0x0800;
1522N/A- MOutdwm(mmiobase, 0x1e6e2040, Data);
1522N/A-
1522N/A- GetIndexRegMask(CRTC_PORT, 0x99, 0xFC, jReg); /* D[1:0]: Reserved Video Buffer */
1522N/A- jReg |= 0x02; /* 2MB */
1522N/A- SetIndexReg(CRTC_PORT, 0x99, jReg);
1522N/A-
1522N/A- } /* UEFI Driver Handling */
1522N/A-
1522N/A- return TRUE;
1522N/A-} /* LaunchM68K */
1522N/A-
1522N/A-/*
1522N/A- * DP501 external
1522N/A- */
1522N/A-Bool ASTReadEDID_M68K(ScrnInfoPtr pScrn, BYTE *pEDIDData)
1522N/A-{
1522N/A- ASTRecPtr pAST = ASTPTR(pScrn);
1522N/A- UCHAR *mmiobase;
1522N/A- ULONG i, BootAddress, Offset, Data;
1522N/A-
1522N/A- /* init value */
1522N/A- mmiobase = pAST->MMIOVirtualAddr;
1522N/A- BootAddress = GetFWBase(pScrn);
1522N/A-
1522N/A- /* validate FW version */
1522N/A- Offset = 0xF000;
1522N/A- Data = MIndwm(mmiobase, BootAddress + Offset);
1522N/A- if ((Data & 0xF0) != 0x10) /* version: 1x */
1522N/A- return FALSE;
1522N/A-
1522N/A- /* validate PnP Monitor */
1522N/A- Offset = 0xF010;
1522N/A- Data = MIndwm(mmiobase, BootAddress + Offset);
1522N/A- if (!(Data & 0x01))
1522N/A- return FALSE;
1522N/A-
1522N/A- /* Read EDID */
1522N/A- Offset = 0xF020;
1522N/A- for (i=0; i<128; i+=4)
1522N/A- {
1522N/A- Data = MIndwm(mmiobase, BootAddress + Offset + i);
1522N/A- *(ULONG *)(pEDIDData + i) = Data;
1522N/A- }
1522N/A-
1522N/A- return TRUE;
1522N/A-} /* ReadEDID_M68K */
1522N/A-
1522N/A-UCHAR ASTGetLinkMaxCLK(ScrnInfoPtr pScrn)
1522N/A-{
1522N/A- ASTRecPtr pAST = ASTPTR(pScrn);
1522N/A- UCHAR *mmiobase;
1522N/A- ULONG BootAddress, Offset, Data;
1522N/A- UCHAR LinkCap[4], LinkRate, LinkLanes, MaxClk = 0xFF;
1522N/A-
1522N/A- /* init value */
1522N/A- mmiobase = pAST->MMIOVirtualAddr;
1522N/A- BootAddress = GetFWBase(pScrn);
1522N/A-
1522N/A- /* validate FW version */
1522N/A- Offset = 0xF000;
1522N/A- Data = MIndwm(mmiobase, BootAddress + Offset);
1522N/A- if ((Data & 0xF0) != 0x10) /* version: 1x */
1522N/A- return MaxClk;
1522N/A-
1522N/A- /* Read Link Capability */
1522N/A- Offset = 0xF014;
1522N/A- *(ULONG *)(LinkCap) = MIndwm(mmiobase, BootAddress + Offset);
1522N/A- if (LinkCap[2] == 0) /* no Max. CLK Assigned */
1522N/A- {
1522N/A- LinkRate = LinkCap[0];
1522N/A- LinkLanes = LinkCap[1];
1522N/A- Data = (LinkRate == 0x0A) ? (90 * LinkLanes): (54 * LinkLanes);
1522N/A- if (Data > 255) Data = 255; /* Max. */
1522N/A- MaxClk = (UCHAR)(Data);
1522N/A- }
1522N/A-
1522N/A- return MaxClk;
1522N/A-
1522N/A-} /* ASTGetLinkMaxCLK */
1522N/A-
1522N/A-/*
1522N/A * VGA Modules
1522N/A */
1522N/A void
1522N/A@@ -598,12 +288,6 @@
1522N/A ulDCLK = ActualDRAMBandwidth / ((pScrn->bitsPerPixel+1) / 8);
1522N/A }
1522N/A
1522N/A- /* Validate for DP501 */
1522N/A- if (pAST->jTxChipType == Tx_DP501)
1522N/A- {
1522N/A- if (ulDCLK > pAST->DP501_MaxVCLK) ulDCLK = pAST->DP501_MaxVCLK;
1522N/A- }
1522N/A-
1522N/A /* Add for AST2100, ycchen@061807 */
1634N/A if ((pAST->jChipType == AST2100) || (pAST->jChipType == AST2200) || (pAST->jChipType == AST2300) || (pAST->jChipType == AST2400) || (pAST->jChipType == AST2500) || (pAST->jChipType == AST1180) )
1522N/A {
1522N/A@@ -662,38 +346,6 @@
1522N/A if (jReg & 0x10)
1522N/A pAST->VGA2Clone = TRUE;
1522N/A
1522N/A- /* 3rd Tx Check */
1522N/A- pAST->pDP501FWBufferVirtualAddress = NULL;
1522N/A- pAST->jTxChipType = Tx_NONE;
1522N/A- /* Get 3rd Tx Info from HW Reg. */
1522N/A- GetIndexRegMask(CRTC_PORT, 0xA3, 0xFF, jReg);
1522N/A- if (jReg & 0x80)
1522N/A- pAST->jTxChipType = Tx_Sil164;
1522N/A- /* Get 3rd Tx Info from BMC Scratch */
1634N/A- if ((pAST->jChipType == AST2300) || (pAST->jChipType == AST2400) || (pAST->jChipType == AST2500))
1522N/A- {
1522N/A- GetIndexRegMask(CRTC_PORT, 0xD1, 0x0E, jReg);
1522N/A- switch (jReg)
1522N/A- {
1522N/A- case 0x04:
1522N/A- pAST->jTxChipType = Tx_Sil164;
1522N/A- break;
1522N/A- case 0x08:
1522N/A- pAST->pDP501FWBufferVirtualAddress = (UCHAR*) calloc(1, 32*1024);
1522N/A- if (pAST->pDP501FWBufferVirtualAddress)
1522N/A- {
1522N/A- if (BackupM68KFW(pScrn, pAST->pDP501FWBufferVirtualAddress, 32*1024) == FALSE)
1522N/A- {
1522N/A- free(pAST->pDP501FWBufferVirtualAddress);
1522N/A- pAST->pDP501FWBufferVirtualAddress = NULL;
1522N/A- }
1522N/A- } /* Backup DP501 FW */
1522N/A- case 0x0c:
1522N/A- pAST->jTxChipType = Tx_DP501;
1522N/A- break;
1522N/A- }
1522N/A- }
1522N/A-
1522N/A /* WideScreen Support */
1522N/A switch (pAST->jChipType)
1522N/A {
1522N/A@@ -752,10 +404,6 @@
1522N/A ASTRecPtr pAST = ASTPTR(pScrn);
1522N/A ULONG ulData;
1522N/A
1522N/A- /* 3rd Tx */
1522N/A- if (pAST->jTxChipType == Tx_DP501)
1522N/A- SetDP501VideoOutput(pScrn, 0);
1522N/A-
1522N/A if (pAST->jChipType == AST1180)
1522N/A {
1522N/A ReadAST1180SOC(AST1180_GFX_BASE + AST1180_VGA1_CTRL, ulData);
1522N/A@@ -783,9 +431,6 @@
1522N/A else
1522N/A SetIndexRegMask(SEQ_PORT,0x01, 0xDF, 0x00);
1522N/A
1522N/A- /* 3rd Tx */
1522N/A- if (pAST->jTxChipType == Tx_DP501)
1522N/A- SetDP501VideoOutput(pScrn, 1);
1522N/A }
1522N/A
1522N/A void ASTBlankScreen(ScrnInfoPtr pScrn, Bool unblack)
1522N/A@@ -902,11 +547,6 @@
1522N/A break;
1522N/A }
1522N/A
1522N/A- if (PowerManagementMode != DPMSModeOn)
1522N/A- { /* 3rd Tx */
1522N/A- if (pAST->jTxChipType == Tx_DP501) SetDP501VideoOutput(pScrn, 0);
1522N/A- }
1522N/A-
1522N/A if (pAST->jChipType == AST1180)
1522N/A {
1522N/A ReadAST1180SOC(AST1180_GFX_BASE + AST1180_VGA1_CTRL, ulTemp);
1522N/A@@ -920,10 +560,6 @@
1522N/A SetIndexRegMask(CRTC_PORT,0xB6, 0xFC, CRB6);
1522N/A }
1522N/A
1522N/A- if (PowerManagementMode == DPMSModeOn)
1522N/A- { /* 3rd Tx */
1522N/A- if (pAST->jTxChipType == Tx_DP501) SetDP501VideoOutput(pScrn, 1);
1522N/A- }
1522N/A #endif
1522N/A }
1522N/A
1634N/A@@ -3448,109 +3084,6 @@
1522N/A
1522N/A } /* vGetDefaultSettings */
1522N/A
1522N/A-static Bool InitDVO(ScrnInfoPtr pScrn)
1522N/A-{
1522N/A- ASTRecPtr pAST = ASTPTR(pScrn);
1522N/A- ULONG ulData;
1522N/A- UCHAR jReg;
1522N/A-
1522N/A- *(ULONG *) (pAST->MMIOVirtualAddr + 0xF004) = 0x1e6e0000;
1522N/A- *(ULONG *) (pAST->MMIOVirtualAddr + 0xF000) = 0x1;
1522N/A- *(ULONG *) (pAST->MMIOVirtualAddr + 0x12000) = 0x1688A8A8;
1522N/A-
1522N/A- GetIndexRegMask(CRTC_PORT, 0xD0, 0xFF, jReg);
1522N/A- if (!(jReg & 0x80)) /* Init SCU DVO Settings */
1522N/A- {
1522N/A- ulData = *(ULONG *) (pAST->MMIOVirtualAddr + 0x12008); /* delay phase */
1522N/A- ulData &= 0xfffff8ff;
1522N/A- ulData |= 0x00000500;
1522N/A- *(ULONG *) (pAST->MMIOVirtualAddr + 0x12008) = ulData;
1522N/A-
1522N/A- if (pAST->jChipType == AST2300)
1522N/A- {
1522N/A- ulData = *(ULONG *) (pAST->MMIOVirtualAddr + 0x12084); /* multi-pins for DVO single-edge */
1522N/A- ulData |= 0xfffe0000;
1522N/A- *(ULONG *) (pAST->MMIOVirtualAddr + 0x12084) = ulData;
1522N/A-
1522N/A- ulData = *(ULONG *) (pAST->MMIOVirtualAddr + 0x12088); /* multi-pins for DVO single-edge */
1522N/A- ulData |= 0x000fffff;
1522N/A- *(ULONG *) (pAST->MMIOVirtualAddr + 0x12088) = ulData;
1522N/A-
1522N/A- ulData = *(ULONG *) (pAST->MMIOVirtualAddr + 0x12090); /* multi-pins for DVO single-edge */
1522N/A- ulData &= 0xffffffcf;
1522N/A- ulData |= 0x00000020;
1522N/A- *(ULONG *) (pAST->MMIOVirtualAddr + 0x12090) = ulData;
1522N/A- }
1522N/A- else /* AST2400 */
1522N/A- {
1522N/A- ulData = *(ULONG *) (pAST->MMIOVirtualAddr + 0x12088); /* multi-pins for DVO single-edge */
1522N/A- ulData |= 0x30000000;
1522N/A- *(ULONG *) (pAST->MMIOVirtualAddr + 0x12088) = ulData;
1522N/A-
1522N/A- ulData = *(ULONG *) (pAST->MMIOVirtualAddr + 0x1208c); /* multi-pins for DVO single-edge */
1522N/A- ulData |= 0x000000cf;
1522N/A- *(ULONG *) (pAST->MMIOVirtualAddr + 0x1208c) = ulData;
1522N/A-
1522N/A- ulData = *(ULONG *) (pAST->MMIOVirtualAddr + 0x120a4); /* multi-pins for DVO single-edge */
1522N/A- ulData |= 0xffff0000;
1522N/A- *(ULONG *) (pAST->MMIOVirtualAddr + 0x120a4) = ulData;
1522N/A-
1522N/A- ulData = *(ULONG *) (pAST->MMIOVirtualAddr + 0x120a8); /* multi-pins for DVO single-edge */
1522N/A- ulData |= 0x0000000f;
1522N/A- *(ULONG *) (pAST->MMIOVirtualAddr + 0x120a8) = ulData;
1522N/A-
1522N/A- ulData = *(ULONG *) (pAST->MMIOVirtualAddr + 0x12094); /* multi-pins for DVO single-edge */
1522N/A- ulData |= 0x00000002;
1522N/A- *(ULONG *) (pAST->MMIOVirtualAddr + 0x12094) = ulData;
1522N/A- }
1522N/A- }
1522N/A-
1522N/A- /* Force to DVO */
1522N/A- ulData = *(ULONG *) (pAST->MMIOVirtualAddr + 0x1202c);
1522N/A- ulData &= 0xfffbffff;
1522N/A- *(ULONG *) (pAST->MMIOVirtualAddr + 0x1202c) = ulData;
1522N/A-
1522N/A- /* Init VGA DVO Settings */
1522N/A- SetIndexRegMask(CRTC_PORT, 0xA3, 0xCF, 0x80); /* enable DVO, single-edge */
1522N/A-
1522N/A- return TRUE;
1522N/A-} /* InitDVO */
1522N/A-
1522N/A-static void vInit3rdTX(ScrnInfoPtr pScrn)
1522N/A-{
1522N/A- ASTRecPtr pAST = ASTPTR(pScrn);
1522N/A- ULONG ulData;
1522N/A- UCHAR jReg;
1522N/A-
1522N/A- /* Only support on AST2300/2400 */
1634N/A- if ((pAST->jChipType == AST2300) || (pAST->jChipType == AST2400) || (pAST->jChipType == AST2500))
1522N/A- {
1522N/A- GetIndexRegMask(CRTC_PORT, 0xD1, 0xFF, jReg); /* D[1]: DVO Enable */
1522N/A- switch (jReg & 0x0E) /* D[11:9] */
1522N/A- {
1522N/A- case 0x04: /* Sil164 */
1522N/A- InitDVO(pScrn);
1522N/A- break;
1522N/A- case 0x08: /* DP501 with VBIOS launch FW */
1522N/A- LaunchM68K(pScrn);
1522N/A- case 0x0C: /* DP501 with BMC launch FW */
1522N/A- InitDVO(pScrn);
1522N/A- break;
1522N/A- default: /* Force to VGA */
1522N/A- if (pAST->jTxChipType == Tx_Sil164)
1522N/A- InitDVO(pScrn);
1522N/A- else
1522N/A- {
1522N/A- *(ULONG *)(pAST->MMIOVirtualAddr + 0x12000) = 0x1688A8A8;
1522N/A- ulData = *(ULONG *) (pAST->MMIOVirtualAddr + 0x1202c);
1522N/A- ulData &= 0xfffcffff;
1522N/A- *(ULONG *)(pAST->MMIOVirtualAddr) = ulData;
1522N/A- }
1522N/A- }
1522N/A- }
1522N/A-
1522N/A-} /* vInit3rdTX */
1522N/A-
1522N/A /*
1522N/A * Flags: 0: POST init
1522N/A * 1: resume from power management
1634N/A@@ -3587,7 +3120,6 @@
1522N/A else
1522N/A vInitDRAMReg(pScrn);
1522N/A
1522N/A- vInit3rdTX(pScrn);
1522N/A }
1522N/A
1522N/A return (TRUE);
1634N/A--- a/src/ast_vgatool.h Thu Apr 28 20:51:13 2016
1634N/A+++ b/src/ast_vgatool.h Thu Apr 28 20:51:36 2016
1634N/A@@ -259,9 +259,5 @@
1522N/A *(ULONG *) (pAST->MMIOVirtualAddr + 0x10000 + ((addr) & 0x0000FFFF)) = (data); \
1522N/A }
1522N/A
1522N/A-/* Delay */
1522N/A-#define DelayUS(x) usleep(x)
1522N/A-#define DelayMS(x) DelayUS(1000*x)
1522N/A-
1522N/A #endif /* ASTVGATOOL_H */
1634N/A