/* * Transmeta's Efficeon AGPGART driver. * * Based upon a diff by Linus around November '02. * * Ported to the 2.6 kernel by Carlos Puchol <cpglinux@puchol.com> * and H. Peter Anvin <hpa@transmeta.com>.
*/
/* * NOTE-cpg-040217: * * - when compiled as a module, after loading the module, * it will refuse to unload, indicating it is in use, * when it is not. * - no s3 (suspend to ram) testing. * - tested on the efficeon integrated nothbridge for tens * of iterations of starting x and glxgears. * - tested with radeon 9000 and radeon mobility m9 cards * - tested with c3/c4 enabled (with the mobility m9 card)
*/
/* * The real differences to the generic AGP code is * in the GART mappings - a two-level setup with the * first level being an on-chip 64-entry table. * * The page array is filled through the ATTPAGE register * (Aperture Translation Table Page Register) at 0xB8. Bits: * 31:20: physical page address * 11:9: Page Attribute Table Index (PATI) * must match the PAT index for the * mapped pages (the 2nd level page table pages * themselves should be just regular WB-cacheable, * so this is normally zero.) * 8: Present * 7:6: reserved, write as zero * 5:0: GATT directory index: which 1st-level entry * * The Efficeon AGP spec requires pages to be WB-cacheable * but to be explicitly CLFLUSH'd after any changes.
*/ #define EFFICEON_ATTPAGE 0xb8 #define EFFICEON_L1_SIZE 64 /* Number of PDE pages */
/* This function does the same thing as mask_memory() for this chipset... */ staticinlineunsignedlong efficeon_mask_memory(struct page *page)
{ unsignedlong addr = page_to_phys(page); return addr | 0x00000001;
}
/* clflush is slow, so don't clflush until we have to */ if (last_page &&
(((unsignedlong)page^(unsignedlong)last_page) &
clflush_mask))
clflush(last_page);
last_page = page;
}
if ( last_page )
clflush(last_page);
agp_bridge->driver->tlb_flush(mem); return 0;
}
staticint efficeon_remove_memory(struct agp_memory * mem, off_t pg_start, int type)
{ int i, count = mem->page_count, num_entries;
/* * If the device has not been properly setup, the following will catch * the problem and should stop the system from crashing. * 20030610 - hamish@zot.org
*/ if (pci_enable_device(pdev)) {
printk(KERN_ERR PFX "Unable to Enable PCI device\n");
agp_put_bridge(bridge); return -ENODEV;
}
/* * The following fixes the case where the BIOS has "forgotten" to * provide an address range for the GART. * 20030610 - hamish@zot.org
*/
r = &pdev->resource[0]; if (!r->start && r->end) { if (pci_assign_resource(pdev, 0)) {
printk(KERN_ERR PFX "could not assign resource 0\n");
agp_put_bridge(bridge); return -ENODEV;
}
}
/* Fill in the mode register */ if (cap_ptr) {
pci_read_config_dword(pdev,
bridge->capndx+PCI_AGP_STATUS,
&bridge->mode);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.