|
@@ -124,7 +124,7 @@ static int amd64_fetch_size(void)
|
|
u32 temp;
|
|
u32 temp;
|
|
struct aper_size_info_32 *values;
|
|
struct aper_size_info_32 *values;
|
|
|
|
|
|
- dev = k8_northbridges[0];
|
|
|
|
|
|
+ dev = k8_northbridges.nb_misc[0];
|
|
if (dev==NULL)
|
|
if (dev==NULL)
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
@@ -181,10 +181,14 @@ static int amd_8151_configure(void)
|
|
unsigned long gatt_bus = virt_to_phys(agp_bridge->gatt_table_real);
|
|
unsigned long gatt_bus = virt_to_phys(agp_bridge->gatt_table_real);
|
|
int i;
|
|
int i;
|
|
|
|
|
|
|
|
+ if (!k8_northbridges.gart_supported)
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
/* Configure AGP regs in each x86-64 host bridge. */
|
|
/* Configure AGP regs in each x86-64 host bridge. */
|
|
- for (i = 0; i < num_k8_northbridges; i++) {
|
|
|
|
|
|
+ for (i = 0; i < k8_northbridges.num; i++) {
|
|
agp_bridge->gart_bus_addr =
|
|
agp_bridge->gart_bus_addr =
|
|
- amd64_configure(k8_northbridges[i], gatt_bus);
|
|
|
|
|
|
+ amd64_configure(k8_northbridges.nb_misc[i],
|
|
|
|
+ gatt_bus);
|
|
}
|
|
}
|
|
k8_flush_garts();
|
|
k8_flush_garts();
|
|
return 0;
|
|
return 0;
|
|
@@ -195,8 +199,12 @@ static void amd64_cleanup(void)
|
|
{
|
|
{
|
|
u32 tmp;
|
|
u32 tmp;
|
|
int i;
|
|
int i;
|
|
- for (i = 0; i < num_k8_northbridges; i++) {
|
|
|
|
- struct pci_dev *dev = k8_northbridges[i];
|
|
|
|
|
|
+
|
|
|
|
+ if (!k8_northbridges.gart_supported)
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+ for (i = 0; i < k8_northbridges.num; i++) {
|
|
|
|
+ struct pci_dev *dev = k8_northbridges.nb_misc[i];
|
|
/* disable gart translation */
|
|
/* disable gart translation */
|
|
pci_read_config_dword(dev, AMD64_GARTAPERTURECTL, &tmp);
|
|
pci_read_config_dword(dev, AMD64_GARTAPERTURECTL, &tmp);
|
|
tmp &= ~AMD64_GARTEN;
|
|
tmp &= ~AMD64_GARTEN;
|
|
@@ -319,16 +327,19 @@ static __devinit int fix_northbridge(struct pci_dev *nb, struct pci_dev *agp,
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-static __devinit int cache_nbs (struct pci_dev *pdev, u32 cap_ptr)
|
|
|
|
|
|
+static __devinit int cache_nbs(struct pci_dev *pdev, u32 cap_ptr)
|
|
{
|
|
{
|
|
int i;
|
|
int i;
|
|
|
|
|
|
if (cache_k8_northbridges() < 0)
|
|
if (cache_k8_northbridges() < 0)
|
|
return -ENODEV;
|
|
return -ENODEV;
|
|
|
|
|
|
|
|
+ if (!k8_northbridges.gart_supported)
|
|
|
|
+ return -ENODEV;
|
|
|
|
+
|
|
i = 0;
|
|
i = 0;
|
|
- for (i = 0; i < num_k8_northbridges; i++) {
|
|
|
|
- struct pci_dev *dev = k8_northbridges[i];
|
|
|
|
|
|
+ for (i = 0; i < k8_northbridges.num; i++) {
|
|
|
|
+ struct pci_dev *dev = k8_northbridges.nb_misc[i];
|
|
if (fix_northbridge(dev, pdev, cap_ptr) < 0) {
|
|
if (fix_northbridge(dev, pdev, cap_ptr) < 0) {
|
|
dev_err(&dev->dev, "no usable aperture found\n");
|
|
dev_err(&dev->dev, "no usable aperture found\n");
|
|
#ifdef __x86_64__
|
|
#ifdef __x86_64__
|
|
@@ -405,7 +416,8 @@ static int __devinit uli_agp_init(struct pci_dev *pdev)
|
|
}
|
|
}
|
|
|
|
|
|
/* shadow x86-64 registers into ULi registers */
|
|
/* shadow x86-64 registers into ULi registers */
|
|
- pci_read_config_dword (k8_northbridges[0], AMD64_GARTAPERTUREBASE, &httfea);
|
|
|
|
|
|
+ pci_read_config_dword (k8_northbridges.nb_misc[0], AMD64_GARTAPERTUREBASE,
|
|
|
|
+ &httfea);
|
|
|
|
|
|
/* if x86-64 aperture base is beyond 4G, exit here */
|
|
/* if x86-64 aperture base is beyond 4G, exit here */
|
|
if ((httfea & 0x7fff) >> (32 - 25)) {
|
|
if ((httfea & 0x7fff) >> (32 - 25)) {
|
|
@@ -472,7 +484,8 @@ static int nforce3_agp_init(struct pci_dev *pdev)
|
|
pci_write_config_dword(dev1, NVIDIA_X86_64_1_APSIZE, tmp);
|
|
pci_write_config_dword(dev1, NVIDIA_X86_64_1_APSIZE, tmp);
|
|
|
|
|
|
/* shadow x86-64 registers into NVIDIA registers */
|
|
/* shadow x86-64 registers into NVIDIA registers */
|
|
- pci_read_config_dword (k8_northbridges[0], AMD64_GARTAPERTUREBASE, &apbase);
|
|
|
|
|
|
+ pci_read_config_dword (k8_northbridges.nb_misc[0], AMD64_GARTAPERTUREBASE,
|
|
|
|
+ &apbase);
|
|
|
|
|
|
/* if x86-64 aperture base is beyond 4G, exit here */
|
|
/* if x86-64 aperture base is beyond 4G, exit here */
|
|
if ( (apbase & 0x7fff) >> (32 - 25) ) {
|
|
if ( (apbase & 0x7fff) >> (32 - 25) ) {
|