Lines Matching +full:real +full:-

9 #include <linux/page-flags.h>
19 #define AMD_GARTENABLE 0x02 /* In mmio region (16-bit register) */
20 #define AMD_ATTBASE 0x04 /* In mmio region (32-bit register) */
21 #define AMD_TLBFLUSH 0x0c /* In mmio region (32-bit register) */
22 #define AMD_CACHEENTRY 0x10 /* In mmio region (32-bit register) */
27 unsigned long *real; member
41 page_map->real = (unsigned long *) __get_free_page(GFP_KERNEL); in amd_create_page_map()
42 if (page_map->real == NULL) in amd_create_page_map()
43 return -ENOMEM; in amd_create_page_map()
45 set_memory_uc((unsigned long)page_map->real, 1); in amd_create_page_map()
46 page_map->remapped = page_map->real; in amd_create_page_map()
49 writel(agp_bridge->scratch_page, page_map->remapped+i); in amd_create_page_map()
50 readl(page_map->remapped+i); /* PCI Posting. */ in amd_create_page_map()
58 set_memory_wb((unsigned long)page_map->real, 1); in amd_free_page_map()
59 free_page((unsigned long) page_map->real); in amd_free_page_map()
72 if (entry->real != NULL) in amd_free_gatt_pages()
91 return -ENOMEM; in amd_create_gatt_pages()
97 retval = -ENOMEM; in amd_create_gatt_pages()
118 #define GET_PAGE_DIR_IDX(addr) (GET_PAGE_DIR_OFF(addr) - \
119 GET_PAGE_DIR_OFF(agp_bridge->gart_bus_addr))
122 GET_PAGE_DIR_IDX(addr)]->remapped)
133 value = A_SIZE_LVL2(agp_bridge->current_size); in amd_create_gatt_table()
138 retval = amd_create_gatt_pages(value->num_entries / 1024); in amd_create_gatt_table()
144 agp_bridge->gatt_table_real = (u32 *)page_dir.real; in amd_create_gatt_table()
145 agp_bridge->gatt_table = (u32 __iomem *)page_dir.remapped; in amd_create_gatt_table()
146 agp_bridge->gatt_bus_addr = virt_to_phys(page_dir.real); in amd_create_gatt_table()
153 addr = pci_bus_address(agp_bridge->dev, AGP_APERTURE_BAR); in amd_create_gatt_table()
154 agp_bridge->gart_bus_addr = addr; in amd_create_gatt_table()
157 for (i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) { in amd_create_gatt_table()
158 writel(virt_to_phys(amd_irongate_private.gatt_pages[i]->real) | 1, in amd_create_gatt_table()
163 for (i = 0; i < value->num_entries; i++) { in amd_create_gatt_table()
164 addr = (i * PAGE_SIZE) + agp_bridge->gart_bus_addr; in amd_create_gatt_table()
166 writel(agp_bridge->scratch_page, cur_gatt+GET_GATT_OFF(addr)); in amd_create_gatt_table()
177 page_dir.real = (unsigned long *)agp_bridge->gatt_table_real; in amd_free_gatt_table()
178 page_dir.remapped = (unsigned long __iomem *)agp_bridge->gatt_table; in amd_free_gatt_table()
191 pci_read_config_dword(agp_bridge->dev, AMD_APSIZE, &temp); in amd_irongate_fetch_size()
193 values = A_SIZE_LVL2(agp_bridge->driver->aperture_sizes); in amd_irongate_fetch_size()
194 for (i = 0; i < agp_bridge->driver->num_aperture_sizes; i++) { in amd_irongate_fetch_size()
196 agp_bridge->previous_size = in amd_irongate_fetch_size()
197 agp_bridge->current_size = (void *) (values + i); in amd_irongate_fetch_size()
199 agp_bridge->aperture_size_idx = i; in amd_irongate_fetch_size()
214 current_size = A_SIZE_LVL2(agp_bridge->current_size); in amd_irongate_configure()
218 reg = pci_resource_start(agp_bridge->dev, AMD_MMBASE_BAR); in amd_irongate_configure()
221 return -ENOMEM; in amd_irongate_configure()
225 writel(agp_bridge->gatt_bus_addr, amd_irongate_private.registers+AMD_ATTBASE); in amd_irongate_configure()
229 pci_write_config_byte(agp_bridge->dev, AMD_MODECNTL, 0x80); in amd_irongate_configure()
232 pci_write_config_byte(agp_bridge->dev, AMD_MODECNTL2, 0x00); in amd_irongate_configure()
241 pci_read_config_dword(agp_bridge->dev, AMD_APSIZE, &temp); in amd_irongate_configure()
242 temp = (((temp & ~(0x0000000e)) | current_size->size_value) | 1); in amd_irongate_configure()
243 pci_write_config_dword(agp_bridge->dev, AMD_APSIZE, temp); in amd_irongate_configure()
257 previous_size = A_SIZE_LVL2(agp_bridge->previous_size); in amd_irongate_cleanup()
265 pci_read_config_dword(agp_bridge->dev, AMD_APSIZE, &temp); in amd_irongate_cleanup()
266 temp = ((temp & ~(0x0000000f)) | previous_size->size_value); in amd_irongate_cleanup()
267 pci_write_config_dword(agp_bridge->dev, AMD_APSIZE, temp); in amd_irongate_cleanup()
291 num_entries = A_SIZE_LVL2(agp_bridge->current_size)->num_entries; in amd_insert_memory()
293 if (type != mem->type || in amd_insert_memory()
294 agp_bridge->driver->agp_type_to_mask_type(agp_bridge, type)) in amd_insert_memory()
295 return -EINVAL; in amd_insert_memory()
297 if ((pg_start + mem->page_count) > num_entries) in amd_insert_memory()
298 return -EINVAL; in amd_insert_memory()
301 while (j < (pg_start + mem->page_count)) { in amd_insert_memory()
302 addr = (j * PAGE_SIZE) + agp_bridge->gart_bus_addr; in amd_insert_memory()
305 return -EBUSY; in amd_insert_memory()
309 if (!mem->is_flushed) { in amd_insert_memory()
311 mem->is_flushed = true; in amd_insert_memory()
314 for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { in amd_insert_memory()
315 addr = (j * PAGE_SIZE) + agp_bridge->gart_bus_addr; in amd_insert_memory()
318 page_to_phys(mem->pages[i]), in amd_insert_memory()
319 mem->type), in amd_insert_memory()
333 if (type != mem->type || in amd_remove_memory()
334 agp_bridge->driver->agp_type_to_mask_type(agp_bridge, type)) in amd_remove_memory()
335 return -EINVAL; in amd_remove_memory()
337 for (i = pg_start; i < (mem->page_count + pg_start); i++) { in amd_remove_memory()
338 addr = (i * PAGE_SIZE) + agp_bridge->gart_bus_addr; in amd_remove_memory()
340 writel(agp_bridge->scratch_page, cur_gatt+GET_GATT_OFF(addr)); in amd_remove_memory()
417 return -ENODEV; in agp_amdk7_probe()
419 j = ent - agp_amdk7_pci_table; in agp_amdk7_probe()
420 dev_info(&pdev->dev, "AMD %s chipset\n", in agp_amdk7_probe()
425 return -ENOMEM; in agp_amdk7_probe()
427 bridge->driver = &amd_irongate_driver; in agp_amdk7_probe()
428 bridge->dev_private_data = &amd_irongate_private; in agp_amdk7_probe()
429 bridge->dev = pdev; in agp_amdk7_probe()
430 bridge->capndx = cap_ptr; in agp_amdk7_probe()
432 /* 751 Errata (22564_B-1.PDF) in agp_amdk7_probe()
436 if (agp_bridge->dev->device == PCI_DEVICE_ID_AMD_FE_GATE_7006) { in agp_amdk7_probe()
443 dev_info(&pdev->dev, "no AGP VGA controller\n"); in agp_amdk7_probe()
444 return -ENODEV; in agp_amdk7_probe()
452 if (gfxcard->vendor == PCI_VENDOR_ID_NVIDIA) { in agp_amdk7_probe()
453 agp_bridge->flags |= AGP_ERRATA_1X; in agp_amdk7_probe()
454 dev_info(&pdev->dev, "AMD 751 chipset with NVidia GeForce; forcing 1X due to errata\n"); in agp_amdk7_probe()
461 * erratum 44: SYSCLK/AGPCLK skew causes 2X failures -- Force mode to 1X in agp_amdk7_probe()
462 * erratum 45: Timing problem prevents fast writes -- Disable fast write. in agp_amdk7_probe()
463 * erratum 46: Setup violation on AGP SBA pins - Disable side band addressing. in agp_amdk7_probe()
465 if (agp_bridge->dev->device == PCI_DEVICE_ID_AMD_FE_GATE_700E) { in agp_amdk7_probe()
466 if (pdev->revision == 0x10 || pdev->revision == 0x11) { in agp_amdk7_probe()
467 agp_bridge->flags = AGP_ERRATA_FASTWRITES; in agp_amdk7_probe()
468 agp_bridge->flags |= AGP_ERRATA_SBA; in agp_amdk7_probe()
469 agp_bridge->flags |= AGP_ERRATA_1X; in agp_amdk7_probe()
470 …dev_info(&pdev->dev, "AMD 761 chipset with errata; disabling AGP fast writes & SBA and forcing to … in agp_amdk7_probe()
476 bridge->capndx+PCI_AGP_STATUS, in agp_amdk7_probe()
477 &bridge->mode); in agp_amdk7_probe()
530 .name = "agpgart-amdk7",
540 return -EINVAL; in agp_amdk7_init()