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()
66 page_map->remapped = page_map->real; in ati_create_page_map()
69 writel(agp_bridge->scratch_page, page_map->remapped+i); in ati_create_page_map()
70 readl(page_map->remapped+i); /* PCI Posting. */ in ati_create_page_map()
79 unmap_page_from_agp(virt_to_page(page_map->real)); in ati_free_page_map()
80 set_memory_wb((unsigned long)page_map->real, 1); in ati_free_page_map()
81 free_page((unsigned long) page_map->real); in ati_free_page_map()
95 if (entry->real != NULL) in ati_free_gatt_pages()
114 return -ENOMEM; in ati_create_gatt_pages()
120 retval = -ENOMEM; in ati_create_gatt_pages()
138 if ((agp_bridge->dev->device == PCI_DEVICE_ID_ATI_RS100) || in is_r200()
139 (agp_bridge->dev->device == PCI_DEVICE_ID_ATI_RS200) || in is_r200()
140 (agp_bridge->dev->device == PCI_DEVICE_ID_ATI_RS200_B) || in is_r200()
141 (agp_bridge->dev->device == PCI_DEVICE_ID_ATI_RS250)) in is_r200()
153 pci_read_config_dword(agp_bridge->dev, ATI_RS100_APSIZE, &temp); in ati_fetch_size()
155 pci_read_config_dword(agp_bridge->dev, ATI_RS300_APSIZE, &temp); in ati_fetch_size()
158 values = A_SIZE_LVL2(agp_bridge->driver->aperture_sizes); in ati_fetch_size()
159 for (i = 0; i < agp_bridge->driver->num_aperture_sizes; i++) { in ati_fetch_size()
161 agp_bridge->previous_size = in ati_fetch_size()
162 agp_bridge->current_size = (void *) (values + i); in ati_fetch_size()
164 agp_bridge->aperture_size_idx = i; in ati_fetch_size()
183 previous_size = A_SIZE_LVL2(agp_bridge->previous_size); in ati_cleanup()
187 pci_read_config_dword(agp_bridge->dev, ATI_RS100_APSIZE, &temp); in ati_cleanup()
188 temp = ((temp & ~(0x0000000f)) | previous_size->size_value); in ati_cleanup()
189 pci_write_config_dword(agp_bridge->dev, ATI_RS100_APSIZE, temp); in ati_cleanup()
191 pci_read_config_dword(agp_bridge->dev, ATI_RS300_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_RS300_APSIZE, temp); in ati_cleanup()
205 reg = pci_resource_start(agp_bridge->dev, ATI_GART_MMBASE_BAR); in ati_configure()
209 return -ENOMEM; in ati_configure()
212 pci_write_config_dword(agp_bridge->dev, ATI_RS100_IG_AGPMODE, 0x20000); in ati_configure()
214 pci_write_config_dword(agp_bridge->dev, ATI_RS300_IG_AGPMODE, 0x20000); in ati_configure()
226 pci_read_config_dword(agp_bridge->dev, PCI_COMMAND, &temp); in ati_configure()
227 pci_write_config_dword(agp_bridge->dev, PCI_COMMAND, temp | (1<<14)); in ati_configure()
230 writel(agp_bridge->gatt_bus_addr, ati_generic_private.registers+ATI_GART_BASE); in ati_configure()
261 #define GET_PAGE_DIR_IDX(addr) (GET_PAGE_DIR_OFF(addr) - \
262 GET_PAGE_DIR_OFF(agp_bridge->gart_bus_addr))
266 GET_PAGE_DIR_IDX(addr)]->remapped)
276 num_entries = A_SIZE_LVL2(agp_bridge->current_size)->num_entries; in ati_insert_memory()
278 mask_type = agp_generic_type_to_mask_type(mem->bridge, type); in ati_insert_memory()
279 if (mask_type != 0 || type != mem->type) in ati_insert_memory()
280 return -EINVAL; in ati_insert_memory()
282 if (mem->page_count == 0) in ati_insert_memory()
285 if ((pg_start + mem->page_count) > num_entries) in ati_insert_memory()
286 return -EINVAL; in ati_insert_memory()
289 while (j < (pg_start + mem->page_count)) { in ati_insert_memory()
290 addr = (j * PAGE_SIZE) + agp_bridge->gart_bus_addr; in ati_insert_memory()
293 return -EBUSY; in ati_insert_memory()
297 if (!mem->is_flushed) { in ati_insert_memory()
300 mem->is_flushed = true; in ati_insert_memory()
303 for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { in ati_insert_memory()
304 addr = (j * PAGE_SIZE) + agp_bridge->gart_bus_addr; in ati_insert_memory()
306 writel(agp_bridge->driver->mask_memory(agp_bridge, in ati_insert_memory()
307 page_to_phys(mem->pages[i]), in ati_insert_memory()
308 mem->type), in ati_insert_memory()
311 readl(GET_GATT(agp_bridge->gart_bus_addr)); /* PCI posting */ in ati_insert_memory()
312 agp_bridge->driver->tlb_flush(mem); in ati_insert_memory()
324 mask_type = agp_generic_type_to_mask_type(mem->bridge, type); in ati_remove_memory()
325 if (mask_type != 0 || type != mem->type) in ati_remove_memory()
326 return -EINVAL; in ati_remove_memory()
328 if (mem->page_count == 0) in ati_remove_memory()
331 for (i = pg_start; i < (mem->page_count + pg_start); i++) { in ati_remove_memory()
332 addr = (i * PAGE_SIZE) + agp_bridge->gart_bus_addr; in ati_remove_memory()
334 writel(agp_bridge->scratch_page, cur_gatt+GET_GATT_OFF(addr)); in ati_remove_memory()
337 readl(GET_GATT(agp_bridge->gart_bus_addr)); /* PCI posting */ in ati_remove_memory()
338 agp_bridge->driver->tlb_flush(mem); in ati_remove_memory()
353 value = A_SIZE_LVL2(agp_bridge->current_size); in ati_create_gatt_table()
358 retval = ati_create_gatt_pages(value->num_entries / 1024); in ati_create_gatt_table()
364 agp_bridge->gatt_table_real = (u32 *)page_dir.real; in ati_create_gatt_table()
365 agp_bridge->gatt_table = (u32 __iomem *) page_dir.remapped; in ati_create_gatt_table()
366 agp_bridge->gatt_bus_addr = virt_to_phys(page_dir.real); in ati_create_gatt_table()
369 current_size = A_SIZE_LVL2(agp_bridge->current_size); in ati_create_gatt_table()
372 pci_read_config_dword(agp_bridge->dev, ATI_RS100_APSIZE, &temp); in ati_create_gatt_table()
373 temp = (((temp & ~(0x0000000e)) | current_size->size_value) in ati_create_gatt_table()
375 pci_write_config_dword(agp_bridge->dev, ATI_RS100_APSIZE, temp); in ati_create_gatt_table()
376 pci_read_config_dword(agp_bridge->dev, ATI_RS100_APSIZE, &temp); in ati_create_gatt_table()
378 pci_read_config_dword(agp_bridge->dev, ATI_RS300_APSIZE, &temp); in ati_create_gatt_table()
379 temp = (((temp & ~(0x0000000e)) | current_size->size_value) in ati_create_gatt_table()
381 pci_write_config_dword(agp_bridge->dev, ATI_RS300_APSIZE, temp); in ati_create_gatt_table()
382 pci_read_config_dword(agp_bridge->dev, ATI_RS300_APSIZE, &temp); in ati_create_gatt_table()
390 addr = pci_bus_address(agp_bridge->dev, AGP_APERTURE_BAR); in ati_create_gatt_table()
391 agp_bridge->gart_bus_addr = addr; in ati_create_gatt_table()
394 for (i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) { in ati_create_gatt_table()
395 writel(virt_to_phys(ati_generic_private.gatt_pages[i]->real) | 1, in ati_create_gatt_table()
400 for (i = 0; i < value->num_entries; i++) { in ati_create_gatt_table()
401 addr = (i * PAGE_SIZE) + agp_bridge->gart_bus_addr; in ati_create_gatt_table()
403 writel(agp_bridge->scratch_page, cur_gatt+GET_GATT_OFF(addr)); in ati_create_gatt_table()
413 page_dir.real = (unsigned long *)agp_bridge->gatt_table_real; in ati_free_gatt_table()
414 page_dir.remapped = (unsigned long __iomem *)agp_bridge->gatt_table; in ati_free_gatt_table()
503 return -ENODEV; in agp_ati_probe()
507 if (pdev->device == devs[j].device_id) in agp_ati_probe()
511 dev_err(&pdev->dev, "unsupported Ati chipset [%04x/%04x])\n", in agp_ati_probe()
512 pdev->vendor, pdev->device); in agp_ati_probe()
513 return -ENODEV; in agp_ati_probe()
518 return -ENOMEM; in agp_ati_probe()
520 bridge->dev = pdev; in agp_ati_probe()
521 bridge->capndx = cap_ptr; in agp_ati_probe()
523 bridge->driver = &ati_generic_bridge; in agp_ati_probe()
525 dev_info(&pdev->dev, "Ati %s chipset\n", devs[j].chipset_name); in agp_ati_probe()
527 /* Fill in the mode register */ in agp_ati_probe()
529 bridge->capndx+PCI_AGP_STATUS, in agp_ati_probe()
530 &bridge->mode); in agp_ati_probe()
559 .name = "agpgart-ati",
572 return -EINVAL; in agp_ati_init()