Lines 18-24
Link Here
|
18 |
#include <linux/pci_ids.h> |
18 |
#include <linux/pci_ids.h> |
19 |
#include <linux/pci.h> |
19 |
#include <linux/pci.h> |
20 |
#include <linux/bitops.h> |
20 |
#include <linux/bitops.h> |
21 |
#include <linux/ioport.h> |
|
|
22 |
#include <linux/suspend.h> |
21 |
#include <linux/suspend.h> |
23 |
#include <asm/e820.h> |
22 |
#include <asm/e820.h> |
24 |
#include <asm/io.h> |
23 |
#include <asm/io.h> |
Lines 54-71
int fallback_aper_force __initdata;
Link Here
|
54 |
|
53 |
|
55 |
int fix_aperture __initdata = 1; |
54 |
int fix_aperture __initdata = 1; |
56 |
|
55 |
|
57 |
static struct resource gart_resource = { |
|
|
58 |
.name = "GART", |
59 |
.flags = IORESOURCE_MEM, |
60 |
}; |
61 |
|
62 |
static void __init insert_aperture_resource(u32 aper_base, u32 aper_size) |
63 |
{ |
64 |
gart_resource.start = aper_base; |
65 |
gart_resource.end = aper_base + aper_size - 1; |
66 |
insert_resource(&iomem_resource, &gart_resource); |
67 |
} |
68 |
|
69 |
/* This code runs before the PCI subsystem is initialized, so just |
56 |
/* This code runs before the PCI subsystem is initialized, so just |
70 |
access the northbridge directly. */ |
57 |
access the northbridge directly. */ |
71 |
|
58 |
|
Lines 96-102
static u32 __init allocate_aperture(void)
Link Here
|
96 |
memblock_reserve(addr, aper_size); |
83 |
memblock_reserve(addr, aper_size); |
97 |
printk(KERN_INFO "Mapping aperture over %d KB of RAM @ %lx\n", |
84 |
printk(KERN_INFO "Mapping aperture over %d KB of RAM @ %lx\n", |
98 |
aper_size >> 10, addr); |
85 |
aper_size >> 10, addr); |
99 |
insert_aperture_resource((u32)addr, aper_size); |
|
|
100 |
register_nosave_region(addr >> PAGE_SHIFT, |
86 |
register_nosave_region(addr >> PAGE_SHIFT, |
101 |
(addr+aper_size) >> PAGE_SHIFT); |
87 |
(addr+aper_size) >> PAGE_SHIFT); |
102 |
|
88 |
|
Lines 444-455
int __init gart_iommu_hole_init(void)
Link Here
|
444 |
|
430 |
|
445 |
out: |
431 |
out: |
446 |
if (!fix && !fallback_aper_force) { |
432 |
if (!fix && !fallback_aper_force) { |
447 |
if (last_aper_base) { |
433 |
if (last_aper_base) |
448 |
unsigned long n = (32 * 1024 * 1024) << last_aper_order; |
|
|
449 |
|
450 |
insert_aperture_resource((u32)last_aper_base, n); |
451 |
return 1; |
434 |
return 1; |
452 |
} |
|
|
453 |
return 0; |
435 |
return 0; |
454 |
} |
436 |
} |
455 |
|
437 |
|