centaur.c (17deb9c2db01c7813611291d251d8c7dbdfd3c9d) centaur.c (09dc68d958c67c76cf672ec78b7391af453010f8)
1#include <linux/bitops.h>
2#include <linux/kernel.h>
3#include <linux/init.h>
4
5#include <asm/processor.h>
6#include <asm/e820.h>
7#include <asm/mtrr.h>
8#include <asm/msr.h>

--- 454 unchanged lines hidden (view full) ---

463 init_c3(c);
464 break;
465 }
466#ifdef CONFIG_X86_64
467 set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC);
468#endif
469}
470
1#include <linux/bitops.h>
2#include <linux/kernel.h>
3#include <linux/init.h>
4
5#include <asm/processor.h>
6#include <asm/e820.h>
7#include <asm/mtrr.h>
8#include <asm/msr.h>

--- 454 unchanged lines hidden (view full) ---

463 init_c3(c);
464 break;
465 }
466#ifdef CONFIG_X86_64
467 set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC);
468#endif
469}
470
471#ifdef CONFIG_X86_32
471static unsigned int
472centaur_size_cache(struct cpuinfo_x86 *c, unsigned int size)
473{
472static unsigned int
473centaur_size_cache(struct cpuinfo_x86 *c, unsigned int size)
474{
474#ifdef CONFIG_X86_32
475 /* VIA C3 CPUs (670-68F) need further shifting. */
476 if ((c->x86 == 6) && ((c->x86_model == 7) || (c->x86_model == 8)))
477 size >>= 8;
478
479 /*
480 * There's also an erratum in Nehemiah stepping 1, which
481 * returns '65KB' instead of '64KB'
482 * - Note, it seems this may only be in engineering samples.
483 */
484 if ((c->x86 == 6) && (c->x86_model == 9) &&
485 (c->x86_mask == 1) && (size == 65))
486 size -= 1;
475 /* VIA C3 CPUs (670-68F) need further shifting. */
476 if ((c->x86 == 6) && ((c->x86_model == 7) || (c->x86_model == 8)))
477 size >>= 8;
478
479 /*
480 * There's also an erratum in Nehemiah stepping 1, which
481 * returns '65KB' instead of '64KB'
482 * - Note, it seems this may only be in engineering samples.
483 */
484 if ((c->x86 == 6) && (c->x86_model == 9) &&
485 (c->x86_mask == 1) && (size == 65))
486 size -= 1;
487#endif
488 return size;
489}
487 return size;
488}
489#endif
490
491static const struct cpu_dev centaur_cpu_dev = {
492 .c_vendor = "Centaur",
493 .c_ident = { "CentaurHauls" },
494 .c_early_init = early_init_centaur,
495 .c_init = init_centaur,
490
491static const struct cpu_dev centaur_cpu_dev = {
492 .c_vendor = "Centaur",
493 .c_ident = { "CentaurHauls" },
494 .c_early_init = early_init_centaur,
495 .c_init = init_centaur,
496 .c_size_cache = centaur_size_cache,
496#ifdef CONFIG_X86_32
497 .legacy_cache_size = centaur_size_cache,
498#endif
497 .c_x86_vendor = X86_VENDOR_CENTAUR,
498};
499
500cpu_dev_register(centaur_cpu_dev);
499 .c_x86_vendor = X86_VENDOR_CENTAUR,
500};
501
502cpu_dev_register(centaur_cpu_dev);