Lines Matching +full:ati +full:- +full:mode

2  * ATi AGPGART routines.
60 page_map->real = (unsigned long *) __get_free_page(GFP_KERNEL); in ati_create_page_map()
61 if (page_map->real == NULL) in ati_create_page_map()
62 return -ENOMEM; in ati_create_page_map()
64 set_memory_uc((unsigned long)page_map->real, 1); in ati_create_page_map()
65 err = map_page_into_agp(virt_to_page(page_map->real)); in ati_create_page_map()
67 free_page((unsigned long)page_map->real); in ati_create_page_map()
70 page_map->remapped = page_map->real; in ati_create_page_map()
73 writel(agp_bridge->scratch_page, page_map->remapped+i); in ati_create_page_map()
74 readl(page_map->remapped+i); /* PCI Posting. */ in ati_create_page_map()
83 unmap_page_from_agp(virt_to_page(page_map->real)); in ati_free_page_map()
84 set_memory_wb((unsigned long)page_map->real, 1); in ati_free_page_map()
85 free_page((unsigned long) page_map->real); in ati_free_page_map()
99 if (entry->real != NULL) in ati_free_gatt_pages()
118 return -ENOMEM; in ati_create_gatt_pages()
124 retval = -ENOMEM; in ati_create_gatt_pages()
142 if ((agp_bridge->dev->device == PCI_DEVICE_ID_ATI_RS100) || in is_r200()
143 (agp_bridge->dev->device == PCI_DEVICE_ID_ATI_RS200) || in is_r200()
144 (agp_bridge->dev->device == PCI_DEVICE_ID_ATI_RS200_B) || in is_r200()
145 (agp_bridge->dev->device == PCI_DEVICE_ID_ATI_RS250)) in is_r200()
157 pci_read_config_dword(agp_bridge->dev, ATI_RS100_APSIZE, &temp); in ati_fetch_size()
159 pci_read_config_dword(agp_bridge->dev, ATI_RS300_APSIZE, &temp); in ati_fetch_size()
162 values = A_SIZE_LVL2(agp_bridge->driver->aperture_sizes); in ati_fetch_size()
163 for (i = 0; i < agp_bridge->driver->num_aperture_sizes; i++) { in ati_fetch_size()
165 agp_bridge->previous_size = in ati_fetch_size()
166 agp_bridge->current_size = (void *) (values + i); in ati_fetch_size()
168 agp_bridge->aperture_size_idx = i; in ati_fetch_size()
187 previous_size = A_SIZE_LVL2(agp_bridge->previous_size); in ati_cleanup()
191 pci_read_config_dword(agp_bridge->dev, ATI_RS100_APSIZE, &temp); in ati_cleanup()
192 temp = ((temp & ~(0x0000000f)) | previous_size->size_value); in ati_cleanup()
193 pci_write_config_dword(agp_bridge->dev, ATI_RS100_APSIZE, temp); in ati_cleanup()
195 pci_read_config_dword(agp_bridge->dev, ATI_RS300_APSIZE, &temp); in ati_cleanup()
196 temp = ((temp & ~(0x0000000f)) | previous_size->size_value); in ati_cleanup()
197 pci_write_config_dword(agp_bridge->dev, ATI_RS300_APSIZE, temp); in ati_cleanup()
209 reg = pci_resource_start(agp_bridge->dev, ATI_GART_MMBASE_BAR); in ati_configure()
213 return -ENOMEM; in ati_configure()
216 pci_write_config_dword(agp_bridge->dev, ATI_RS100_IG_AGPMODE, 0x20000); in ati_configure()
218 pci_write_config_dword(agp_bridge->dev, ATI_RS300_IG_AGPMODE, 0x20000); in ati_configure()
230 pci_read_config_dword(agp_bridge->dev, PCI_COMMAND, &temp); in ati_configure()
231 pci_write_config_dword(agp_bridge->dev, PCI_COMMAND, temp | (1<<14)); in ati_configure()
234 writel(agp_bridge->gatt_bus_addr, ati_generic_private.registers+ATI_GART_BASE); in ati_configure()
252 #define GET_PAGE_DIR_IDX(addr) (GET_PAGE_DIR_OFF(addr) - \
253 GET_PAGE_DIR_OFF(agp_bridge->gart_bus_addr))
257 GET_PAGE_DIR_IDX(addr)]->remapped)
267 num_entries = A_SIZE_LVL2(agp_bridge->current_size)->num_entries; in ati_insert_memory()
269 mask_type = agp_generic_type_to_mask_type(mem->bridge, type); in ati_insert_memory()
270 if (mask_type != 0 || type != mem->type) in ati_insert_memory()
271 return -EINVAL; in ati_insert_memory()
273 if (mem->page_count == 0) in ati_insert_memory()
276 if ((pg_start + mem->page_count) > num_entries) in ati_insert_memory()
277 return -EINVAL; in ati_insert_memory()
280 while (j < (pg_start + mem->page_count)) { in ati_insert_memory()
281 addr = (j * PAGE_SIZE) + agp_bridge->gart_bus_addr; in ati_insert_memory()
284 return -EBUSY; in ati_insert_memory()
288 if (!mem->is_flushed) { in ati_insert_memory()
291 mem->is_flushed = true; in ati_insert_memory()
294 for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { in ati_insert_memory()
295 addr = (j * PAGE_SIZE) + agp_bridge->gart_bus_addr; in ati_insert_memory()
297 writel(agp_bridge->driver->mask_memory(agp_bridge, in ati_insert_memory()
298 page_to_phys(mem->pages[i]), in ati_insert_memory()
299 mem->type), in ati_insert_memory()
302 readl(GET_GATT(agp_bridge->gart_bus_addr)); /* PCI posting */ in ati_insert_memory()
303 agp_bridge->driver->tlb_flush(mem); in ati_insert_memory()
315 mask_type = agp_generic_type_to_mask_type(mem->bridge, type); in ati_remove_memory()
316 if (mask_type != 0 || type != mem->type) in ati_remove_memory()
317 return -EINVAL; in ati_remove_memory()
319 if (mem->page_count == 0) in ati_remove_memory()
322 for (i = pg_start; i < (mem->page_count + pg_start); i++) { in ati_remove_memory()
323 addr = (i * PAGE_SIZE) + agp_bridge->gart_bus_addr; in ati_remove_memory()
325 writel(agp_bridge->scratch_page, cur_gatt+GET_GATT_OFF(addr)); in ati_remove_memory()
328 readl(GET_GATT(agp_bridge->gart_bus_addr)); /* PCI posting */ in ati_remove_memory()
329 agp_bridge->driver->tlb_flush(mem); in ati_remove_memory()
344 value = A_SIZE_LVL2(agp_bridge->current_size); in ati_create_gatt_table()
349 retval = ati_create_gatt_pages(value->num_entries / 1024); in ati_create_gatt_table()
355 agp_bridge->gatt_table_real = (u32 *)page_dir.real; in ati_create_gatt_table()
356 agp_bridge->gatt_table = (u32 __iomem *) page_dir.remapped; in ati_create_gatt_table()
357 agp_bridge->gatt_bus_addr = virt_to_phys(page_dir.real); in ati_create_gatt_table()
360 current_size = A_SIZE_LVL2(agp_bridge->current_size); in ati_create_gatt_table()
363 pci_read_config_dword(agp_bridge->dev, ATI_RS100_APSIZE, &temp); in ati_create_gatt_table()
364 temp = (((temp & ~(0x0000000e)) | current_size->size_value) in ati_create_gatt_table()
366 pci_write_config_dword(agp_bridge->dev, ATI_RS100_APSIZE, temp); in ati_create_gatt_table()
367 pci_read_config_dword(agp_bridge->dev, ATI_RS100_APSIZE, &temp); in ati_create_gatt_table()
369 pci_read_config_dword(agp_bridge->dev, ATI_RS300_APSIZE, &temp); in ati_create_gatt_table()
370 temp = (((temp & ~(0x0000000e)) | current_size->size_value) in ati_create_gatt_table()
372 pci_write_config_dword(agp_bridge->dev, ATI_RS300_APSIZE, temp); in ati_create_gatt_table()
373 pci_read_config_dword(agp_bridge->dev, ATI_RS300_APSIZE, &temp); in ati_create_gatt_table()
381 addr = pci_bus_address(agp_bridge->dev, AGP_APERTURE_BAR); in ati_create_gatt_table()
382 agp_bridge->gart_bus_addr = addr; in ati_create_gatt_table()
385 for (i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) { in ati_create_gatt_table()
386 writel(virt_to_phys(ati_generic_private.gatt_pages[i]->real) | 1, in ati_create_gatt_table()
391 for (i = 0; i < value->num_entries; i++) { in ati_create_gatt_table()
392 addr = (i * PAGE_SIZE) + agp_bridge->gart_bus_addr; in ati_create_gatt_table()
394 writel(agp_bridge->scratch_page, cur_gatt+GET_GATT_OFF(addr)); in ati_create_gatt_table()
404 page_dir.real = (unsigned long *)agp_bridge->gatt_table_real; in ati_free_gatt_table()
405 page_dir.remapped = (unsigned long __iomem *)agp_bridge->gatt_table; in ati_free_gatt_table()
494 return -ENODEV; in agp_ati_probe()
498 if (pdev->device == devs[j].device_id) in agp_ati_probe()
502 dev_err(&pdev->dev, "unsupported Ati chipset [%04x/%04x])\n", in agp_ati_probe()
503 pdev->vendor, pdev->device); in agp_ati_probe()
504 return -ENODEV; in agp_ati_probe()
509 return -ENOMEM; in agp_ati_probe()
511 bridge->dev = pdev; in agp_ati_probe()
512 bridge->capndx = cap_ptr; in agp_ati_probe()
514 bridge->driver = &ati_generic_bridge; in agp_ati_probe()
516 dev_info(&pdev->dev, "Ati %s chipset\n", devs[j].chipset_name); in agp_ati_probe()
518 /* Fill in the mode register */ in agp_ati_probe()
520 bridge->capndx+PCI_AGP_STATUS, in agp_ati_probe()
521 &bridge->mode); in agp_ati_probe()
552 .name = "agpgart-ati",
562 return -EINVAL; in agp_ati_init()
575 MODULE_DESCRIPTION("ATi AGPGART routines");