Lines Matching +full:cpu +full:- +full:centric
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright 2001-2003 SuSE Labs.
6 * This is a GART driver for the AMD Opteron/Athlon64 on-CPU northbridge.
50 struct agp_bridge_data *bridge = mem->bridge; in amd64_insert_memory()
55 if (type != mem->type) in amd64_insert_memory()
56 return -EINVAL; in amd64_insert_memory()
57 mask_type = bridge->driver->agp_type_to_mask_type(bridge, type); in amd64_insert_memory()
59 return -EINVAL; in amd64_insert_memory()
64 if (((unsigned long)pg_start + mem->page_count) > num_entries) in amd64_insert_memory()
65 return -EINVAL; in amd64_insert_memory()
70 while (j < (pg_start + mem->page_count)) { in amd64_insert_memory()
71 if (!PGE_EMPTY(agp_bridge, readl(agp_bridge->gatt_table+j))) in amd64_insert_memory()
72 return -EBUSY; in amd64_insert_memory()
76 if (!mem->is_flushed) { in amd64_insert_memory()
78 mem->is_flushed = true; in amd64_insert_memory()
81 for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { in amd64_insert_memory()
82 tmp = agp_bridge->driver->mask_memory(agp_bridge, in amd64_insert_memory()
83 page_to_phys(mem->pages[i]), in amd64_insert_memory()
91 writel(pte, agp_bridge->gatt_table+j); in amd64_insert_memory()
92 readl(agp_bridge->gatt_table+j); /* PCI Posting. */ in amd64_insert_memory()
116 * Get the current Aperture size from the x86-64.
117 * Note, that there may be multiple x86-64's, but we just return
128 dev = node_to_amd_nb(0)->misc; in amd64_fetch_size()
136 for (i = 0; i < agp_bridge->driver->num_aperture_sizes; i++) { in amd64_fetch_size()
138 agp_bridge->previous_size = in amd64_fetch_size()
139 agp_bridge->current_size = (void *) (values + i); in amd64_fetch_size()
141 agp_bridge->aperture_size_idx = i; in amd64_fetch_size()
149 * In a multiprocessor x86-64 system, this function gets
150 * called once for each CPU.
182 unsigned long gatt_bus = virt_to_phys(agp_bridge->gatt_table_real); in amd_8151_configure()
188 /* Configure AGP regs in each x86-64 host bridge. */ in amd_8151_configure()
190 agp_bridge->gart_bus_addr = in amd_8151_configure()
191 amd64_configure(node_to_amd_nb(i)->misc, gatt_bus); in amd_8151_configure()
207 struct pci_dev *dev = node_to_amd_nb(i)->misc; in amd64_cleanup()
250 already put a mapping in there - happens with some very broken BIOS in agp_aperture_valid()
263 * W*s centric BIOS sometimes only set up the aperture in the AGP
289 return -1; in fix_northbridge()
296 order = 7 - hweight16(apsize); in fix_northbridge()
305 dev_info(&agp->dev, "aperture size %u MB is not right, using settings from NB\n", in fix_northbridge()
315 dev_info(&agp->dev, "aperture from AGP @ %Lx size %u MB\n", in fix_northbridge()
318 return -1; in fix_northbridge()
331 return -ENODEV; in cache_nbs()
334 return -ENODEV; in cache_nbs()
338 struct pci_dev *dev = node_to_amd_nb(i)->misc; in cache_nbs()
340 dev_err(&dev->dev, "no usable aperture found\n"); in cache_nbs()
343 dev_err(&dev->dev, "consider rebooting with iommu=memaper=2 to get a good aperture\n"); in cache_nbs()
345 return -1; in cache_nbs()
356 switch (pdev->revision) { in amd8151_init()
366 dev_info(&pdev->dev, "AMD 8151 AGP Bridge rev %s\n", revstring); in amd8151_init()
372 if (pdev->revision < 0x13) { in amd8151_init()
373 dev_info(&pdev->dev, "correcting AGP revision (reports 3.5, is really 3.0)\n"); in amd8151_init()
374 bridge->major_version = 3; in amd8151_init()
375 bridge->minor_version = 0; in amd8151_init()
397 dev_info(&pdev->dev, "setting up ULi AGP\n"); in uli_agp_init()
398 dev1 = pci_get_slot (pdev->bus,PCI_DEVFN(0,0)); in uli_agp_init()
400 dev_info(&pdev->dev, "can't find ULi secondary device\n"); in uli_agp_init()
401 return -ENODEV; in uli_agp_init()
409 dev_info(&pdev->dev, "no ULi size found for %d\n", size); in uli_agp_init()
410 ret = -ENODEV; in uli_agp_init()
414 /* shadow x86-64 registers into ULi registers */ in uli_agp_init()
415 pci_read_config_dword (node_to_amd_nb(0)->misc, AMD64_GARTAPERTUREBASE, in uli_agp_init()
418 /* if x86-64 aperture base is beyond 4G, exit here */ in uli_agp_init()
419 if ((httfea & 0x7fff) >> (32 - 25)) { in uli_agp_init()
420 ret = -ENODEV; in uli_agp_init()
431 enuscr= httfea+ (size * 1024 * 1024) - 1; in uli_agp_init()
451 /* CHECK-ME original 2.4 version set up some IORRs. Check if that is needed. */
459 dev_info(&pdev->dev, "setting up Nforce3 AGP\n"); in nforce3_agp_init()
461 dev1 = pci_get_slot(pdev->bus, PCI_DEVFN(11, 0)); in nforce3_agp_init()
463 dev_info(&pdev->dev, "can't find Nforce3 secondary device\n"); in nforce3_agp_init()
464 return -ENODEV; in nforce3_agp_init()
472 dev_info(&pdev->dev, "no NForce3 size found for %d\n", size); in nforce3_agp_init()
473 ret = -ENODEV; in nforce3_agp_init()
482 /* shadow x86-64 registers into NVIDIA registers */ in nforce3_agp_init()
483 pci_read_config_dword (node_to_amd_nb(0)->misc, AMD64_GARTAPERTUREBASE, in nforce3_agp_init()
486 /* if x86-64 aperture base is beyond 4G, exit here */ in nforce3_agp_init()
487 if ( (apbase & 0x7fff) >> (32 - 25) ) { in nforce3_agp_init()
488 dev_info(&pdev->dev, "aperture base > 4G\n"); in nforce3_agp_init()
489 ret = -ENODEV; in nforce3_agp_init()
500 aplimit = apbase + (size * 1024 * 1024) - 1; in nforce3_agp_init()
522 return -ENODEV; in agp_amd64_probe()
526 return -ENODEV; in agp_amd64_probe()
532 return -ENOMEM; in agp_amd64_probe()
534 if (pdev->vendor == PCI_VENDOR_ID_AMD && in agp_amd64_probe()
535 pdev->device == PCI_DEVICE_ID_AMD_8151_0) { in agp_amd64_probe()
538 dev_info(&pdev->dev, "AGP bridge [%04x/%04x]\n", in agp_amd64_probe()
539 pdev->vendor, pdev->device); in agp_amd64_probe()
542 bridge->driver = &amd_8151_driver; in agp_amd64_probe()
543 bridge->dev = pdev; in agp_amd64_probe()
544 bridge->capndx = cap_ptr; in agp_amd64_probe()
547 pci_read_config_dword(pdev, bridge->capndx+PCI_AGP_STATUS, &bridge->mode); in agp_amd64_probe()
549 if (cache_nbs(pdev, cap_ptr) == -1) { in agp_amd64_probe()
551 return -ENODEV; in agp_amd64_probe()
554 if (pdev->vendor == PCI_VENDOR_ID_NVIDIA) { in agp_amd64_probe()
562 if (pdev->vendor == PCI_VENDOR_ID_AL) { in agp_amd64_probe()
583 release_mem_region(virt_to_phys(bridge->gatt_table_real), in agp_amd64_remove()
584 amd64_aperture_sizes[bridge->aperture_size_idx].size); in agp_amd64_remove()
588 agp_bridges_found--; in agp_amd64_remove()
595 if (pdev->vendor == PCI_VENDOR_ID_NVIDIA) in agp_amd64_resume()
731 .name = "agpgart-amd64",
745 return -EINVAL; in agp_amd64_init()
760 return -ENODEV; in agp_amd64_init()
766 return -ENODEV; in agp_amd64_init()
774 err = -ENODEV; in agp_amd64_init()
784 return agp_bridges_found ? 0 : -ENODEV; in agp_amd64_mod_init()
805 MODULE_DESCRIPTION("GART driver for the AMD Opteron/Athlon64 on-CPU northbridge");