aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/include/asm/amd_nb.h11
-rw-r--r--arch/x86/kernel/amd_nb.c4
-rw-r--r--arch/x86/kernel/aperture_64.c8
3 files changed, 19 insertions, 4 deletions
diff --git a/arch/x86/include/asm/amd_nb.h b/arch/x86/include/asm/amd_nb.h
index aaac3b2fb746..1a5da2e63aee 100644
--- a/arch/x86/include/asm/amd_nb.h
+++ b/arch/x86/include/asm/amd_nb.h
@@ -98,11 +98,22 @@ static inline u16 amd_get_node_id(struct pci_dev *pdev)
98 return 0; 98 return 0;
99} 99}
100 100
101static inline bool amd_gart_present(void)
102{
103 /* GART present only on Fam15h, upto model 0fh */
104 if (boot_cpu_data.x86 == 0xf || boot_cpu_data.x86 == 0x10 ||
105 (boot_cpu_data.x86 == 0x15 && boot_cpu_data.x86_model < 0x10))
106 return true;
107
108 return false;
109}
110
101#else 111#else
102 112
103#define amd_nb_num(x) 0 113#define amd_nb_num(x) 0
104#define amd_nb_has_feature(x) false 114#define amd_nb_has_feature(x) false
105#define node_to_amd_nb(x) NULL 115#define node_to_amd_nb(x) NULL
116#define amd_gart_present(x) false
106 117
107#endif 118#endif
108 119
diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c
index 5caed1dd7ccf..29fa475ec518 100644
--- a/arch/x86/kernel/amd_nb.c
+++ b/arch/x86/kernel/amd_nb.c
@@ -89,9 +89,7 @@ int amd_cache_northbridges(void)
89 next_northbridge(link, amd_nb_link_ids); 89 next_northbridge(link, amd_nb_link_ids);
90 } 90 }
91 91
92 /* GART present only on Fam15h upto model 0fh */ 92 if (amd_gart_present())
93 if (boot_cpu_data.x86 == 0xf || boot_cpu_data.x86 == 0x10 ||
94 (boot_cpu_data.x86 == 0x15 && boot_cpu_data.x86_model < 0x10))
95 amd_northbridges.flags |= AMD_NB_GART; 93 amd_northbridges.flags |= AMD_NB_GART;
96 94
97 /* 95 /*
diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c
index 76164e173a24..6e85f713641d 100644
--- a/arch/x86/kernel/aperture_64.c
+++ b/arch/x86/kernel/aperture_64.c
@@ -262,6 +262,9 @@ void __init early_gart_iommu_check(void)
262 u64 aper_base = 0, last_aper_base = 0; 262 u64 aper_base = 0, last_aper_base = 0;
263 int aper_enabled = 0, last_aper_enabled = 0, last_valid = 0; 263 int aper_enabled = 0, last_aper_enabled = 0, last_valid = 0;
264 264
265 if (!amd_gart_present())
266 return;
267
265 if (!early_pci_allowed()) 268 if (!early_pci_allowed())
266 return; 269 return;
267 270
@@ -355,6 +358,9 @@ int __init gart_iommu_hole_init(void)
355 int fix, slot, valid_agp = 0; 358 int fix, slot, valid_agp = 0;
356 int i, node; 359 int i, node;
357 360
361 if (!amd_gart_present())
362 return -ENODEV;
363
358 if (gart_iommu_aperture_disabled || !fix_aperture || 364 if (gart_iommu_aperture_disabled || !fix_aperture ||
359 !early_pci_allowed()) 365 !early_pci_allowed())
360 return -ENODEV; 366 return -ENODEV;
@@ -452,7 +458,7 @@ out:
452 force_iommu || 458 force_iommu ||
453 valid_agp || 459 valid_agp ||
454 fallback_aper_force) { 460 fallback_aper_force) {
455 pr_info("Your BIOS doesn't leave a aperture memory hole\n"); 461 pr_info("Your BIOS doesn't leave an aperture memory hole\n");
456 pr_info("Please enable the IOMMU option in the BIOS setup\n"); 462 pr_info("Please enable the IOMMU option in the BIOS setup\n");
457 pr_info("This costs you %dMB of RAM\n", 463 pr_info("This costs you %dMB of RAM\n",
458 32 << fallback_aper_order); 464 32 << fallback_aper_order);