10
10
*
11
11
* Copyright 2002 Andi Kleen, SuSE Labs.
12
12
*/
13
+ #define pr_fmt (fmt ) "AGP: " fmt
14
+
13
15
#include <linux/kernel.h>
14
16
#include <linux/types.h>
15
17
#include <linux/init.h>
@@ -75,14 +77,13 @@ static u32 __init allocate_aperture(void)
75
77
addr = memblock_find_in_range (GART_MIN_ADDR , GART_MAX_ADDR ,
76
78
aper_size , aper_size );
77
79
if (!addr ) {
78
- printk (KERN_ERR
79
- "Cannot allocate aperture memory hole (%lx,%uK)\n" ,
80
- addr , aper_size >>10 );
80
+ pr_err ("Cannot allocate aperture memory hole (%lx,%uK)\n" ,
81
+ addr , aper_size >>10 );
81
82
return 0 ;
82
83
}
83
84
memblock_reserve (addr , aper_size );
84
- printk ( KERN_INFO "Mapping aperture over %d KB of RAM @ %lx\n" ,
85
- aper_size >> 10 , addr );
85
+ pr_info ( "Mapping aperture over %d KB of RAM @ %lx\n" , aper_size >> 10 ,
86
+ addr );
86
87
register_nosave_region (addr >> PAGE_SHIFT ,
87
88
(addr + aper_size ) >> PAGE_SHIFT );
88
89
@@ -126,10 +127,10 @@ static u32 __init read_agp(int bus, int slot, int func, int cap, u32 *order)
126
127
u64 aper ;
127
128
u32 old_order ;
128
129
129
- printk ( KERN_INFO "AGP bridge at %02x:%02x:%02x\n" , bus , slot , func );
130
+ pr_info ( "AGP bridge at %02x:%02x:%02x\n" , bus , slot , func );
130
131
apsizereg = read_pci_config_16 (bus , slot , func , cap + 0x14 );
131
132
if (apsizereg == 0xffffffff ) {
132
- printk ( KERN_ERR "APSIZE in AGP bridge unreadable\n" );
133
+ pr_err ( "APSIZE in AGP bridge unreadable\n" );
133
134
return 0 ;
134
135
}
135
136
@@ -153,16 +154,16 @@ static u32 __init read_agp(int bus, int slot, int func, int cap, u32 *order)
153
154
* On some sick chips, APSIZE is 0. It means it wants 4G
154
155
* so let double check that order, and lets trust AMD NB settings:
155
156
*/
156
- printk ( KERN_INFO "Aperture from AGP @ %Lx old size %u MB\n" ,
157
- aper , 32 << old_order );
157
+ pr_info ( "Aperture from AGP @ %Lx old size %u MB\n" ,
158
+ aper , 32 << old_order );
158
159
if (aper + (32ULL <<(20 + * order )) > 0x100000000ULL ) {
159
- printk ( KERN_INFO "Aperture size %u MB (APSIZE %x) is not right, using settings from NB\n" ,
160
- 32 << * order , apsizereg );
160
+ pr_info ( "Aperture size %u MB (APSIZE %x) is not right, using settings from NB\n" ,
161
+ 32 << * order , apsizereg );
161
162
* order = old_order ;
162
163
}
163
164
164
- printk ( KERN_INFO "Aperture from AGP @ %Lx size %u MB (APSIZE %x)\n" ,
165
- aper , 32 << * order , apsizereg );
165
+ pr_info ( "Aperture from AGP @ %Lx size %u MB (APSIZE %x)\n" , aper ,
166
+ 32 << * order , apsizereg );
166
167
167
168
if (!aperture_valid (aper , (32 * 1024 * 1024 ) << * order , 32 <<20 ))
168
169
return 0 ;
@@ -218,7 +219,7 @@ static u32 __init search_agp_bridge(u32 *order, int *valid_agp)
218
219
}
219
220
}
220
221
}
221
- printk ( KERN_INFO "No AGP bridge found\n" );
222
+ pr_info ( "No AGP bridge found\n" );
222
223
223
224
return 0 ;
224
225
}
@@ -310,7 +311,7 @@ void __init early_gart_iommu_check(void)
310
311
if (e820_any_mapped (aper_base , aper_base + aper_size ,
311
312
E820_RAM )) {
312
313
/* reserve it, so we can reuse it in second kernel */
313
- printk ( KERN_INFO "update e820 for GART\n" );
314
+ pr_info ( "update e820 for GART\n" );
314
315
e820_add_region (aper_base , aper_size , E820_RESERVED );
315
316
update_e820 ();
316
317
}
@@ -354,7 +355,7 @@ int __init gart_iommu_hole_init(void)
354
355
!early_pci_allowed ())
355
356
return - ENODEV ;
356
357
357
- printk ( KERN_INFO "Checking aperture...\n" );
358
+ pr_info ( "Checking aperture...\n" );
358
359
359
360
if (!fallback_aper_force )
360
361
agp_aper_base = search_agp_bridge (& agp_aper_order , & valid_agp );
@@ -395,8 +396,8 @@ int __init gart_iommu_hole_init(void)
395
396
aper_base = read_pci_config (bus , slot , 3 , AMD64_GARTAPERTUREBASE ) & 0x7fff ;
396
397
aper_base <<= 25 ;
397
398
398
- printk ( KERN_INFO "Node %d: aperture @ %Lx size %u MB\n" ,
399
- node , aper_base , aper_size >> 20 );
399
+ pr_info ( "Node %d: aperture @ %Lx size %u MB\n" ,
400
+ node , aper_base , aper_size >> 20 );
400
401
node ++ ;
401
402
402
403
if (!aperture_valid (aper_base , aper_size , 64 <<20 )) {
@@ -407,9 +408,9 @@ int __init gart_iommu_hole_init(void)
407
408
if (!no_iommu &&
408
409
max_pfn > MAX_DMA32_PFN &&
409
410
!printed_gart_size_msg ) {
410
- printk ( KERN_ERR "you are using iommu with agp, but GART size is less than 64M\n" );
411
- printk ( KERN_ERR "please increase GART size in your BIOS setup\n" );
412
- printk ( KERN_ERR "if BIOS doesn't have that option, contact your HW vendor!\n" );
411
+ pr_err ( "you are using iommu with agp, but GART size is less than 64M\n" );
412
+ pr_err ( "please increase GART size in your BIOS setup\n" );
413
+ pr_err ( "if BIOS doesn't have that option, contact your HW vendor!\n" );
413
414
printed_gart_size_msg = 1 ;
414
415
}
415
416
} else {
@@ -446,13 +447,10 @@ int __init gart_iommu_hole_init(void)
446
447
force_iommu ||
447
448
valid_agp ||
448
449
fallback_aper_force ) {
449
- printk (KERN_INFO
450
- "Your BIOS doesn't leave a aperture memory hole\n" );
451
- printk (KERN_INFO
452
- "Please enable the IOMMU option in the BIOS setup\n" );
453
- printk (KERN_INFO
454
- "This costs you %d MB of RAM\n" ,
455
- 32 << fallback_aper_order );
450
+ pr_info ("Your BIOS doesn't leave a aperture memory hole\n" );
451
+ pr_info ("Please enable the IOMMU option in the BIOS setup\n" );
452
+ pr_info ("This costs you %d MB of RAM\n" ,
453
+ 32 << fallback_aper_order );
456
454
457
455
aper_order = fallback_aper_order ;
458
456
aper_alloc = allocate_aperture ();
0 commit comments