diff options
Diffstat (limited to 'arch/x86/kernel/cpu/centaur.c')
-rw-r--r-- | arch/x86/kernel/cpu/centaur.c | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/arch/x86/kernel/cpu/centaur.c b/arch/x86/kernel/cpu/centaur.c index 983e0830f0da..c95e831bb095 100644 --- a/arch/x86/kernel/cpu/centaur.c +++ b/arch/x86/kernel/cpu/centaur.c | |||
@@ -1,11 +1,11 @@ | |||
1 | #include <linux/bitops.h> | ||
1 | #include <linux/kernel.h> | 2 | #include <linux/kernel.h> |
2 | #include <linux/init.h> | 3 | #include <linux/init.h> |
3 | #include <linux/bitops.h> | ||
4 | 4 | ||
5 | #include <asm/processor.h> | 5 | #include <asm/processor.h> |
6 | #include <asm/msr.h> | ||
7 | #include <asm/e820.h> | 6 | #include <asm/e820.h> |
8 | #include <asm/mtrr.h> | 7 | #include <asm/mtrr.h> |
8 | #include <asm/msr.h> | ||
9 | 9 | ||
10 | #include "cpu.h" | 10 | #include "cpu.h" |
11 | 11 | ||
@@ -276,7 +276,7 @@ static void __cpuinit init_c3(struct cpuinfo_x86 *c) | |||
276 | */ | 276 | */ |
277 | c->x86_capability[5] = cpuid_edx(0xC0000001); | 277 | c->x86_capability[5] = cpuid_edx(0xC0000001); |
278 | } | 278 | } |
279 | 279 | #ifdef CONFIG_X86_32 | |
280 | /* Cyrix III family needs CX8 & PGE explicitly enabled. */ | 280 | /* Cyrix III family needs CX8 & PGE explicitly enabled. */ |
281 | if (c->x86_model >= 6 && c->x86_model <= 9) { | 281 | if (c->x86_model >= 6 && c->x86_model <= 9) { |
282 | rdmsr(MSR_VIA_FCR, lo, hi); | 282 | rdmsr(MSR_VIA_FCR, lo, hi); |
@@ -288,6 +288,11 @@ static void __cpuinit init_c3(struct cpuinfo_x86 *c) | |||
288 | /* Before Nehemiah, the C3's had 3dNOW! */ | 288 | /* Before Nehemiah, the C3's had 3dNOW! */ |
289 | if (c->x86_model >= 6 && c->x86_model < 9) | 289 | if (c->x86_model >= 6 && c->x86_model < 9) |
290 | set_cpu_cap(c, X86_FEATURE_3DNOW); | 290 | set_cpu_cap(c, X86_FEATURE_3DNOW); |
291 | #endif | ||
292 | if (c->x86 == 0x6 && c->x86_model >= 0xf) { | ||
293 | c->x86_cache_alignment = c->x86_clflush_size * 2; | ||
294 | set_cpu_cap(c, X86_FEATURE_REP_GOOD); | ||
295 | } | ||
291 | 296 | ||
292 | display_cacheinfo(c); | 297 | display_cacheinfo(c); |
293 | } | 298 | } |
@@ -316,16 +321,25 @@ enum { | |||
316 | static void __cpuinit early_init_centaur(struct cpuinfo_x86 *c) | 321 | static void __cpuinit early_init_centaur(struct cpuinfo_x86 *c) |
317 | { | 322 | { |
318 | switch (c->x86) { | 323 | switch (c->x86) { |
324 | #ifdef CONFIG_X86_32 | ||
319 | case 5: | 325 | case 5: |
320 | /* Emulate MTRRs using Centaur's MCR. */ | 326 | /* Emulate MTRRs using Centaur's MCR. */ |
321 | set_cpu_cap(c, X86_FEATURE_CENTAUR_MCR); | 327 | set_cpu_cap(c, X86_FEATURE_CENTAUR_MCR); |
322 | break; | 328 | break; |
329 | #endif | ||
330 | case 6: | ||
331 | if (c->x86_model >= 0xf) | ||
332 | set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC); | ||
333 | break; | ||
323 | } | 334 | } |
335 | #ifdef CONFIG_X86_64 | ||
336 | set_cpu_cap(c, X86_FEATURE_SYSENTER32); | ||
337 | #endif | ||
324 | } | 338 | } |
325 | 339 | ||
326 | static void __cpuinit init_centaur(struct cpuinfo_x86 *c) | 340 | static void __cpuinit init_centaur(struct cpuinfo_x86 *c) |
327 | { | 341 | { |
328 | 342 | #ifdef CONFIG_X86_32 | |
329 | char *name; | 343 | char *name; |
330 | u32 fcr_set = 0; | 344 | u32 fcr_set = 0; |
331 | u32 fcr_clr = 0; | 345 | u32 fcr_clr = 0; |
@@ -337,8 +351,10 @@ static void __cpuinit init_centaur(struct cpuinfo_x86 *c) | |||
337 | * 3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway | 351 | * 3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway |
338 | */ | 352 | */ |
339 | clear_cpu_cap(c, 0*32+31); | 353 | clear_cpu_cap(c, 0*32+31); |
340 | 354 | #endif | |
355 | early_init_centaur(c); | ||
341 | switch (c->x86) { | 356 | switch (c->x86) { |
357 | #ifdef CONFIG_X86_32 | ||
342 | case 5: | 358 | case 5: |
343 | switch (c->x86_model) { | 359 | switch (c->x86_model) { |
344 | case 4: | 360 | case 4: |
@@ -442,16 +458,20 @@ static void __cpuinit init_centaur(struct cpuinfo_x86 *c) | |||
442 | } | 458 | } |
443 | sprintf(c->x86_model_id, "WinChip %s", name); | 459 | sprintf(c->x86_model_id, "WinChip %s", name); |
444 | break; | 460 | break; |
445 | 461 | #endif | |
446 | case 6: | 462 | case 6: |
447 | init_c3(c); | 463 | init_c3(c); |
448 | break; | 464 | break; |
449 | } | 465 | } |
466 | #ifdef CONFIG_X86_64 | ||
467 | set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC); | ||
468 | #endif | ||
450 | } | 469 | } |
451 | 470 | ||
452 | static unsigned int __cpuinit | 471 | static unsigned int __cpuinit |
453 | centaur_size_cache(struct cpuinfo_x86 *c, unsigned int size) | 472 | centaur_size_cache(struct cpuinfo_x86 *c, unsigned int size) |
454 | { | 473 | { |
474 | #ifdef CONFIG_X86_32 | ||
455 | /* VIA C3 CPUs (670-68F) need further shifting. */ | 475 | /* VIA C3 CPUs (670-68F) need further shifting. */ |
456 | if ((c->x86 == 6) && ((c->x86_model == 7) || (c->x86_model == 8))) | 476 | if ((c->x86 == 6) && ((c->x86_model == 7) || (c->x86_model == 8))) |
457 | size >>= 8; | 477 | size >>= 8; |
@@ -464,7 +484,7 @@ centaur_size_cache(struct cpuinfo_x86 *c, unsigned int size) | |||
464 | if ((c->x86 == 6) && (c->x86_model == 9) && | 484 | if ((c->x86 == 6) && (c->x86_model == 9) && |
465 | (c->x86_mask == 1) && (size == 65)) | 485 | (c->x86_mask == 1) && (size == 65)) |
466 | size -= 1; | 486 | size -= 1; |
467 | 487 | #endif | |
468 | return size; | 488 | return size; |
469 | } | 489 | } |
470 | 490 | ||