Use aperture base address from north bridge. Some BIOS does not encode

misc. control registers correctly and it is inconsistent with north bridge.
In fact, there are too many broken BIOS implementations out there and we
cannot fix every possible combination but at least it is consistent with
what we advertise with ioctl(2).
This commit is contained in:
Jung-uk Kim 2006-08-21 19:10:58 +00:00
parent 2eed31bc7e
commit 668e25a26c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=161518
2 changed files with 10 additions and 20 deletions

View file

@ -182,14 +182,9 @@ agp_amd64_attach(device_t dev)
sc->n_mctrl = n;
if (bootverbose) {
if (bootverbose)
device_printf(dev, "%d Miscellaneous Control unit(s) found.\n",
sc->n_mctrl);
for (i = 0; i < sc->n_mctrl; i++)
device_printf(dev, "Aperture Base[%d]: 0x%08x\n", i,
pci_cfgregread(0, sc->mctrl[i], 3,
AGP_AMD64_APBASE, 4) & AGP_AMD64_APBASE_MASK);
}
if ((error = agp_generic_attach(dev)))
return error;
@ -380,11 +375,11 @@ agp_amd64_apbase_fixup(device_t dev)
uint32_t apbase;
int i;
apbase = pci_cfgregread(0, sc->mctrl[0], 3, AGP_AMD64_APBASE, 4);
sc->apbase = rman_get_start(sc->agp.as_aperture);
apbase = (sc->apbase >> 25) & AGP_AMD64_APBASE_MASK;
for (i = 0; i < sc->n_mctrl; i++)
pci_cfgregwrite(0, sc->mctrl[i], 3, AGP_AMD64_APBASE,
apbase & ~(AGP_AMD64_APBASE_MASK & ~(uint32_t)0x7f), 4);
sc->apbase = apbase << 25;
pci_cfgregwrite(0, sc->mctrl[i], 3,
AGP_AMD64_APBASE, apbase, 4);
}
static void

View file

@ -182,14 +182,9 @@ agp_amd64_attach(device_t dev)
sc->n_mctrl = n;
if (bootverbose) {
if (bootverbose)
device_printf(dev, "%d Miscellaneous Control unit(s) found.\n",
sc->n_mctrl);
for (i = 0; i < sc->n_mctrl; i++)
device_printf(dev, "Aperture Base[%d]: 0x%08x\n", i,
pci_cfgregread(0, sc->mctrl[i], 3,
AGP_AMD64_APBASE, 4) & AGP_AMD64_APBASE_MASK);
}
if ((error = agp_generic_attach(dev)))
return error;
@ -380,11 +375,11 @@ agp_amd64_apbase_fixup(device_t dev)
uint32_t apbase;
int i;
apbase = pci_cfgregread(0, sc->mctrl[0], 3, AGP_AMD64_APBASE, 4);
sc->apbase = rman_get_start(sc->agp.as_aperture);
apbase = (sc->apbase >> 25) & AGP_AMD64_APBASE_MASK;
for (i = 0; i < sc->n_mctrl; i++)
pci_cfgregwrite(0, sc->mctrl[i], 3, AGP_AMD64_APBASE,
apbase & ~(AGP_AMD64_APBASE_MASK & ~(uint32_t)0x7f), 4);
sc->apbase = apbase << 25;
pci_cfgregwrite(0, sc->mctrl[i], 3,
AGP_AMD64_APBASE, apbase, 4);
}
static void