aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/agp/hp-agp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/agp/hp-agp.c')
-rw-r--r--drivers/char/agp/hp-agp.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/char/agp/hp-agp.c b/drivers/char/agp/hp-agp.c
index 8f3d4c184914..9047b2714653 100644
--- a/drivers/char/agp/hp-agp.c
+++ b/drivers/char/agp/hp-agp.c
@@ -107,7 +107,7 @@ static int __init hp_zx1_ioc_shared(void)
107 hp->gart_size = HP_ZX1_GART_SIZE; 107 hp->gart_size = HP_ZX1_GART_SIZE;
108 hp->gatt_entries = hp->gart_size / hp->io_page_size; 108 hp->gatt_entries = hp->gart_size / hp->io_page_size;
109 109
110 hp->io_pdir = gart_to_virt(readq(hp->ioc_regs+HP_ZX1_PDIR_BASE)); 110 hp->io_pdir = phys_to_virt(readq(hp->ioc_regs+HP_ZX1_PDIR_BASE));
111 hp->gatt = &hp->io_pdir[HP_ZX1_IOVA_TO_PDIR(hp->gart_base)]; 111 hp->gatt = &hp->io_pdir[HP_ZX1_IOVA_TO_PDIR(hp->gart_base)];
112 112
113 if (hp->gatt[0] != HP_ZX1_SBA_IOMMU_COOKIE) { 113 if (hp->gatt[0] != HP_ZX1_SBA_IOMMU_COOKIE) {
@@ -246,7 +246,7 @@ hp_zx1_configure (void)
246 agp_bridge->mode = readl(hp->lba_regs+hp->lba_cap_offset+PCI_AGP_STATUS); 246 agp_bridge->mode = readl(hp->lba_regs+hp->lba_cap_offset+PCI_AGP_STATUS);
247 247
248 if (hp->io_pdir_owner) { 248 if (hp->io_pdir_owner) {
249 writel(virt_to_gart(hp->io_pdir), hp->ioc_regs+HP_ZX1_PDIR_BASE); 249 writel(virt_to_phys(hp->io_pdir), hp->ioc_regs+HP_ZX1_PDIR_BASE);
250 readl(hp->ioc_regs+HP_ZX1_PDIR_BASE); 250 readl(hp->ioc_regs+HP_ZX1_PDIR_BASE);
251 writel(hp->io_tlb_ps, hp->ioc_regs+HP_ZX1_TCNFG); 251 writel(hp->io_tlb_ps, hp->ioc_regs+HP_ZX1_TCNFG);
252 readl(hp->ioc_regs+HP_ZX1_TCNFG); 252 readl(hp->ioc_regs+HP_ZX1_TCNFG);
@@ -394,10 +394,8 @@ hp_zx1_remove_memory (struct agp_memory *mem, off_t pg_start, int type)
394} 394}
395 395
396static unsigned long 396static unsigned long
397hp_zx1_mask_memory (struct agp_bridge_data *bridge, 397hp_zx1_mask_memory (struct agp_bridge_data *bridge, dma_addr_t addr, int type)
398 struct page *page, int type)
399{ 398{
400 unsigned long addr = phys_to_gart(page_to_phys(page));
401 return HP_ZX1_PDIR_VALID_BIT | addr; 399 return HP_ZX1_PDIR_VALID_BIT | addr;
402} 400}
403 401
@@ -478,7 +476,6 @@ zx1_gart_probe (acpi_handle obj, u32 depth, void *context, void **ret)
478{ 476{
479 acpi_handle handle, parent; 477 acpi_handle handle, parent;
480 acpi_status status; 478 acpi_status status;
481 struct acpi_buffer buffer;
482 struct acpi_device_info *info; 479 struct acpi_device_info *info;
483 u64 lba_hpa, sba_hpa, length; 480 u64 lba_hpa, sba_hpa, length;
484 int match; 481 int match;
@@ -490,13 +487,11 @@ zx1_gart_probe (acpi_handle obj, u32 depth, void *context, void **ret)
490 /* Look for an enclosing IOC scope and find its CSR space */ 487 /* Look for an enclosing IOC scope and find its CSR space */
491 handle = obj; 488 handle = obj;
492 do { 489 do {
493 buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER; 490 status = acpi_get_object_info(handle, &info);
494 status = acpi_get_object_info(handle, &buffer);
495 if (ACPI_SUCCESS(status)) { 491 if (ACPI_SUCCESS(status)) {
496 /* TBD check _CID also */ 492 /* TBD check _CID also */
497 info = buffer.pointer; 493 info->hardware_id.string[sizeof(info->hardware_id.length)-1] = '\0';
498 info->hardware_id.value[sizeof(info->hardware_id)-1] = '\0'; 494 match = (strcmp(info->hardware_id.string, "HWP0001") == 0);
499 match = (strcmp(info->hardware_id.value, "HWP0001") == 0);
500 kfree(info); 495 kfree(info);
501 if (match) { 496 if (match) {
502 status = hp_acpi_csr_space(handle, &sba_hpa, &length); 497 status = hp_acpi_csr_space(handle, &sba_hpa, &length);