]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/pci-gart_64.c
Merge branch 'linus' into cpus4096
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / pci-gart_64.c
index f20c20a7853d051ab74798092dab5f32b72f2200..c3fe78406d1897b40e380f0528cf4db832d0a191 100644 (file)
@@ -104,7 +104,6 @@ static unsigned long alloc_iommu(struct device *dev, int size)
                                          size, base_index, boundary_size, 0);
        }
        if (offset != -1) {
-               set_bit_string(iommu_gart_bitmap, offset, size);
                next_bit = offset+size;
                if (next_bit >= iommu_pages) {
                        next_bit = 0;
@@ -631,6 +630,7 @@ static __init int init_k8_gatt(struct agp_kern_info *info)
        struct pci_dev *dev;
        void *gatt;
        int i, error;
+       unsigned long start_pfn, end_pfn;
 
        printk(KERN_INFO "PCI-DMA: Disabling AGP.\n");
        aper_size = aper_base = info->aper_size = 0;
@@ -675,6 +675,13 @@ static __init int init_k8_gatt(struct agp_kern_info *info)
 
        printk(KERN_INFO "PCI-DMA: aperture base @ %x size %u KB\n",
               aper_base, aper_size>>10);
+
+       /* need to map that range */
+       end_pfn = (aper_base>>PAGE_SHIFT) + (aper_size>>PAGE_SHIFT);
+       if (end_pfn > max_low_pfn_mapped) {
+               start_pfn = (aper_base>>PAGE_SHIFT);
+               init_memory_mapping(start_pfn<<PAGE_SHIFT, end_pfn<<PAGE_SHIFT);
+       }
        return 0;
 
  nommu:
@@ -752,10 +759,10 @@ void __init gart_iommu_init(void)
                return;
 
        if (no_iommu ||
-           (!force_iommu && end_pfn <= MAX_DMA32_PFN) ||
+           (!force_iommu && max_pfn <= MAX_DMA32_PFN) ||
            !gart_iommu_aperture ||
            (no_agp && init_k8_gatt(&info) < 0)) {
-               if (end_pfn > MAX_DMA32_PFN) {
+               if (max_pfn > MAX_DMA32_PFN) {
                        printk(KERN_WARNING "More than 4GB of memory "
                                          "but GART IOMMU not available.\n"
                               KERN_WARNING "falling back to iommu=soft.\n");