sparc-ast.patch revision 1351
1351N/A--- a/src/Makefile.am Fri Oct 5 08:24:21 2012
1351N/A+++ b/src/Makefile.am Fri Oct 5 08:24:40 2012
1351N/A@@ -43,4 +43,5 @@
691N/A ast_tool.c \
691N/A ast_vgatool.c \
1351N/A ast_vgatool.h \
1351N/A+ ast_sparc_driver.c \
1351N/A compat-api.h
1351N/A--- a/src/ast.h Fri Oct 5 08:25:02 2012
1351N/A+++ b/src/ast.h Fri Oct 5 08:38:59 2012
1351N/A@@ -20,9 +20,17 @@
705N/A * PERFORMANCE OF THIS SOFTWARE.
705N/A */
705N/A
705N/A+#ifndef AST_H
705N/A+#define AST_H
705N/A+
705N/A #include <string.h>
705N/A #include <stdlib.h>
705N/A+#include <sys/visual_io.h>
1351N/A
705N/A+#ifdef __sparc
705N/A+#define __sparc__ 1
705N/A+#endif
705N/A+
1351N/A #ifdef HAVE_XAA_H
1351N/A #include "xaa.h"
1351N/A #endif
1351N/A@@ -267,12 +275,93 @@
1265N/A Atom xvGammaRed, xvGammaGreen, xvGammaBlue;
1265N/A #endif
1265N/A
705N/A+#if defined(__sparc__)
1351N/A+ char *deviceName;
1351N/A+ int fd;
1351N/A+#endif
705N/A+
1265N/A } ASTRec, *ASTRecPtr, *ASTPtr;
1265N/A
705N/A #define ASTPTR(p) ((ASTRecPtr)((p)->driverPrivate))
705N/A
705N/A+#if defined(__sparc__)
705N/A+#ifndef VIS_GETPCICONFIG
705N/A+
705N/A+/*
705N/A+ * These definitions will be removed when they are included in the
705N/A+ * visual_io.h
705N/A+ */
705N/A+#define VIS_GETVIDEOMODENAME (VIOC | 12)
705N/A+#define VIS_STOREVIDEOMODENAME (VIOC | 13)
705N/A+#define VIS_MAX_VMODE_LEN 48
705N/A+
705N/A+typedef struct vis_video_mode {
705N/A+ char mode_name[VIS_MAX_VMODE_LEN];
705N/A+ uint32_t vRefresh;
705N/A+ char pad[96];
705N/A+} vis_video_mode_t;
705N/A+
705N/A+
1351N/A+#define VIS_GETPCICONFIG (VIOC | 14)
705N/A+
705N/A+typedef struct vis_pci_cfg {
1351N/A+ uint16_t VendorID;
705N/A+ uint16_t DeviceID;
705N/A+ uint16_t Command;
705N/A+ uint16_t Status;
705N/A+ uint8_t RevisionID;
705N/A+ uint8_t ProgIF;
705N/A+ uint8_t SubClass;
1351N/A+ uint8_t BaseClass;
705N/A+
705N/A+ uint8_t CacheLineSize;
705N/A+ uint8_t LatencyTimer;
705N/A+ uint8_t HeaderType;
705N/A+ uint8_t BIST;
705N/A+
1351N/A+ uint32_t bar[6];
705N/A+ uint32_t CIS;
705N/A+ uint16_t SubVendorID;
705N/A+ uint16_t SubSystemID;
705N/A+ uint32_t ROMBaseAddress;
705N/A+
705N/A+ uint8_t CapabilitiesPtr;
705N/A+ uint8_t Reserved_1[3];
705N/A+ uint32_t Reserved_2;
705N/A+
1351N/A+ uint8_t InterruptLine;
705N/A+ uint8_t InterruptPin;
705N/A+ uint8_t MinimumGrant;
705N/A+ uint8_t MaximumLatency;
705N/A+
1351N/A+ uint8_t pad[100];
705N/A+} vis_pci_cfg_t;
705N/A+
705N/A+
705N/A+#define VIS_SETIOREG (VIOC | 17)
705N/A+#define VIS_GETIOREG (VIOC | 18)
705N/A+
705N/A+typedef struct vis_io_reg {
705N/A+ uchar_t offset;
705N/A+ uchar_t value;
705N/A+} vis_io_reg_t;
705N/A+#endif
705N/A+extern struct pci_device *ASTGetPciInfo(ASTRecPtr);
705N/A+extern ScrnInfoPtr ASTAllocScreen(DriverPtr, GDevPtr);
1351N/A+extern pointer ASTMapVidMem(ScrnInfoPtr, unsigned int, PCITAG,
1351N/A+ unsigned long, unsigned long);
1351N/A+extern void ASTUnmapVidMem(ScrnInfoPtr, pointer, unsigned long);
1351N/A+extern void ASTNotifyModeChanged(ScrnInfoPtr);
1351N/A+extern void ASTSaveHW(ScrnInfoPtr);
1351N/A+extern void ASTRestoreHW(ScrnInfoPtr);
705N/A+
705N/A+#endif
705N/A+
705N/A /* Include Files */
705N/A #include "ast_mode.h"
705N/A #include "ast_vgatool.h"
705N/A #include "ast_2dtool.h"
705N/A #include "ast_cursor.h"
705N/A+
705N/A+#endif /* AST_H */
691N/A+
1351N/A--- a/src/ast_cursor.c Fri Oct 5 08:39:16 2012
1351N/A+++ b/src/ast_cursor.c Fri Oct 5 08:40:03 2012
1351N/A@@ -86,7 +86,11 @@
691N/A
691N/A infoPtr->Flags = HARDWARE_CURSOR_TRUECOLOR_AT_8BPP |
691N/A HARDWARE_CURSOR_INVERT_MASK |
1265N/A+#if !defined(__sparc__)
691N/A HARDWARE_CURSOR_BIT_ORDER_MSBFIRST;
691N/A+#else
1351N/A+ 0;
691N/A+#endif
691N/A
691N/A infoPtr->MaxWidth = MAX_HWC_WIDTH;
691N/A infoPtr->MaxHeight = MAX_HWC_HEIGHT;
1351N/A--- a/src/ast_driver.c Fri Oct 5 08:40:19 2012
1351N/A+++ b/src/ast_driver.c Fri Oct 5 08:46:21 2012
1351N/A@@ -106,7 +106,7 @@
1351N/A static ModeStatus ASTValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags);
691N/A
691N/A /* Internally used functions */
691N/A-static Bool ASTGetRec(ScrnInfoPtr pScrn);
691N/A+extern Bool ASTGetRec(ScrnInfoPtr pScrn);
691N/A static void ASTFreeRec(ScrnInfoPtr pScrn);
691N/A static Bool ASTSaveScreen(ScreenPtr pScreen, Bool unblack);
1351N/A static Bool ASTCloseScreen(CLOSE_SCREEN_ARGS_DECL);
1351N/A@@ -270,7 +270,7 @@
691N/A return FALSE;
691N/A }
691N/A
691N/A-#ifndef XSERVER_LIBPCIACCESS
691N/A+#if !defined(XSERVER_LIBPCIACCESS) && !defined(__sparc__)
691N/A /*
691N/A * This probing is just checking the PCI data the server already
691N/A * collected.
1351N/A@@ -280,6 +280,8 @@
691N/A }
691N/A #endif
691N/A
691N/A+#if !defined(__sparc__)
1351N/A+
691N/A numUsed = xf86MatchPciInstances(AST_NAME, PCI_VENDOR_AST,
691N/A ASTChipsets, ASTPciChipsets,
691N/A devSections, numDevSections,
1351N/A@@ -338,7 +340,39 @@
691N/A } /* end of if flags */
691N/A
1265N/A free(usedChips);
691N/A+#else
1351N/A
1265N/A+ if (flags & PROBE_DETECT) {
1265N/A+ foundScreen = TRUE;
1265N/A+ } else {
1265N/A+ for (i = 0; i < numDevSections; i++) {
1265N/A+
1351N/A+ ScrnInfoPtr pScrn = NULL;
1265N/A+
1351N/A+ /* Allocate new ScrnInfoRec and claim the slot */
1351N/A+ if (pScrn = ASTAllocScreen(drv, devSections[i])) {
1351N/A+ pScrn->driverVersion = AST_VERSION;
1351N/A+ pScrn->driverName = AST_DRIVER_NAME;
1351N/A+ pScrn->name = AST_NAME;
691N/A+
1351N/A+ pScrn->Probe = ASTProbe;
1351N/A+ pScrn->PreInit = ASTPreInit;
1351N/A+ pScrn->ScreenInit = ASTScreenInit;
1351N/A+ pScrn->SwitchMode = ASTSwitchMode;
1351N/A+ pScrn->AdjustFrame = ASTAdjustFrame;
1351N/A+ pScrn->EnterVT = ASTEnterVT;
1351N/A+ pScrn->LeaveVT = ASTLeaveVT;
1351N/A+ pScrn->FreeScreen = ASTFreeScreen;
1351N/A+ pScrn->ValidMode = ASTValidMode;
1265N/A+
1351N/A+ foundScreen = TRUE;
1351N/A+ }
1351N/A+ }
691N/A+ }
1265N/A+ free(devSections);
691N/A+#endif
1351N/A+
1351N/A+
691N/A return foundScreen;
691N/A }
1351N/A
1351N/A@@ -372,6 +406,10 @@
691N/A
691N/A pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
691N/A
691N/A+#if defined(__sparc__)
691N/A+ pEnt->location.type = BUS_PCI;
1351N/A+#endif
691N/A+
691N/A if (flags & PROBE_DETECT) {
691N/A ASTProbeDDC(pScrn, pEnt->index);
691N/A return TRUE;
1351N/A@@ -474,7 +512,12 @@
691N/A /* Fill AST Info */
691N/A pAST = ASTPTR(pScrn);
691N/A pAST->pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
691N/A+#if !defined(__sparc__)
691N/A pAST->PciInfo = xf86GetPciInfoForEntity(pAST->pEnt->index);
691N/A+#else
1265N/A+ pAST->PciInfo = ASTGetPciInfo(pAST);
691N/A+#endif
691N/A+
691N/A #ifndef XSERVER_LIBPCIACCESS
691N/A pAST->PciTag = pciTag(pAST->PciInfo->bus, pAST->PciInfo->device,
691N/A pAST->PciInfo->func);
1351N/A@@ -528,12 +571,13 @@
1351N/A /* "Patch" the PIOOffset inside vgaHW in order to force
691N/A * the vgaHW module to use our relocated i/o ports.
691N/A */
1351N/A-
1265N/A+#if !(defined(__sparc__))
1265N/A #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 12
1265N/A VGAHWPTR(pScrn)->PIOOffset = /* ... */
1265N/A #endif
1265N/A pAST->PIOOffset =
1265N/A pAST->IODBase + PCI_REGION_BASE(pAST->PciInfo, 2, REGION_IO) - 0x380;
691N/A+#endif
691N/A
691N/A pAST->RelocateIO = (IOADDRESS)(PCI_REGION_BASE(pAST->PciInfo, 2, REGION_IO) + pAST->IODBase);
691N/A
1351N/A@@ -823,6 +867,10 @@
705N/A
691N/A vFillASTModeInfo (pScrn);
691N/A
691N/A+#if (defined(__sparc__))
691N/A+ ASTNotifyModeChanged(pScrn);
691N/A+#endif
691N/A+
1351N/A ASTSave(pScrn);
1351N/A if (!ASTModeInit(pScrn, pScrn->currentMode)) {
1351N/A xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Mode Init Failed \n");
1351N/A@@ -1166,7 +1214,7 @@
691N/A * These two functions create and destroy that private data.
691N/A *
691N/A */
691N/A-static Bool
691N/A+Bool
691N/A ASTGetRec(ScrnInfoPtr pScrn)
691N/A {
691N/A if (pScrn->driverPrivate)
1351N/A--- a/src/ast_tool.c Fri Oct 5 08:47:11 2012
1351N/A+++ b/src/ast_tool.c Fri Oct 5 08:53:50 2012
1351N/A@@ -59,16 +59,28 @@
691N/A Bool ASTMapMMIO(ScrnInfoPtr pScrn);
691N/A void ASTUnmapMMIO(ScrnInfoPtr pScrn);
691N/A
691N/A+#if defined(__sparc__)
691N/A+extern pointer ASTMapVidMem(ScrnInfoPtr, unsigned int, PCITAG,
691N/A+ unsigned long, unsigned long);
691N/A+extern void ASTUnmapVidMem(ScrnInfoPtr, pointer, unsigned long);
691N/A+#endif /* __sparc__ */
691N/A+
691N/A+
691N/A Bool
691N/A ASTMapMem(ScrnInfoPtr pScrn)
691N/A {
691N/A ASTRecPtr pAST = ASTPTR(pScrn);
691N/A
691N/A-#ifndef XSERVER_LIBPCIACCESS
691N/A+#if !defined(XSERVER_LIBPCIACCESS) || defined(__sparc__)
691N/A+#if !defined(__sparc__)
691N/A pAST->FBVirtualAddr = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER,
691N/A pAST->PciTag,
691N/A pAST->FBPhysAddr, pAST->FbMapSize);
691N/A #else
691N/A+ pAST->FBVirtualAddr = ASTMapVidMem(pScrn, VIDMEM_FRAMEBUFFER, NULL,
691N/A+ pAST->FBPhysAddr, pAST->FbMapSize);
691N/A+#endif /* sparc */
691N/A+#else
691N/A {
691N/A void** result = (void**)&pAST->FBVirtualAddr;
691N/A int err = pci_device_map_range(pAST->PciInfo,
1351N/A@@ -94,10 +106,14 @@
691N/A {
691N/A ASTRecPtr pAST = ASTPTR(pScrn);
691N/A
691N/A-#ifndef XSERVER_LIBPCIACCESS
1351N/A+#if !defined(XSERVER_LIBPCIACCESS) || defined(__sparc__)
691N/A+#if !defined(__sparc__)
691N/A xf86UnMapVidMem(pScrn->scrnIndex, (pointer) pAST->FBVirtualAddr,
691N/A pAST->FbMapSize);
691N/A #else
1265N/A+ ASTUnmapVidMem(pScrn, (pointer)pAST->FBVirtualAddr, pAST->FbMapSize);
691N/A+#endif
691N/A+#else
691N/A pci_device_unmap_range(pAST->PciInfo, pAST->FBVirtualAddr, pAST->FbMapSize);
691N/A #endif
691N/A
1351N/A@@ -110,7 +126,7 @@
691N/A ASTMapMMIO(ScrnInfoPtr pScrn)
691N/A {
691N/A ASTRecPtr pAST = ASTPTR(pScrn);
691N/A-#ifndef XSERVER_LIBPCIACCESS
691N/A+#if !defined(XSERVER_LIBPCIACCESS) || defined(__sparc__)
691N/A int mmioFlags;
691N/A
691N/A #if !defined(__alpha__)
1351N/A@@ -119,12 +135,16 @@
1351N/A mmioFlags = VIDMEM_MMIO | VIDMEM_READSIDEEFFECT | VIDMEM_SPARSE;
691N/A #endif
691N/A
1351N/A-
691N/A+#if !defined(__sparc__)
691N/A pAST->MMIOVirtualAddr = xf86MapPciMem(pScrn->scrnIndex, mmioFlags,
691N/A pAST->PciTag,
691N/A pAST->MMIOPhysAddr, pAST->MMIOMapSize);
1351N/A-
1351N/A #else
691N/A+ pAST->MMIOVirtualAddr = ASTMapVidMem(pScrn,
691N/A+ VIDMEM_MMIO | VIDMEM_READSIDEEFFECT, NULL,
691N/A+ pAST->MMIOPhysAddr, pAST->MMIOMapSize);
691N/A+#endif
1351N/A+#else
691N/A {
1351N/A void** result = (void**)&pAST->MMIOVirtualAddr;
1351N/A int err = pci_device_map_range(pAST->PciInfo,
1351N/A@@ -149,10 +169,14 @@
691N/A {
691N/A ASTRecPtr pAST = ASTPTR(pScrn);
691N/A
691N/A-#ifndef XSERVER_LIBPCIACCESS
691N/A+#if !defined(XSERVER_LIBPCIACCESS) || defined(__sparc__)
691N/A+#if !defined(__sparc__)
691N/A xf86UnMapVidMem(pScrn->scrnIndex, (pointer) pAST->MMIOVirtualAddr,
691N/A pAST->MMIOMapSize);
691N/A #else
691N/A+ ASTUnmapVidMem(pScrn, (pointer)pAST->MMIOVirtualAddr, pAST->MMIOMapSize);
691N/A+#endif
691N/A+#else
691N/A pci_device_unmap_range(pAST->PciInfo, pAST->MMIOVirtualAddr, pAST->MMIOMapSize);
691N/A #endif
691N/A pAST->MMIOVirtualAddr = 0;
1351N/A--- a/src/ast_vgatool.c Fri Oct 5 08:54:04 2012
1351N/A+++ b/src/ast_vgatool.c Fri Oct 5 08:56:22 2012
1351N/A@@ -449,6 +449,7 @@
691N/A void
691N/A ASTDisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode, int flags)
691N/A {
1351N/A+#if !defined(__sparc__)
1265N/A ASTRecPtr pAST;
691N/A UCHAR SEQ01, CRB6;
1265N/A ULONG ulData, ulTemp;
1351N/A@@ -497,8 +498,8 @@
1351N/A {
1265N/A SetIndexRegMask(SEQ_PORT,0x01, 0xDF, SEQ01);
1265N/A SetIndexRegMask(CRTC_PORT,0xB6, 0xFC, CRB6);
1351N/A- }
1351N/A-
1351N/A+ }
1351N/A+#endif
691N/A }
999N/A
1351N/A
1351N/A@@ -989,7 +990,7 @@
691N/A { 0x0030, 0x00000040 },
691N/A { 0x0028, 0x00000003 },
691N/A { 0x000C, 0x00005a21 },
691N/A- { 0x0034, 0x00007c03 },
691N/A+ { 0x0034, 0x00007c43 },
691N/A { 0x0120, 0x00004c41 },
691N/A { 0xffff, 0xffffffff },
691N/A };
1351N/A@@ -1042,7 +1043,7 @@
691N/A { 0x0030, 0x00000040 },
691N/A { 0x0028, 0x00000003 },
691N/A { 0x000C, 0x00005a21 },
691N/A- { 0x0034, 0x00007c03 },
691N/A+ { 0x0034, 0x00007c43 },
691N/A { 0x0120, 0x00005061 },
691N/A { 0xffff, 0xffffffff },
691N/A };
1351N/A@@ -2717,9 +2718,11 @@
691N/A
999N/A {
999N/A /* Enable PCI */
1351N/A+#if !defined(__sparc__)
999N/A PCI_READ_LONG(pAST->PciInfo, &ulData, 0x04);
999N/A ulData |= 0x03;
999N/A PCI_WRITE_LONG(pAST->PciInfo, ulData, 0x04);
999N/A+#endif
999N/A
999N/A /* Enable VGA */
999N/A vEnableVGA(pScrn);
1351N/A--- a/src/ast_vgatool.h Fri Oct 5 08:56:37 2012
1351N/A+++ b/src/ast_vgatool.h Fri Oct 5 09:23:53 2012
1351N/A@@ -19,7 +19,13 @@
1351N/A * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
691N/A * PERFORMANCE OF THIS SOFTWARE.
691N/A */
691N/A+#ifndef ASTVGATOOL_H
691N/A+#define ASTVGATOOL_H
1351N/A
691N/A+#include <unistd.h>
691N/A+#include <stropts.h>
691N/A+
1351N/A+
691N/A /* VRAM Size Definition */
691N/A #define VIDEOMEM_SIZE_08M 0x00800000
691N/A #define VIDEOMEM_SIZE_16M 0x01000000
1351N/A@@ -40,6 +46,96 @@
1265N/A #define DRAMTYPE_2Gx16 6
1265N/A #define DRAMTYPE_4Gx16 7
691N/A
691N/A+#if defined(__sparc__)
691N/A+
1351N/A+#define SET_IO_REG 0x1000
1351N/A+#define GET_IO_REG 0x1001
691N/A+
1351N/A+#define AR_PORT_WRITE 0x40
1351N/A+#define MISC_PORT_WRITE 0x42
1351N/A+#define VGA_ENABLE_PORT 0x43
1351N/A+#define SEQ_PORT 0x44
1351N/A+#define DAC_INDEX_READ 0x47
1351N/A+#define DAC_INDEX_WRITE 0x48
1351N/A+#define DAC_DATA 0x49
1351N/A+#define GR_PORT 0x4E
1351N/A+#define CRTC_PORT 0x54
1351N/A+#define INPUT_STATUS1_READ 0x5A
1351N/A+#define MISC_PORT_READ 0x4C
691N/A+
1351N/A+static inline uchar_t
1265N/A+_GetRegFromFd(uchar_t off, int fd)
1265N/A+{
1351N/A+ struct vis_io_reg io_reg = {
1351N/A+ .offset = off
1351N/A+ };
1351N/A+ ioctl(fd, VIS_GETIOREG, &io_reg);
1351N/A+ return io_reg.value;
1265N/A+}
1265N/A+
1351N/A+#define GetReg(off) _GetRegFromFd(off, pAST->fd)
691N/A+
1351N/A+#define SetReg(off, val) do { \
1351N/A+ struct vis_io_reg io_reg = { \
1351N/A+ .offset = off, \
1351N/A+ .value = val \
1351N/A+ }; \
1351N/A+ ioctl(pAST->fd, VIS_SETIOREG, &io_reg); \
1351N/A+ } while (0)
691N/A+
1351N/A+#define GetIndexReg(off, index, val) do { \
1351N/A+ struct vis_io_reg io_reg = { \
1351N/A+ .offset = off, \
1351N/A+ .value = index \
1351N/A+ }; \
1351N/A+ ioctl(pAST->fd, VIS_SETIOREG, &io_reg); \
1351N/A+ io_reg.offset = off+1; \
1351N/A+ ioctl(pAST->fd, VIS_GETIOREG, &io_reg); \
1351N/A+ val = io_reg.value; \
1351N/A+ } while (0)
691N/A+
1351N/A+#define SetIndexReg(off, index, val) do { \
1351N/A+ struct vis_io_reg io_reg = { \
1351N/A+ .offset = off, \
1351N/A+ .value = index \
1351N/A+ }; \
1351N/A+ ioctl(pAST->fd, VIS_SETIOREG, &io_reg); \
1351N/A+ io_reg.offset = off+1; \
1351N/A+ io_reg.value = val; \
1351N/A+ ioctl(pAST->fd, VIS_SETIOREG, &io_reg); \
1351N/A+ } while (0)
691N/A+
1351N/A+#define GetIndexRegMask(off, index, and, val) do { \
1351N/A+ struct vis_io_reg io_reg = { \
1351N/A+ .offset = off, \
1351N/A+ .value = index \
1351N/A+ }; \
1351N/A+ ioctl(pAST->fd, VIS_SETIOREG, &io_reg); \
1351N/A+ io_reg.offset = off+1; \
1351N/A+ ioctl(pAST->fd, VIS_GETIOREG, &io_reg); \
1351N/A+ val = io_reg.value & and; \
1351N/A+ } while (0)
691N/A+
1351N/A+#define SetIndexRegMask(off, index, and, val) do { \
1351N/A+ UCHAR __Temp; \
1351N/A+ struct vis_io_reg io_reg = { \
1351N/A+ .offset = off, \
1351N/A+ .value = index \
1351N/A+ }; \
1351N/A+ ioctl(pAST->fd, VIS_SETIOREG, &io_reg); \
1351N/A+ io_reg.offset = off + 1; \
1351N/A+ ioctl(pAST->fd, VIS_GETIOREG, &io_reg); \
1351N/A+ __Temp = (io_reg.value & and) | val; \
1351N/A+ io_reg.offset = off; \
1351N/A+ io_reg.value = index; \
1351N/A+ ioctl(pAST->fd, VIS_SETIOREG, &io_reg); \
1351N/A+ io_reg.offset = off+1; \
1351N/A+ io_reg.value = __Temp; \
1351N/A+ ioctl(pAST->fd, VIS_SETIOREG, &io_reg); \
1351N/A+ } while (0)
691N/A+
1265N/A+#else /* !__sparc__ */
691N/A+
1351N/A #define AR_PORT_WRITE (pAST->MMIOVirtualAddr + 0x3c0)
1351N/A #define MISC_PORT_WRITE (pAST->MMIOVirtualAddr + 0x3c2)
1351N/A #define VGA_ENABLE_PORT (pAST->MMIOVirtualAddr + 0x3c3)
1351N/A@@ -72,6 +168,7 @@
1351N/A __Temp = (MMIO_IN8(base, 1)&(and))|(val); \
1351N/A SetIndexReg(base,index,__Temp); \
1351N/A }
1351N/A+#endif
691N/A
1265N/A #define VGA_GET_PALETTE_INDEX(index, red, green, blue) \
691N/A { \
1351N/A@@ -166,3 +263,6 @@
1265N/A *(ULONG *) (pAST->MMIOVirtualAddr + 0xF000) = 0x1; \
1265N/A *(ULONG *) (pAST->MMIOVirtualAddr + 0x10000 + ((addr) & 0x0000FFFF)) = (data); \
691N/A }
691N/A+
691N/A+#endif /* ASTVGATOOL_H */
1351N/A+
1351N/A--- a/src/ast_vgatool.c Fri Oct 5 09:36:40 2012
1351N/A+++ b/src/ast_vgatool.c Fri Oct 5 09:38:03 2012
1351N/A@@ -3015,9 +3015,11 @@
1265N/A pAST = ASTPTR(pScrn);
1265N/A
1265N/A /* Enable PCI */
1265N/A+#if !defined(__sparc__)
1265N/A PCI_READ_LONG(pAST->PciInfo, &ulData, 0x04);
1265N/A ulData |= 0x03;
1265N/A PCI_WRITE_LONG(pAST->PciInfo, ulData, 0x04);
1265N/A+#endif
1265N/A
1265N/A /* init DRAM if no F/W */
1265N/A /* TODO */
1351N/A@@ -3108,9 +3110,11 @@
1351N/A if (!xf86IsPrimaryPci(pAST->PciInfo))
1351N/A {
1351N/A /* Enable PCI */
1351N/A+#if !defined(__sparc__)
1351N/A PCI_READ_LONG(pAST->PciInfo, &ulData, 0x04);
1351N/A ulData |= 0x03;
1351N/A PCI_WRITE_LONG(pAST->PciInfo, ulData, 0x04);
1351N/A+#endif
1351N/A
1351N/A outb(pAST->RelocateIO + 0x43, 0x01);
1351N/A outb(pAST->RelocateIO + 0x42, 0x01);
1351N/A--- a/src/ast_driver.c Fri Oct 19 09:56:16 2012
1351N/A+++ b/src/ast_driver.c Fri Oct 19 09:57:04 2012
1351N/A@@ -645,8 +645,10 @@
1351N/A }
1351N/A else
1351N/A {
1351N/A+#if !(defined(__sparc__))
1351N/A /* Enable VGA MMIO Access */
1351N/A vEnableASTVGAMMIO(pScrn);
1351N/A+#endif
1351N/A
1351N/A /* Init VGA Adapter */
1351N/A if (!xf86IsPrimaryPci(pAST->PciInfo))