diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2014-04-14 17:29:19 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2014-05-23 12:47:19 -0400 |
commit | c96ec95315b9242ec423b8348984c394d27a8135 (patch) | |
tree | 7bd9abb5e7df6b0eabfd1a031a11ca9651226240 | |
parent | a5d3244a0b1c16963fd7ceadf76da843df27c3c5 (diff) |
x86/gart: Tidy messages and add bridge device info
Print the AGP bridge info the same way as the rest of the kernel, e.g.,
"0000:00:04.0" instead of "00:04:00".
Also print the AGP aperture address range the same way we print resources,
and label it explicitly as a bus address range.
No functional change except the message changes.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-rw-r--r-- | arch/x86/kernel/aperture_64.c | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c index b11edf2b656d..76164e173a24 100644 --- a/arch/x86/kernel/aperture_64.c +++ b/arch/x86/kernel/aperture_64.c | |||
@@ -77,13 +77,13 @@ static u32 __init allocate_aperture(void) | |||
77 | addr = memblock_find_in_range(GART_MIN_ADDR, GART_MAX_ADDR, | 77 | addr = memblock_find_in_range(GART_MIN_ADDR, GART_MAX_ADDR, |
78 | aper_size, aper_size); | 78 | aper_size, aper_size); |
79 | if (!addr) { | 79 | if (!addr) { |
80 | pr_err("Cannot allocate aperture memory hole (%lx,%uK)\n", | 80 | pr_err("Cannot allocate aperture memory hole [mem %#010lx-%#010lx] (%uKB)\n", |
81 | addr, aper_size>>10); | 81 | addr, addr + aper_size - 1, aper_size >> 10); |
82 | return 0; | 82 | return 0; |
83 | } | 83 | } |
84 | memblock_reserve(addr, aper_size); | 84 | memblock_reserve(addr, aper_size); |
85 | pr_info("Mapping aperture over %d KB of RAM @ %lx\n", aper_size >> 10, | 85 | pr_info("Mapping aperture over RAM [mem %#010lx-%#010lx] (%uKB)\n", |
86 | addr); | 86 | addr, addr + aper_size - 1, aper_size >> 10); |
87 | register_nosave_region(addr >> PAGE_SHIFT, | 87 | register_nosave_region(addr >> PAGE_SHIFT, |
88 | (addr+aper_size) >> PAGE_SHIFT); | 88 | (addr+aper_size) >> PAGE_SHIFT); |
89 | 89 | ||
@@ -127,10 +127,11 @@ static u32 __init read_agp(int bus, int slot, int func, int cap, u32 *order) | |||
127 | u64 aper; | 127 | u64 aper; |
128 | u32 old_order; | 128 | u32 old_order; |
129 | 129 | ||
130 | pr_info("AGP bridge at %02x:%02x:%02x\n", bus, slot, func); | 130 | pr_info("pci 0000:%02x:%02x:%02x: AGP bridge\n", bus, slot, func); |
131 | apsizereg = read_pci_config_16(bus, slot, func, cap + 0x14); | 131 | apsizereg = read_pci_config_16(bus, slot, func, cap + 0x14); |
132 | if (apsizereg == 0xffffffff) { | 132 | if (apsizereg == 0xffffffff) { |
133 | pr_err("APSIZE in AGP bridge unreadable\n"); | 133 | pr_err("pci 0000:%02x:%02x.%d: APSIZE unreadable\n", |
134 | bus, slot, func); | ||
134 | return 0; | 135 | return 0; |
135 | } | 136 | } |
136 | 137 | ||
@@ -154,15 +155,17 @@ static u32 __init read_agp(int bus, int slot, int func, int cap, u32 *order) | |||
154 | * On some sick chips, APSIZE is 0. It means it wants 4G | 155 | * On some sick chips, APSIZE is 0. It means it wants 4G |
155 | * so let double check that order, and lets trust AMD NB settings: | 156 | * so let double check that order, and lets trust AMD NB settings: |
156 | */ | 157 | */ |
157 | pr_info("Aperture from AGP @ %Lx old size %u MB\n", | 158 | pr_info("pci 0000:%02x:%02x.%d: AGP aperture [bus addr %#010Lx-%#010Lx] (old size %uMB)\n", |
158 | aper, 32 << old_order); | 159 | bus, slot, func, aper, aper + (32ULL << (old_order + 20)) - 1, |
160 | 32 << old_order); | ||
159 | if (aper + (32ULL<<(20 + *order)) > 0x100000000ULL) { | 161 | if (aper + (32ULL<<(20 + *order)) > 0x100000000ULL) { |
160 | pr_info("Aperture size %u MB (APSIZE %x) is not right, using settings from NB\n", | 162 | pr_info("pci 0000:%02x:%02x.%d: AGP aperture size %uMB (APSIZE %#x) is not right, using settings from NB\n", |
161 | 32 << *order, apsizereg); | 163 | bus, slot, func, 32 << *order, apsizereg); |
162 | *order = old_order; | 164 | *order = old_order; |
163 | } | 165 | } |
164 | 166 | ||
165 | pr_info("Aperture from AGP @ %Lx size %u MB (APSIZE %x)\n", aper, | 167 | pr_info("pci 0000:%02x:%02x.%d: AGP aperture [bus addr %#010Lx-%#010Lx] (%uMB, APSIZE %#x)\n", |
168 | bus, slot, func, aper, aper + (32ULL << (*order + 20)) - 1, | ||
166 | 32 << *order, apsizereg); | 169 | 32 << *order, apsizereg); |
167 | 170 | ||
168 | if (!aperture_valid(aper, (32*1024*1024) << *order, 32<<20)) | 171 | if (!aperture_valid(aper, (32*1024*1024) << *order, 32<<20)) |
@@ -311,7 +314,8 @@ void __init early_gart_iommu_check(void) | |||
311 | if (e820_any_mapped(aper_base, aper_base + aper_size, | 314 | if (e820_any_mapped(aper_base, aper_base + aper_size, |
312 | E820_RAM)) { | 315 | E820_RAM)) { |
313 | /* reserve it, so we can reuse it in second kernel */ | 316 | /* reserve it, so we can reuse it in second kernel */ |
314 | pr_info("update e820 for GART\n"); | 317 | pr_info("e820: reserve [mem %#010Lx-%#010Lx] for GART\n", |
318 | aper_base, aper_base + aper_size - 1); | ||
315 | e820_add_region(aper_base, aper_size, E820_RESERVED); | 319 | e820_add_region(aper_base, aper_size, E820_RESERVED); |
316 | update_e820(); | 320 | update_e820(); |
317 | } | 321 | } |
@@ -396,8 +400,9 @@ int __init gart_iommu_hole_init(void) | |||
396 | aper_base = read_pci_config(bus, slot, 3, AMD64_GARTAPERTUREBASE) & 0x7fff; | 400 | aper_base = read_pci_config(bus, slot, 3, AMD64_GARTAPERTUREBASE) & 0x7fff; |
397 | aper_base <<= 25; | 401 | aper_base <<= 25; |
398 | 402 | ||
399 | pr_info("Node %d: aperture @ %Lx size %u MB\n", | 403 | pr_info("Node %d: aperture [bus addr %#010Lx-%#010Lx] (%uMB)\n", |
400 | node, aper_base, aper_size >> 20); | 404 | node, aper_base, aper_base + aper_size - 1, |
405 | aper_size >> 20); | ||
401 | node++; | 406 | node++; |
402 | 407 | ||
403 | if (!aperture_valid(aper_base, aper_size, 64<<20)) { | 408 | if (!aperture_valid(aper_base, aper_size, 64<<20)) { |
@@ -408,7 +413,7 @@ int __init gart_iommu_hole_init(void) | |||
408 | if (!no_iommu && | 413 | if (!no_iommu && |
409 | max_pfn > MAX_DMA32_PFN && | 414 | max_pfn > MAX_DMA32_PFN && |
410 | !printed_gart_size_msg) { | 415 | !printed_gart_size_msg) { |
411 | pr_err("you are using iommu with agp, but GART size is less than 64M\n"); | 416 | pr_err("you are using iommu with agp, but GART size is less than 64MB\n"); |
412 | pr_err("please increase GART size in your BIOS setup\n"); | 417 | 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"); | 418 | pr_err("if BIOS doesn't have that option, contact your HW vendor!\n"); |
414 | printed_gart_size_msg = 1; | 419 | printed_gart_size_msg = 1; |
@@ -449,7 +454,7 @@ out: | |||
449 | fallback_aper_force) { | 454 | fallback_aper_force) { |
450 | pr_info("Your BIOS doesn't leave a aperture memory hole\n"); | 455 | 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"); | 456 | pr_info("Please enable the IOMMU option in the BIOS setup\n"); |
452 | pr_info("This costs you %d MB of RAM\n", | 457 | pr_info("This costs you %dMB of RAM\n", |
453 | 32 << fallback_aper_order); | 458 | 32 << fallback_aper_order); |
454 | 459 | ||
455 | aper_order = fallback_aper_order; | 460 | aper_order = fallback_aper_order; |