Rework support for i845, i865 and i875P. agp(4) now doesn't "kill" the

i82547EI on my i865PE motherboard any longer.
This commit is contained in:
tron 2003-08-26 18:43:54 +00:00
parent aba1ca99ae
commit e1ab9f5a04
1 changed files with 24 additions and 18 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: agp_intel.c,v 1.13 2003/08/26 17:28:13 tron Exp $ */
/* $NetBSD: agp_intel.c,v 1.14 2003/08/26 18:43:54 tron Exp $ */
/*-
* Copyright (c) 2000 Doug Rabson
@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: agp_intel.c,v 1.13 2003/08/26 17:28:13 tron Exp $");
__KERNEL_RCSID(0, "$NetBSD: agp_intel.c,v 1.14 2003/08/26 18:43:54 tron Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -63,6 +63,7 @@ struct agp_intel_softc {
#define CHIP_I840 0x2
#define CHIP_I845 0x3
#define CHIP_I850 0x4
#define CHIP_I865 0x5
};
static u_int32_t agp_intel_get_aperture(struct agp_softc *);
@ -139,23 +140,25 @@ agp_intel_attach(struct device *parent, struct device *self, void *aux)
}
switch (PCI_PRODUCT(isc->vga_pa.pa_id)) {
case PCI_PRODUCT_INTEL_82855PM_AGP:
case PCI_PRODUCT_INTEL_82845_AGP:
case PCI_PRODUCT_INTEL_82865_AGP:
case PCI_PRODUCT_INTEL_82875P_AGP:
isc->chiptype = CHIP_I845;
break;
case PCI_PRODUCT_INTEL_82840_AGP:
isc->chiptype = CHIP_I840;
break;
case PCI_PRODUCT_INTEL_82850_AGP:
isc->chiptype = CHIP_I850;
break;
case PCI_PRODUCT_INTEL_82443LX_AGP:
case PCI_PRODUCT_INTEL_82443BX_AGP:
case PCI_PRODUCT_INTEL_82443GX_AGP:
isc->chiptype = CHIP_I443;
break;
case PCI_PRODUCT_INTEL_82840_AGP:
isc->chiptype = CHIP_I840;
break;
case PCI_PRODUCT_INTEL_82855PM_AGP:
case PCI_PRODUCT_INTEL_82845_AGP:
isc->chiptype = CHIP_I845;
break;
case PCI_PRODUCT_INTEL_82850_AGP:
isc->chiptype = CHIP_I850;
break;
case PCI_PRODUCT_INTEL_82865_AGP:
case PCI_PRODUCT_INTEL_82875P_AGP:
isc->chiptype = CHIP_I865;
break;
}
/* Determine maximum supported aperture size. */
@ -203,10 +206,11 @@ agp_intel_attach(struct device *parent, struct device *self, void *aux)
/* Enable things, clear errors etc. */
switch (isc->chiptype) {
case CHIP_I845:
case CHIP_I865:
{
pci_conf_write(sc->as_pc, sc->as_tag, AGP_INTEL_AGPCMD,
AGPCMD_SBA | AGPCMD_AGPEN | AGPCMD_RATE_4X);
pci_conf_write(sc->as_pc, sc->as_tag, AGP_I845_AGPMISC, AGPMISC_AAGN);
reg = pci_conf_read(sc->as_pc, sc->as_tag, AGP_I840_MCHCFG);
reg |= MCHCFG_AAGN;
pci_conf_write(sc->as_pc, sc->as_tag, AGP_I840_MCHCFG, reg);
break;
}
case CHIP_I840:
@ -238,8 +242,9 @@ agp_intel_attach(struct device *parent, struct device *self, void *aux)
AGP_INTEL_I8XX_ERRSTS, 0xc000);
break;
case CHIP_I850:
case CHIP_I845:
case CHIP_I850:
case CHIP_I865:
pci_conf_write(sc->as_pc, sc->as_tag,
AGP_INTEL_I8XX_ERRSTS, 0x00ff);
break;
@ -351,6 +356,7 @@ agp_intel_flush_tlb(struct agp_softc *sc)
pcireg_t reg;
switch (isc->chiptype) {
case CHIP_I865:
case CHIP_I850:
case CHIP_I845:
case CHIP_I840: