]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/aperture_64.c
x86: Add UV bios call infrastructure v4
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / aperture_64.c
index e5b17f910f8b4742fb98a85b2d6464cae0e87276..9a32b37ee2eec2f176708d7fccd5b7dadcf0e3ab 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,16 +325,18 @@ 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();
                }
-               return;
        }
 
+       if (!fix)
+               return;
+
        /* different nodes have different setting, disable them all at first*/
        for (i = 0; i < ARRAY_SIZE(bus_dev_ranges); i++) {
                int bus;
@@ -405,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");
@@ -446,15 +451,15 @@ 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) {
-               printk(KERN_ERR
+               printk(KERN_INFO
                        "Your BIOS doesn't leave a aperture memory hole\n");
-               printk(KERN_ERR
+               printk(KERN_INFO
                        "Please enable the IOMMU option in the BIOS setup\n");
-               printk(KERN_ERR
+               printk(KERN_INFO
                        "This costs you %d MB of RAM\n",
                                32 << fallback_aper_order);
 
@@ -494,4 +499,6 @@ out:
                        write_pci_config(bus, slot, 3, AMD64_GARTAPERTUREBASE, aper_alloc >> 25);
                }
        }
+
+       set_up_gart_resume(aper_order, aper_alloc);
 }