]> err.no Git - linux-2.6/blobdiff - arch/x86/kernel/aperture_64.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[linux-2.6] / arch / x86 / kernel / aperture_64.c
index eb20f168c0fdb9052ad37919415cecd70a2a9f89..44e21826db1145a00659c89c5c45232ff3e70d2a 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/suspend.h>
 #include <asm/e820.h>
 #include <asm/io.h>
+#include <asm/iommu.h>
 #include <asm/gart.h>
 #include <asm/pci-direct.h>
 #include <asm/dma.h>
@@ -324,11 +325,11 @@ void __init early_gart_iommu_check(void)
                fix = 1;
 
        if (gart_fix_e820 && !fix && aper_enabled) {
-               if (!e820_all_mapped(aper_base, aper_base + aper_size,
-                                   E820_RESERVED)) {
+               if (e820_any_mapped(aper_base, aper_base + aper_size,
+                                   E820_RAM)) {
                        /* reserve it, so we can reuse it in second kernel */
                        printk(KERN_INFO "update e820 for GART\n");
-                       add_memory_region(aper_base, aper_size, E820_RESERVED);
+                       e820_add_region(aper_base, aper_size, E820_RESERVED);
                        update_e820();
                }
        }
@@ -407,7 +408,9 @@ void __init gart_iommu_hole_init(void)
                                    agp_aper_base == aper_base &&
                                    agp_aper_order == aper_order) {
                                        /* the same between two setting from NB and agp */
-                                       if (!no_iommu && end_pfn > MAX_DMA32_PFN && !printed_gart_size_msg) {
+                                       if (!no_iommu &&
+                                           max_pfn > MAX_DMA32_PFN &&
+                                           !printed_gart_size_msg) {
                                                printk(KERN_ERR "you are using iommu with agp, but GART size is less than 64M\n");
                                                printk(KERN_ERR "please increase GART size in your BIOS setup\n");
                                                printk(KERN_ERR "if BIOS doesn't have that option, contact your HW vendor!\n");
@@ -448,7 +451,7 @@ out:
                /* Got the aperture from the AGP bridge */
        } else if (swiotlb && !valid_agp) {
                /* Do nothing */
-       } else if ((!no_iommu && end_pfn > MAX_DMA32_PFN) ||
+       } else if ((!no_iommu && max_pfn > MAX_DMA32_PFN) ||
                   force_iommu ||
                   valid_agp ||
                   fallback_aper_force) {
@@ -496,4 +499,6 @@ out:
                        write_pci_config(bus, slot, 3, AMD64_GARTAPERTUREBASE, aper_alloc >> 25);
                }
        }
+
+       set_up_gart_resume(aper_order, aper_alloc);
 }