aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/amd.c
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2009-07-03 19:35:45 -0400
committerIngo Molnar <mingo@elte.hu>2009-07-11 05:24:09 -0400
commit8bdbd962ecfcbdd96f9dbb02d780b4553afd2543 (patch)
tree74c7c511e39febf981cdc90bd933c0d81130ccfa /arch/x86/kernel/cpu/amd.c
parente90476d3bab4322070c0afb3e3b55671de8664ea (diff)
x86/cpu: Clean up various files a bit
No code changes except printk levels (although some of the K6 mtrr code might be clearer if there were a few as would splitting out some of the intel cache code). Signed-off-by: Alan Cox <alan@linux.intel.com> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/cpu/amd.c')
-rw-r--r--arch/x86/kernel/cpu/amd.c37
1 files changed, 21 insertions, 16 deletions
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 28e5f5956042..c6eb02e69875 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -2,7 +2,7 @@
2#include <linux/bitops.h> 2#include <linux/bitops.h>
3#include <linux/mm.h> 3#include <linux/mm.h>
4 4
5#include <asm/io.h> 5#include <linux/io.h>
6#include <asm/processor.h> 6#include <asm/processor.h>
7#include <asm/apic.h> 7#include <asm/apic.h>
8#include <asm/cpu.h> 8#include <asm/cpu.h>
@@ -45,8 +45,8 @@ static void __cpuinit init_amd_k5(struct cpuinfo_x86 *c)
45#define CBAR_ENB (0x80000000) 45#define CBAR_ENB (0x80000000)
46#define CBAR_KEY (0X000000CB) 46#define CBAR_KEY (0X000000CB)
47 if (c->x86_model == 9 || c->x86_model == 10) { 47 if (c->x86_model == 9 || c->x86_model == 10) {
48 if (inl (CBAR) & CBAR_ENB) 48 if (inl(CBAR) & CBAR_ENB)
49 outl (0 | CBAR_KEY, CBAR); 49 outl(0 | CBAR_KEY, CBAR);
50 } 50 }
51} 51}
52 52
@@ -87,9 +87,10 @@ static void __cpuinit init_amd_k6(struct cpuinfo_x86 *c)
87 d = d2-d; 87 d = d2-d;
88 88
89 if (d > 20*K6_BUG_LOOP) 89 if (d > 20*K6_BUG_LOOP)
90 printk("system stability may be impaired when more than 32 MB are used.\n"); 90 printk(KERN_CONT
91 "system stability may be impaired when more than 32 MB are used.\n");
91 else 92 else
92 printk("probably OK (after B9730xxxx).\n"); 93 printk(KERN_CONT "probably OK (after B9730xxxx).\n");
93 printk(KERN_INFO "Please see http://membres.lycos.fr/poulot/k6bug.html\n"); 94 printk(KERN_INFO "Please see http://membres.lycos.fr/poulot/k6bug.html\n");
94 } 95 }
95 96
@@ -219,8 +220,9 @@ static void __cpuinit init_amd_k7(struct cpuinfo_x86 *c)
219 if ((c->x86_model == 8 && c->x86_mask >= 1) || (c->x86_model > 8)) { 220 if ((c->x86_model == 8 && c->x86_mask >= 1) || (c->x86_model > 8)) {
220 rdmsr(MSR_K7_CLK_CTL, l, h); 221 rdmsr(MSR_K7_CLK_CTL, l, h);
221 if ((l & 0xfff00000) != 0x20000000) { 222 if ((l & 0xfff00000) != 0x20000000) {
222 printk ("CPU: CLK_CTL MSR was %x. Reprogramming to %x\n", l, 223 printk(KERN_INFO
223 ((l & 0x000fffff)|0x20000000)); 224 "CPU: CLK_CTL MSR was %x. Reprogramming to %x\n",
225 l, ((l & 0x000fffff)|0x20000000));
224 wrmsr(MSR_K7_CLK_CTL, (l & 0x000fffff)|0x20000000, h); 226 wrmsr(MSR_K7_CLK_CTL, (l & 0x000fffff)|0x20000000, h);
225 } 227 }
226 } 228 }
@@ -398,7 +400,7 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
398 u32 level; 400 u32 level;
399 401
400 level = cpuid_eax(1); 402 level = cpuid_eax(1);
401 if((level >= 0x0f48 && level < 0x0f50) || level >= 0x0f58) 403 if ((level >= 0x0f48 && level < 0x0f50) || level >= 0x0f58)
402 set_cpu_cap(c, X86_FEATURE_REP_GOOD); 404 set_cpu_cap(c, X86_FEATURE_REP_GOOD);
403 } 405 }
404 if (c->x86 == 0x10 || c->x86 == 0x11) 406 if (c->x86 == 0x10 || c->x86 == 0x11)
@@ -487,27 +489,30 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
487 * benefit in doing so. 489 * benefit in doing so.
488 */ 490 */
489 if (!rdmsrl_safe(MSR_K8_TSEG_ADDR, &tseg)) { 491 if (!rdmsrl_safe(MSR_K8_TSEG_ADDR, &tseg)) {
490 printk(KERN_DEBUG "tseg: %010llx\n", tseg); 492 printk(KERN_DEBUG "tseg: %010llx\n", tseg);
491 if ((tseg>>PMD_SHIFT) < 493 if ((tseg>>PMD_SHIFT) <
492 (max_low_pfn_mapped>>(PMD_SHIFT-PAGE_SHIFT)) || 494 (max_low_pfn_mapped>>(PMD_SHIFT-PAGE_SHIFT)) ||
493 ((tseg>>PMD_SHIFT) < 495 ((tseg>>PMD_SHIFT) <
494 (max_pfn_mapped>>(PMD_SHIFT-PAGE_SHIFT)) && 496 (max_pfn_mapped>>(PMD_SHIFT-PAGE_SHIFT)) &&
495 (tseg>>PMD_SHIFT) >= (1ULL<<(32 - PMD_SHIFT)))) 497 (tseg>>PMD_SHIFT) >= (1ULL<<(32 - PMD_SHIFT))))
496 set_memory_4k((unsigned long)__va(tseg), 1); 498 set_memory_4k((unsigned long)__va(tseg), 1);
497 } 499 }
498 } 500 }
499#endif 501#endif
500} 502}
501 503
502#ifdef CONFIG_X86_32 504#ifdef CONFIG_X86_32
503static unsigned int __cpuinit amd_size_cache(struct cpuinfo_x86 *c, unsigned int size) 505static unsigned int __cpuinit amd_size_cache(struct cpuinfo_x86 *c,
506 unsigned int size)
504{ 507{
505 /* AMD errata T13 (order #21922) */ 508 /* AMD errata T13 (order #21922) */
506 if ((c->x86 == 6)) { 509 if ((c->x86 == 6)) {
507 if (c->x86_model == 3 && c->x86_mask == 0) /* Duron Rev A0 */ 510 /* Duron Rev A0 */
511 if (c->x86_model == 3 && c->x86_mask == 0)
508 size = 64; 512 size = 64;
513 /* Tbird rev A1/A2 */
509 if (c->x86_model == 4 && 514 if (c->x86_model == 4 &&
510 (c->x86_mask == 0 || c->x86_mask == 1)) /* Tbird rev A1/A2 */ 515 (c->x86_mask == 0 || c->x86_mask == 1))
511 size = 256; 516 size = 256;
512 } 517 }
513 return size; 518 return size;