diff options
-rw-r--r-- | src/atibus.c | 55 | ||||
-rw-r--r-- | src/atichip.c | 46 | ||||
-rw-r--r-- | src/atichip.h | 6 | ||||
-rw-r--r-- | src/atilock.c | 64 | ||||
-rw-r--r-- | src/atipreinit.c | 24 | ||||
-rw-r--r-- | src/atiprint.c | 25 | ||||
-rw-r--r-- | src/atiprobe.c | 686 | ||||
-rw-r--r-- | src/atistruct.h | 8 |
8 files changed, 16 insertions, 898 deletions
diff --git a/src/atibus.c b/src/atibus.c index cf2969f..f20e472 100644 --- a/src/atibus.c +++ b/src/atibus.c @@ -67,14 +67,13 @@ ATIClaimResources Bool Active ) { - resPtr pResources; #ifndef AVOID_CPIO resRange Resources[2] = {{0, 0, 0}, _END}; /* Claim VGA and VGAWonder resources */ - if ((pATI->VGAAdapter != ATI_ADAPTER_NONE) && (Active || !pATI->SharedVGA)) + if ((pATI->VGAAdapter != ATI_ADAPTER_NONE) && (Active)) { /* * 18800-x's are the only ATI controllers that decode all ISA aliases @@ -82,23 +81,13 @@ ATIClaimResources * VGA aliases, but do decode VGA Wonder aliases whose most significant * nibble is zero. */ - xf86ClaimFixedResources( - (pATI->Chip <= ATI_CHIP_18800_1) ? - (pATI->SharedVGA ? resVgaSparseShared : resVgaSparseExclusive) : - (pATI->SharedVGA ? resVgaShared : resVgaExclusive), - pATI->iEntity); + xf86ClaimFixedResources(resVgaShared, pATI->iEntity); if (pATI->CPIO_VGAWonder) { - if (pATI->SharedVGA) - Resources[0].type = ResShrIoSparse | ResBus; - else - Resources[0].type = ResExcIoSparse | ResBus; + Resources[0].type = ResShrIoSparse | ResBus; Resources[0].rBase = pATI->CPIO_VGAWonder; - if (pATI->Chip <= ATI_CHIP_18800_1) - Resources[0].rMask = 0x03FEU; - else - Resources[0].rMask = 0xF3FEU; + Resources[0].rMask = 0xF3FEU; xf86ClaimFixedResources(Resources, pATI->iEntity); @@ -107,54 +96,22 @@ ATIClaimResources } } - if (!Active && pATI->SharedAccelerator) + if (!Active) return; - /* Claim 8514/A resources */ - if (pATI->ChipHasSUBSYS_CNTL) - xf86ClaimFixedResources( - pATI->SharedAccelerator ? res8514Shared : res8514Exclusive, - pATI->iEntity); - /* Claim Mach64 sparse I/O resources */ if ((pATI->Adapter == ATI_ADAPTER_MACH64) && (pATI->CPIODecoding == SPARSE_IO)) { - if (pATI->SharedAccelerator) - Resources[0].type = ResShrIoSparse | ResBus; - else - Resources[0].type = ResExcIoSparse | ResBus; + Resources[0].type = ResShrIoSparse | ResBus; Resources[0].rBase = pATI->CPIOBase; Resources[0].rMask = 0x03FCU; xf86ClaimFixedResources(Resources, pATI->iEntity); } - if (Active) - return; - -#else /* AVOID_CPIO */ - - if (pATI->SharedAccelerator) - return; - #endif /* AVOID_CPIO */ - /* Register unshared relocatable resources for inactive adapters */ - do - { - pResources = xf86RegisterResources(pATI->iEntity, NULL, ResExclusive); - if (!pResources) - return; - - pResources = xf86ReallocatePciResources(pATI->iEntity, pResources); - } while (!pResources); - - xf86Msg(X_WARNING, - ATI_NAME ": Unable to register the following resources for inactive" - " adapter:\n"); - xf86PrintResList(1, pResources); - xf86FreeResList(pResources); } /* diff --git a/src/atichip.c b/src/atichip.c index 09d2cad..7b56bbc 100644 --- a/src/atichip.c +++ b/src/atichip.c @@ -122,52 +122,6 @@ const char *ATIChipNames[] = const char *ATIFoundryNames[] = { "SGS", "NEC", "KCS", "UMC", "TSMC", "5", "6", "UMC" }; -#ifndef AVOID_CPIO - -/* - * ATIMach32ChipID -- - * - * Set variables whose value is dependent upon an 68800's CHIP_ID register. - */ -void -ATIMach32ChipID -( - ATIPtr pATI -) -{ - CARD16 IOValue = inw(CHIP_ID); - pATI->ChipType = GetBits(IOValue, CHIP_CODE_0 | CHIP_CODE_1); - pATI->ChipClass = GetBits(IOValue, CHIP_CLASS); - pATI->ChipRevision = GetBits(IOValue, CHIP_REV); - pATI->ChipRev = pATI->ChipRevision; - if (IOValue == 0xFFFFU) - IOValue = 0; - switch (GetBits(IOValue, CHIP_CODE_0 | CHIP_CODE_1)) - { - case OldChipID('A', 'A'): - pATI->Chip = ATI_CHIP_68800_3; - break; - - case OldChipID('X', 'X'): - pATI->Chip = ATI_CHIP_68800_6; - break; - - case OldChipID('L', 'X'): - pATI->Chip = ATI_CHIP_68800LX; - break; - - case OldChipID('A', 'X'): - pATI->Chip = ATI_CHIP_68800AX; - break; - - default: - pATI->Chip = ATI_CHIP_68800; - break; - } -} - -#endif /* AVOID_CPIO */ - /* * ATIMach64ChipID -- * diff --git a/src/atichip.h b/src/atichip.h index ee3e0cf..1b7ca2f 100644 --- a/src/atichip.h +++ b/src/atichip.h @@ -136,12 +136,6 @@ typedef enum extern const char *ATIFoundryNames[]; -#ifndef AVOID_CPIO - -extern void ATIMach32ChipID(ATIPtr); - -#endif /* AVOID_CPIO */ - extern void ATIMach64ChipID(ATIPtr, const CARD16); extern ATIChipType ATIChipID(const CARD16, const CARD8); diff --git a/src/atilock.c b/src/atilock.c index 7b963c1..92293af 100644 --- a/src/atilock.c +++ b/src/atilock.c @@ -57,44 +57,7 @@ ATIUnlock #ifndef AVOID_CPIO - if (pATI->ChipHasSUBSYS_CNTL) - { - /* Save register values to be modified */ - pATI->LockData.clock_sel = inw(CLOCK_SEL); - if (pATI->Chip >= ATI_CHIP_68800) - { - pATI->LockData.misc_options = inw(MISC_OPTIONS); - pATI->LockData.mem_bndry = inw(MEM_BNDRY); - pATI->LockData.mem_cfg = inw(MEM_CFG); - } - - tmp = inw(SUBSYS_STAT) & _8PLANE; - - /* Reset the 8514/A and disable all interrupts */ - outw(SUBSYS_CNTL, tmp | (GPCTRL_RESET | CHPTEST_NORMAL)); - outw(SUBSYS_CNTL, tmp | (GPCTRL_ENAB | CHPTEST_NORMAL | RVBLNKFLG | - RPICKFLAG | RINVALIDIO | RGPIDLE)); - - /* Ensure VGA is enabled */ - outw(CLOCK_SEL, pATI->LockData.clock_sel &~DISABPASSTHRU); - if (pATI->Chip >= ATI_CHIP_68800) - { - outw(MISC_OPTIONS, pATI->LockData.misc_options & - ~(DISABLE_VGA | DISABLE_DAC)); - - /* Disable any video memory boundary */ - outw(MEM_BNDRY, pATI->LockData.mem_bndry & - ~(MEM_PAGE_BNDRY | MEM_BNDRY_ENA)); - - /* Disable direct video memory aperture */ - outw(MEM_CFG, pATI->LockData.mem_cfg & - ~(MEM_APERT_SEL | MEM_APERT_PAGE | MEM_APERT_LOC)); - } - - /* Wait for all activity to die down */ - ProbeWaitIdleEmpty(); - } - else if (pATI->Chip >= ATI_CHIP_88800GXC) + if (pATI->Chip >= ATI_CHIP_88800GXC) #endif /* AVOID_CPIO */ @@ -437,7 +400,7 @@ ATILock #ifndef AVOID_CPIO - CARD32 tmp, saved_lcd_gen_ctrl = 0, lcd_gen_ctrl = 0; + CARD32 saved_lcd_gen_ctrl = 0, lcd_gen_ctrl = 0; #endif /* AVOID_CPIO */ @@ -532,28 +495,7 @@ ATILock } } - if (pATI->ChipHasSUBSYS_CNTL) - { - tmp = inw(SUBSYS_STAT) & _8PLANE; - - /* Reset the 8514/A and disable all interrupts */ - outw(SUBSYS_CNTL, tmp | (GPCTRL_RESET | CHPTEST_NORMAL)); - outw(SUBSYS_CNTL, tmp | (GPCTRL_ENAB | CHPTEST_NORMAL | RVBLNKFLG | - RPICKFLAG | RINVALIDIO | RGPIDLE)); - - /* Restore modified accelerator registers */ - outw(CLOCK_SEL, pATI->LockData.clock_sel); - if (pATI->Chip >= ATI_CHIP_68800) - { - outw(MISC_OPTIONS, pATI->LockData.misc_options); - outw(MEM_BNDRY, pATI->LockData.mem_bndry); - outw(MEM_CFG, pATI->LockData.mem_cfg); - } - - /* Wait for all activity to die down */ - ProbeWaitIdleEmpty(); - } - else if (pATI->Chip >= ATI_CHIP_88800GXC) + if (pATI->Chip >= ATI_CHIP_88800GXC) #endif /* AVOID_CPIO */ diff --git a/src/atipreinit.c b/src/atipreinit.c index 047aeed..ff5cc04 100644 --- a/src/atipreinit.c +++ b/src/atipreinit.c @@ -465,8 +465,7 @@ ATIPreInit pResources = pEntity->resources; xfree(pEntity); if (!pResources) - pResources = xf86RegisterResources(pATI->iEntity, NULL, - pATI->SharedAccelerator ? ResShared : ResExclusive); + pResources = xf86RegisterResources(pATI->iEntity, NULL, ResShared); if (pResources) { xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR, @@ -1491,12 +1490,6 @@ ATIPreInit "VGA Wonder registers at I/O port 0x%04lX.\n", pATI->CPIO_VGAWonder); - if (pATI->Coprocessor != ATI_CHIP_NONE) - xf86DrvMsg(pScreenInfo->scrnIndex, X_PROBED, - "%s graphics accelerator detected,\n with %d kB of coprocessor" - " memory.\n", - ATIChipNames[pATI->Coprocessor], pATI->VideoRAM); - #endif /* AVOID_CPIO */ xf86DrvMsg(pScreenInfo->scrnIndex, X_PROBED, @@ -1710,15 +1703,6 @@ ATIPreInit ATIUnmapApertures(pScreenInfo->scrnIndex, pATI); return FALSE; } - - if (pATI->Coprocessor != ATI_CHIP_NONE) - { - /* Ignore any 8514/A or Mach8 accelerator from this point on */ - pATI->Adapter = pATI->VGAAdapter; - - /* Accelerator and VGA cannot share memory */ - pATI->VideoRAM = 0; - } } #endif /* AVOID_CPIO */ @@ -2856,12 +2840,6 @@ ATIPreInit else { pATIHW->crtc = ATI_CRTC_VGA; -#if 0 /* ___NOT_YET___ */ - if (pATI->ChipHasSUBSYS_CNTL) - { - } - else -#endif if ((pATI->Chip >= ATI_CHIP_88800GXC) && (pATI->LockData.crtc_gen_cntl & CRTC_EXT_DISP_EN)) { diff --git a/src/atiprint.c b/src/atiprint.c index 11cf6b7..247252d 100644 --- a/src/atiprint.c +++ b/src/atiprint.c @@ -474,31 +474,6 @@ ATIPrintRegisters "ATI extended VGA", 0); } - if (pATI->ChipHasSUBSYS_CNTL) - { - xf86ErrorFVerb(4, "\n 8514/A register values:"); - for (Index = 0x02E8U; Index <= 0x0FEE8; Index += 0x0400U) - { - if (!((Index - 0x02E8U) & 0x0C00U)) - xf86ErrorFVerb(4, "\n 0x%04X: ", Index); - xf86ErrorFVerb(4, " %04X", inw(Index)); - } - - if (pATI->Adapter >= ATI_ADAPTER_MACH8) - { - xf86ErrorFVerb(4, "\n\n Mach8/Mach32 register values:"); - for (Index = 0x02EEU; Index <= 0x0FEEE; Index += 0x0400U) - { - if (!((Index - 0x02EEU) & 0x0C00U)) - xf86ErrorFVerb(4, "\n 0x%04X: ", Index); - xf86ErrorFVerb(4, " %04X", inw(Index)); - } - } - - xf86ErrorFVerb(4, "\n"); - } - else - #endif /* AVOID_CPIO */ if (pATI->Chip == ATI_CHIP_264LT) diff --git a/src/atiprobe.c b/src/atiprobe.c index ff709d3..29ec544 100644 --- a/src/atiprobe.c +++ b/src/atiprobe.c @@ -84,9 +84,6 @@ typedef struct _ATIGDev * Definitions for I/O conflict avoidance. */ #define LongPort(_Port) GetBits(_Port, PCIGETIO(SPARSE_IO_BASE)) -#define DetectedVGA (1 << 0) -#define Detected8514A (1 << 1) -#define DetectedMach64 (1 << 2) #define Allowed (1 << 3) #define DoProbe (1 << 4) typedef struct @@ -196,56 +193,6 @@ ATICheckSparseIOBases } /* - * ATIVGAProbe -- - * - * This function looks for an IBM standard VGA, or clone, and sets - * pATI->VGAAdapter if one is found. - */ -static ATIPtr -ATIVGAProbe -( - ATIPtr pVGA -) -{ - CARD8 IOValue1, IOValue2, IOValue3; - - if (!pVGA) - pVGA = (ATIPtr)xnfcalloc(1, SizeOf(ATIRec)); - - /* - * VGA has one more attribute register than EGA. See if it can be read and - * written. Note that the CRTC registers are not used here, so there's no - * need to unlock them. - */ - ATISetVGAIOBase(pVGA, inb(R_GENMO)); - (void)inb(GENS1(pVGA->CPIO_VGABase)); - IOValue1 = inb(ATTRX); - (void)inb(GENS1(pVGA->CPIO_VGABase)); - IOValue2 = GetReg(ATTRX, 0x14U | 0x20U); - outb(ATTRX, IOValue2 ^ 0x0FU); - IOValue3 = GetReg(ATTRX, 0x14U | 0x20U); - outb(ATTRX, IOValue2); - outb(ATTRX, IOValue1); - (void)inb(GENS1(pVGA->CPIO_VGABase)); - if (IOValue3 == (IOValue2 ^ 0x0FU)) - { - /* VGA device detected */ - if (pVGA->Chip == ATI_CHIP_NONE) - pVGA->Chip = ATI_CHIP_VGA; - if (pVGA->VGAAdapter == ATI_ADAPTER_NONE) - pVGA->VGAAdapter = ATI_ADAPTER_VGA; - if (pVGA->Adapter == ATI_ADAPTER_NONE) - pVGA->Adapter = ATI_ADAPTER_VGA; - } - else - { - pVGA->VGAAdapter = ATI_ADAPTER_NONE; - } - - return pVGA; -} - -/* * ATIVGAWonderProbe -- * * This function determines if ATI extended VGA registers can be accessed @@ -257,7 +204,6 @@ ATIVGAWonderProbe ( pciVideoPtr pVideo, ATIPtr pATI, - ATIPtr p8514, CARD8 *ProbeFlags ) { @@ -274,24 +220,6 @@ ATIVGAWonderProbe pATI->CPIO_VGAWonder = 0; break; - case Detected8514A: - xf86Msg(X_WARNING, - ATI_NAME ": Expected VGA Wonder capability could not be" - " detected at I/O port 0x%04lX because it would conflict with" - " a %s %s.\n", pATI->CPIO_VGAWonder, - ATIBusNames[p8514->BusType], ATIAdapterNames[p8514->Adapter]); - pATI->CPIO_VGAWonder = 0; - break; - - case DetectedMach64: - xf86Msg(X_WARNING, - ATI_NAME ": Expected VGA Wonder capability could not be" - " detected at I/O port 0x%04lX because it would conflict with" - " a Mach64.\n", pATI->CPIO_VGAWonder); - pATI->CPIO_VGAWonder = 0; - break; - - case DetectedVGA: default: /* Must be DoProbe */ if (pVideo && !xf86IsPrimaryPci(pVideo) && (pATI->Chip <= ATI_CHIP_88800GXD)) @@ -340,149 +268,6 @@ ATIVGAWonderProbe } } -/* - * ATI8514Probe -- - * - * This function looks for an 8514/A compatible and returns an ATIRec if one is - * found. The function also determines whether or not the detected 8514/A - * compatible device is actually a Mach8 or Mach32, and sets pATI->Adapter - * accordingly. - */ -static ATIPtr -ATI8514Probe -( - pciVideoPtr pVideo -) -{ - ATIPtr pATI = NULL; - CARD16 IOValue1, IOValue2; - - /* - * Save register value to be modified, just in case there is no 8514/A - * compatible accelerator. Note that, in more ways than one, - * SUBSYS_STAT == SUBSYS_CNTL. - */ - IOValue1 = inw(SUBSYS_STAT); - IOValue2 = IOValue1 & _8PLANE; - - /* Reset any 8514/A compatible adapter that might be present */ - outw(SUBSYS_CNTL, IOValue2 | (GPCTRL_RESET | CHPTEST_NORMAL)); - outw(SUBSYS_CNTL, IOValue2 | (GPCTRL_ENAB | CHPTEST_NORMAL | - RVBLNKFLG | RPICKFLAG | RINVALIDIO | RGPIDLE)); - - /* Probe for an 8514/A compatible */ - IOValue2 = inw(ERR_TERM); - outw(ERR_TERM, 0x5A5AU); - ProbeWaitIdleEmpty(); - if (inw(ERR_TERM) == 0x5A5AU) - { - outw(ERR_TERM, 0x2525U); - if (inw(ERR_TERM) == 0x2525U) - { - pATI = (ATIPtr)xnfcalloc(1, SizeOf(ATIRec)); - pATI->Adapter = ATI_ADAPTER_8514A; - pATI->ChipHasSUBSYS_CNTL = TRUE; - pATI->PCIInfo = pVideo; - } - } - outw(ERR_TERM, IOValue2); - - /* Restore register value clobbered by 8514/A reset attempt */ - if (!pATI) - { - outw(SUBSYS_CNTL, IOValue1); - return NULL; - } - - /* Ensure any Mach8 or Mach32 is not in 8514/A emulation mode */ - IOValue1 = inw(CLOCK_SEL); - outw(CLOCK_SEL, IOValue1); - ProbeWaitIdleEmpty(); - - IOValue1 = IOValue2 = inw(ROM_ADDR_1); - outw(ROM_ADDR_1, 0x5555U); - ProbeWaitIdleEmpty(); - if (inw(ROM_ADDR_1) == 0x5555U) - { - outw(ROM_ADDR_1, 0x2A2AU); - ProbeWaitIdleEmpty(); - if (inw(ROM_ADDR_1) == 0x2A2AU) - pATI->Adapter = ATI_ADAPTER_MACH8; - } - outw(ROM_ADDR_1, IOValue1); - - if (pATI->Adapter == ATI_ADAPTER_MACH8) - { - /* A Mach8 or Mach32 has been detected */ - IOValue1 = inw(READ_SRC_X); - outw(DESTX_DIASTP, 0xAAAAU); - ProbeWaitIdleEmpty(); - if (inw(READ_SRC_X) == 0x02AAU) - pATI->Adapter = ATI_ADAPTER_MACH32; - - outw(DESTX_DIASTP, 0x5555U); - ProbeWaitIdleEmpty(); - if (inw(READ_SRC_X) == 0x0555U) - { - if (pATI->Adapter != ATI_ADAPTER_MACH32) - pATI->Adapter = ATI_ADAPTER_8514A; - } - else - { - if (pATI->Adapter != ATI_ADAPTER_MACH8) - pATI->Adapter = ATI_ADAPTER_8514A; - } - outw(DESTX_DIASTP, IOValue1); - } - - switch (pATI->Adapter) - { - case ATI_ADAPTER_8514A: - pATI->Coprocessor = ATI_CHIP_8514A; - IOValue1 = inb(EXT_CONFIG_3); - outb(EXT_CONFIG_3, IOValue1 & 0x0FU); - if (!(inb(EXT_CONFIG_3) & 0xF0U)) - { - outb(EXT_CONFIG_3, IOValue1 | 0xF0U); - if ((inb(EXT_CONFIG_3) & 0xF0U) == 0xF0U) - pATI->Coprocessor = ATI_CHIP_CT480; - } - outb(EXT_CONFIG_3, IOValue1); - break; - - case ATI_ADAPTER_MACH8: - pATI->Coprocessor = ATI_CHIP_38800_1; - if (inw(CONFIG_STATUS_1) & MC_BUS) - pATI->BusType = ATI_BUS_MCA16; - break; - - case ATI_ADAPTER_MACH32: - IOValue1 = inw(CONFIG_STATUS_1); - pATI->BusType = GetBits(IOValue1, BUS_TYPE); - pATI->BIOSBase = 0x000C0000U + - (GetBits(IOValue2, BIOS_BASE_SEGMENT) << 11); - if (!(IOValue1 & (_8514_ONLY | CHIP_DIS))) - { - pATI->VGAAdapter = ATI_ADAPTER_MACH32; - if ((xf86ReadBIOS(pATI->BIOSBase, 0x10U, - (pointer)(&pATI->CPIO_VGAWonder), - SizeOf(pATI->CPIO_VGAWonder)) < - SizeOf(pATI->CPIO_VGAWonder)) || - !(pATI->CPIO_VGAWonder &= SPARSE_IO_PORT)) - pATI->CPIO_VGAWonder = 0x01CEU; - pATI->VGAOffset = 0x80U; - } - - ATIMach32ChipID(pATI); - break; - - default: - break; - } - - return pATI; -} - #endif /* AVOID_CPIO */ /* @@ -718,144 +503,17 @@ ATIMach64Probe return pATI; } -/* - * ATIAssignVGA -- - * - * This function is called to associate a VGA interface with an accelerator. - * This is done by temporarily configuring the accelerator to route VGA RAMDAC - * I/O through the accelerator's RAMDAC. A value is then written through the - * VGA DAC ports and a check is made to see if the same value shows up on the - * accelerator side. - */ static void ATIAssignVGA ( pciVideoPtr pVideo, - ATIPtr *ppVGA, ATIPtr pATI, - ATIPtr p8514, CARD8 *ProbeFlags ) { - ATIPtr pVGA = *ppVGA; - CARD8 OldDACMask; - - /* Assume unassignable VGA */ - pATI->VGAAdapter = ATI_ADAPTER_NONE; - - /* If no assignable VGA, return now */ - if ((pATI != pVGA) && (!pVGA || (pVGA->Adapter > ATI_ADAPTER_VGA))) - return; - - switch (pATI->Adapter) - { - case ATI_ADAPTER_8514A: - { - /* - * Assumption: Bit DISABPASSTHRU in ADVFUNC_CNTL is already - * off. - */ - OldDACMask = inb(VGA_DAC_MASK); - - if (inb(IBM_DAC_MASK) == OldDACMask) - { - outb(VGA_DAC_MASK, 0xA5U); - if (inb(IBM_DAC_MASK) == 0xA5U) - pATI->VGAAdapter = ATI_ADAPTER_VGA; - outb(VGA_DAC_MASK, OldDACMask); - } - } - break; - - case ATI_ADAPTER_MACH8: - { - CARD16 ClockSel = inw(CLOCK_SEL); - - if (ClockSel & DISABPASSTHRU) - outw(CLOCK_SEL, ClockSel & ~DISABPASSTHRU); - - ProbeWaitIdleEmpty(); - - OldDACMask = inb(VGA_DAC_MASK); - - if (inb(IBM_DAC_MASK) == OldDACMask) - { - outb(VGA_DAC_MASK, 0xA5U); - if (inb(IBM_DAC_MASK) == 0xA5U) - pATI->VGAAdapter = ATI_ADAPTER_VGA; - outb(VGA_DAC_MASK, OldDACMask); - } - - if (ClockSel & DISABPASSTHRU) - outw(CLOCK_SEL, ClockSel); - } - break; - - case ATI_ADAPTER_MACH32: - { - CARD16 ClockSel = inw(CLOCK_SEL), - MiscOptions = inw(MISC_OPTIONS); - - if (ClockSel & DISABPASSTHRU) - outw(CLOCK_SEL, ClockSel & ~DISABPASSTHRU); - if (MiscOptions & (DISABLE_VGA | DISABLE_DAC)) - outw(MISC_OPTIONS, - MiscOptions & ~(DISABLE_VGA | DISABLE_DAC)); - - ProbeWaitIdleEmpty(); - - OldDACMask = inb(VGA_DAC_MASK); - - if (inb(IBM_DAC_MASK) == OldDACMask) - { - outb(VGA_DAC_MASK, 0xA5U); - if (inb(IBM_DAC_MASK) == 0xA5U) - pATI->VGAAdapter = ATI_ADAPTER_MACH32; - outb(VGA_DAC_MASK, OldDACMask); - } - - if (ClockSel & DISABPASSTHRU) - outw(CLOCK_SEL, ClockSel); - if (MiscOptions & (DISABLE_VGA | DISABLE_DAC)) - outw(MISC_OPTIONS, MiscOptions); - } - break; - - case ATI_ADAPTER_MACH64: - { - CARD32 DACCntl = inr(DAC_CNTL); - - if (!(DACCntl & DAC_VGA_ADR_EN)) - outr(DAC_CNTL, DACCntl | DAC_VGA_ADR_EN); - - OldDACMask = inb(VGA_DAC_MASK); - - if (in8(M64_DAC_MASK) == OldDACMask) - { - outb(VGA_DAC_MASK, 0xA5U); - if (in8(M64_DAC_MASK) == 0xA5U) - pATI->VGAAdapter = ATI_ADAPTER_MACH64; - outb(VGA_DAC_MASK, OldDACMask); - } - - if (!(DACCntl & DAC_VGA_ADR_EN)) - outr(DAC_CNTL, DACCntl); - } - break; - - default: - break; - } - - if (pATI->VGAAdapter == ATI_ADAPTER_NONE) - { - pATI->CPIO_VGAWonder = 0; - return; - } - if (pATI->CPIO_VGAWonder) { - ATIVGAWonderProbe(pVideo, pATI, p8514, ProbeFlags); + ATIVGAWonderProbe(pVideo, pATI, ProbeFlags); if (!pATI->CPIO_VGAWonder) { /* @@ -865,21 +523,9 @@ ATIAssignVGA * of I/O through the bus tree. */ pATI->CPIO_VGAWonder = GRAX; - ATIVGAWonderProbe(pVideo, pATI, p8514, ProbeFlags); + ATIVGAWonderProbe(pVideo, pATI, ProbeFlags); } } - - if (pATI == pVGA) - { - pATI->SharedVGA = TRUE; - return; - } - - /* Assign the VGA to this adapter */ - xfree(pVGA); - *ppVGA = pATI; - - xf86MsgVerb(X_INFO, 3, ATI_NAME ": VGA assigned to this adapter.\n"); } /* @@ -892,16 +538,10 @@ static void ATIFindVGA ( pciVideoPtr pVideo, - ATIPtr *ppVGA, - ATIPtr *ppATI, - ATIPtr p8514, + ATIPtr pATI, CARD8 *ProbeFlags ) { - ATIPtr pATI = *ppATI; - - if (!*ppVGA) - { /* * An ATI PCI adapter has been detected at this point, and its VGA, if * any, is shareable. Ensure the VGA isn't in sleep mode. @@ -910,14 +550,7 @@ ATIFindVGA outb(GENVS, 0x01U); outb(GENENA, 0x0EU); - pATI = ATIVGAProbe(pATI); - if (pATI->VGAAdapter == ATI_ADAPTER_NONE) - return; - - ppVGA = ppATI; - } - - ATIAssignVGA(pVideo, ppVGA, pATI, p8514, ProbeFlags); + ATIAssignVGA(pVideo, pATI, ProbeFlags); } #endif /* AVOID_CPIO */ @@ -954,22 +587,12 @@ ATIProbe #ifndef AVOID_CPIO - ATIPtr pVGA = NULL, p8514 = NULL; pciConfigPtr *xf86PciInfo = xf86GetPciConfigInfo(); PortPtr PCIPorts = NULL; int nPCIPort = 0; - CARD8 fChipsets[ATI_CHIPSET_MAX]; static const IOADDRESS Mach64SparseIOBases[] = {0x02ECU, 0x01CCU, 0x01C8U}; CARD8 ProbeFlags[LongPort(SPARSE_IO_BASE) + 1]; - unsigned long BIOSBase; - static const CARD8 ATISignature[] = " 761295520"; -# define SignatureSize 10 -# define PrefixSize 0x50U -# define BIOSSignature 0x30U - CARD8 BIOS[PrefixSize]; -# define BIOSWord(_n) (BIOS[_n] | (BIOS[(_n) + 1] << 8)) - #endif /* AVOID_CPIO */ # define AddAdapter(_p) \ @@ -981,12 +604,6 @@ ATIProbe (_p)->iEntity = -2; \ } while (0) -#ifndef AVOID_CPIO - - (void)memset(fChipsets, FALSE, SizeOf(fChipsets)); - -#endif /* AVOID_CPIO */ - if (!(flags & PROBE_DETECT)) { /* @@ -1031,13 +648,6 @@ ATIProbe xf86MsgVerb(X_INFO, 3, ATI_NAME ": Candidate \"Device\" section \"%s\".\n", pGDev->identifier); - -#ifndef AVOID_CPIO - - fChipsets[Chipset] = TRUE; - -#endif /* AVOID_CPIO */ - } xfree(GDevs); @@ -1156,116 +766,6 @@ ATIProbe #ifndef AVOID_CPIO - /* - * This is the second pass through PCI configuration space. Much - * of this is verbiage to deal with potential situations that are - * very unlikely to occur in practice. - * - * First, look for non-ATI shareable VGA's. For now, these must - * the primary device. - */ - if (ATICheckSparseIOBases(NULL, ProbeFlags, ATTRX, 16, TRUE) == - DoProbe) - { - for (i = 0; (pVideo = xf86PciVideoInfo[i++]); ) - { - if ((pVideo->vendor == PCI_VENDOR_ATI) || - !xf86IsPrimaryPci(pVideo)) - continue; - - if (!xf86CheckPciSlot(pVideo->bus, - pVideo->device, - pVideo->func)) - continue; - - xf86SetPciVideo(pVideo, MEM_IO); - - pATI = ATIVGAProbe(NULL); - if (pATI->Adapter == ATI_ADAPTER_NONE) - { - xfree(pATI); - xf86Msg(X_WARNING, - ATI_NAME ": PCI/AGP VGA compatible in slot" - " %d:%d:%d could not be detected!\n", - pVideo->bus, pVideo->device, pVideo->func); - } - else - { - sprintf(Identifier, - "Shared non-ATI VGA in PCI/AGP slot %d:%d:%d", - pVideo->bus, pVideo->device, pVideo->func); - xf86MsgVerb(X_INFO, 3, ATI_NAME ": %s detected.\n", - Identifier); - AddAdapter(pATI); - pATI->SharedVGA = TRUE; - pATI->BusType = ATI_BUS_PCI; - pATI->PCIInfo = pVideo; - } - - xf86SetPciVideo(NULL, NONE); - } - } - - /* Next, look for PCI Mach32's */ - for (i = 0; (pVideo = xf86PciVideoInfo[i++]); ) - { - if ((pVideo->vendor != PCI_VENDOR_ATI) || - (pVideo->chipType != PCI_CHIP_MACH32)) - continue; - - switch (ATICheckSparseIOBases(pVideo, ProbeFlags, - 0x02E8U, 8, TRUE)) - { - case 0: - xf86Msg(X_WARNING, - ATI_NAME ": PCI Mach32 in slot %d:%d:%d will not" - " be enabled\n because it conflicts with a" - " non-video PCI/AGP device.\n", - pVideo->bus, pVideo->device, pVideo->func); - break; - - default: /* Must be DoProbe */ - if (!xf86CheckPciSlot(pVideo->bus, - pVideo->device, - pVideo->func)) - continue; - - xf86SetPciVideo(pVideo, MEM_IO); - - if (!(pATI = ATI8514Probe(pVideo))) - { - xf86Msg(X_WARNING, - ATI_NAME ": PCI Mach32 in slot %d:%d:%d could" - " not be detected!\n", - pVideo->bus, pVideo->device, pVideo->func); - } - else - { - sprintf(Identifier, - "Shared 8514/A in PCI slot %d:%d:%d", - pVideo->bus, pVideo->device, pVideo->func); - xf86MsgVerb(X_INFO, 3, - ATI_NAME ": %s detected.\n", Identifier); - if (pATI->Adapter != ATI_ADAPTER_MACH32) - xf86Msg(X_WARNING, - ATI_NAME ": PCI Mach32 in slot %d:%d:%d" - " could only be detected as an %s!\n", - pVideo->bus, pVideo->device, pVideo->func, - ATIAdapterNames[pATI->Adapter]); - - AddAdapter(pATI); - pATI->SharedAccelerator = TRUE; - - if ((pATI->VGAAdapter != ATI_ADAPTER_NONE) || - (pATI->Coprocessor != ATI_CHIP_NONE)) - ATIFindVGA(pVideo, &pVGA, &pATI, p8514, - ProbeFlags); - } - xf86SetPciVideo(NULL, NONE); - break; - } - } - /* Next, look for sparse I/O Mach64's */ for (i = 0; (pVideo = xf86PciVideoInfo[i++]); ) { @@ -1338,12 +838,10 @@ ATIProbe " detected.\n", Identifier, Mach64SparseIOBases[j]); AddAdapter(pATI); - pATI->SharedAccelerator = TRUE; pATI->PCIInfo = pVideo; if (pATI->VGAAdapter != ATI_ADAPTER_NONE) - ATIFindVGA(pVideo, &pVGA, &pATI, p8514, - ProbeFlags); + ATIFindVGA(pVideo, pATI, ProbeFlags); } xf86SetPciVideo(NULL, NONE); @@ -1387,7 +885,6 @@ ATIProbe ATI_NAME ": %s with Block 0 base 0x%08lX detected.\n", Identifier, pATI->Block0Base); AddAdapter(pATI); - pATI->SharedAccelerator = TRUE; pATI->PCIInfo = pVideo; } else @@ -1456,12 +953,11 @@ ATIProbe xf86MsgVerb(X_INFO, 3, ATI_NAME ": %s detected.\n", Identifier); AddAdapter(pATI); - pATI->SharedAccelerator = TRUE; #ifndef AVOID_CPIO if (pATI->VGAAdapter != ATI_ADAPTER_NONE) - ATIFindVGA(pVideo, &pVGA, &pATI, p8514, ProbeFlags); + ATIFindVGA(pVideo, pATI, ProbeFlags); #endif /* AVOID_CPIO */ @@ -1482,176 +978,6 @@ ATIProbe } } -#ifndef AVOID_CPIO - - /* - * At this point, if there's a non-shareable VGA with its own framebuffer, - * find out if it's an ATI VGA Wonder. - */ - do - { - if (!nATIGDev || !pVGA || (pVGA->VGAAdapter > ATI_ADAPTER_VGA)) - break; - - /* If it has not been assigned to a coprocessor, keep track of it */ - if (pVGA->Coprocessor == ATI_CHIP_NONE) - AddAdapter(pVGA); - - /* - * A VGA should have installed its int 10 vector. Use that to find the - * VGA BIOS. If this fails, scan all legacy BIOS segments, in 512-byte - * increments. - */ - if (xf86ReadBIOS(0U, 0x42U, BIOS, 2) != 2) - goto NoVGAWonder; - - pATI = NULL; - BIOSBase = 0; - if (!(BIOS[0] & 0x1FU)) /* Otherwise there's no 512-byte alignment */ - BIOSBase = ((BIOS[1] << 8) | BIOS[0]) << 4; - - /* Look for its BIOS */ - for(; ; BIOSBase += 0x00000200U) - { - if (!BIOSBase) - goto SkipBiosSegment; - - if (BIOSBase >= 0x000F8000U) - goto NoVGAWonder; - - /* Skip over those that are already known */ - for (i = 0; i < nATIPtr; i++) - if (ATIPtrs[i]->BIOSBase == BIOSBase) - goto SkipBiosSegment; - - /* Get first 80 bytes of video BIOS */ - if (xf86ReadBIOS(BIOSBase, 0, BIOS, SizeOf(BIOS)) != - SizeOf(BIOS)) - goto NoVGAWonder; - - if ((BIOS[0x00U] != 0x55U) || (BIOS[0x01U] != 0xAAU)) - goto SkipBiosSegment; - - if ((BIOS[0x1EU] == 'I') && - (BIOS[0x1FU] == 'B') && - (BIOS[0x20U] == 'M')) - break; - - /* XXX Should PCI BIOS signature be checked for here ? */ - if ((BIOS[0x20U] == 'P') && - (BIOS[0x21U] == 'C') && - (BIOS[0x22U] == 'I')) - break; - - SkipBiosSegment: - if (pATI) - continue; - - pATI = pVGA; - BIOSBase = 0x000C0000U - 0x00000200U; - } - - pVGA->BIOSBase = BIOSBase; - - /* Look for the ATI signature string */ - if (memcmp(BIOS + BIOSSignature, ATISignature, SignatureSize)) - break; - - if (BIOS[0x40U] != '3') - break; - - switch (BIOS[0x41U]) - { - case '1': - /* This is a Mach8 or VGA Wonder adapter of some kind */ - if ((BIOS[0x43U] >= '1') && (BIOS[0x43U] <= '6')) - pVGA->Chip = BIOS[0x43U] - ('1' - ATI_CHIP_18800); - - switch (BIOS[0x43U]) - { - case '1': /* ATI_CHIP_18800 */ - pVGA->VGAOffset = 0xB0U; - pVGA->VGAAdapter = ATI_ADAPTER_V3; - break; - - case '2': /* ATI_CHIP_18800_1 */ - pVGA->VGAOffset = 0xB0U; - if (BIOS[0x42U] & 0x10U) - pVGA->VGAAdapter = ATI_ADAPTER_V5; - else - pVGA->VGAAdapter = ATI_ADAPTER_V4; - break; - - case '3': /* ATI_CHIP_28800_2 */ - case '4': /* ATI_CHIP_28800_4 */ - case '5': /* ATI_CHIP_28800_5 */ - case '6': /* ATI_CHIP_28800_6 */ - pVGA->VGAOffset = 0xA0U; - if (BIOS[0x44U] & 0x80U) - pVGA->VGAAdapter = ATI_ADAPTER_XL; - else - pVGA->VGAAdapter = ATI_ADAPTER_PLUS; - break; - - case 'a': /* A crippled Mach32 */ - case 'b': - case 'c': - pVGA->VGAOffset = 0x80U; - pVGA->VGAAdapter = ATI_ADAPTER_NONISA; - ATIMach32ChipID(pVGA); - ProbeWaitIdleEmpty(); - if (inw(SUBSYS_STAT) != (CARD16)(-1)) - pVGA->ChipHasSUBSYS_CNTL = TRUE; - break; -#if 0 - case ' ': /* A crippled Mach64 */ - pVGA->VGAOffset = 0x80U; - pVGA->VGAAdapter = ATI_ADAPTER_NONISA; - ATIMach64ChipID(pVGA, 0); - break; -#endif - default: - break; - } - - if (pVGA->VGAAdapter == ATI_ADAPTER_NONE) - break; - - /* Set VGA Wonder I/O port */ - pVGA->CPIO_VGAWonder = BIOSWord(0x10U) & SPARSE_IO_PORT; - if (!pVGA->CPIO_VGAWonder) - pVGA->CPIO_VGAWonder = 0x01CEU; - - ATIVGAWonderProbe(NULL, pVGA, p8514, ProbeFlags); - break; -#if 0 - case '2': - pVGA->VGAOffset = 0xB0U; /* Presumably */ - pVGA->VGAAdapter = ATI_ADAPTER_EGA_PLUS; - break; - - case '3': - pVGA->VGAOffset = 0xB0U; /* Presumably */ - pVGA->VGAAdapter = ATI_ADAPTER_BASIC; - break; - - case '?': /* A crippled Mach64 */ - pVGA->VGAAdapter = ATI_ADAPTER_NONISA; - ATIMach64ChipID(pVGA, 0); - break; -#endif - default: - break; - } - - if (pVGA->Adapter <= ATI_ADAPTER_VGA) - pVGA->Adapter = pVGA->VGAAdapter; - -NoVGAWonder:; - } while (0); - -#endif /* AVOID_CPIO */ - /* * Re-order list of detected devices so that the primary device is before * any other PCI device. diff --git a/src/atistruct.h b/src/atistruct.h index 16bb4fa..fbb2391 100644 --- a/src/atistruct.h +++ b/src/atistruct.h @@ -238,12 +238,6 @@ typedef struct _ATIRec CARD8 Chip; CARD8 ChipClass, ChipRevision, ChipRev, ChipVersion, ChipFoundry; -#ifndef AVOID_CPIO - - CARD8 Coprocessor, ChipHasSUBSYS_CNTL; - -#endif /* AVOID_CPIO */ - /* * Processor I/O decoding definitions. */ @@ -285,11 +279,9 @@ typedef struct _ATIRec */ pciVideoPtr PCIInfo; CARD8 BusType; - CARD8 SharedAccelerator; #ifndef AVOID_CPIO - CARD8 SharedVGA; resRange VGAWonderResources[2]; #endif /* AVOID_CPIO */ |