ia64/xen-unstable

view xen/arch/x86/cpu/centaur.c @ 19835:edfdeb150f27

Fix buildsystem to detect udev > version 124

udev removed the udevinfo symlink from versions higher than 123 and
xen's build-system could not detect if udev is in place and has the
required version.

Signed-off-by: Marc-A. Dahlhaus <mad@wol.de>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 25 13:02:37 2009 +0100 (2009-06-25)
parents 79053138b35c
children
line source
1 #include <xen/config.h>
2 #include <xen/lib.h>
3 #include <xen/init.h>
4 #include <xen/bitops.h>
5 #include <asm/processor.h>
6 #include <asm/msr.h>
7 #include <asm/e820.h>
8 #include "cpu.h"
10 #define ACE_PRESENT (1 << 6)
11 #define ACE_ENABLED (1 << 7)
12 #define ACE_FCR (1 << 28) /* MSR_VIA_FCR */
14 #define RNG_PRESENT (1 << 2)
15 #define RNG_ENABLED (1 << 3)
16 #define RNG_ENABLE (1 << 6) /* MSR_VIA_RNG */
18 static void __init init_c3(struct cpuinfo_x86 *c)
19 {
20 u32 lo, hi;
22 /* Test for Centaur Extended Feature Flags presence */
23 if (cpuid_eax(0xC0000000) >= 0xC0000001) {
24 u32 tmp = cpuid_edx(0xC0000001);
26 /* enable ACE unit, if present and disabled */
27 if ((tmp & (ACE_PRESENT | ACE_ENABLED)) == ACE_PRESENT) {
28 rdmsr (MSR_VIA_FCR, lo, hi);
29 lo |= ACE_FCR; /* enable ACE unit */
30 wrmsr (MSR_VIA_FCR, lo, hi);
31 printk(KERN_INFO "CPU: Enabled ACE h/w crypto\n");
32 }
34 /* enable RNG unit, if present and disabled */
35 if ((tmp & (RNG_PRESENT | RNG_ENABLED)) == RNG_PRESENT) {
36 rdmsr (MSR_VIA_RNG, lo, hi);
37 lo |= RNG_ENABLE; /* enable RNG unit */
38 wrmsr (MSR_VIA_RNG, lo, hi);
39 printk(KERN_INFO "CPU: Enabled h/w RNG\n");
40 }
42 /* store Centaur Extended Feature Flags as
43 * word 5 of the CPU capability bit array
44 */
45 c->x86_capability[5] = cpuid_edx(0xC0000001);
46 }
48 /* Cyrix III family needs CX8 & PGE explicity enabled. */
49 if (c->x86_model >=6 && c->x86_model <= 9) {
50 rdmsr (MSR_VIA_FCR, lo, hi);
51 lo |= (1<<1 | 1<<7);
52 wrmsr (MSR_VIA_FCR, lo, hi);
53 set_bit(X86_FEATURE_CX8, c->x86_capability);
54 }
56 /* Before Nehemiah, the C3's had 3dNOW! */
57 if (c->x86_model >=6 && c->x86_model <9)
58 set_bit(X86_FEATURE_3DNOW, c->x86_capability);
60 get_model_name(c);
61 display_cacheinfo(c);
62 }
64 static void __init init_centaur(struct cpuinfo_x86 *c)
65 {
66 /* Bit 31 in normal CPUID used for nonstandard 3DNow ID;
67 3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway */
68 clear_bit(0*32+31, c->x86_capability);
70 if (c->x86 == 6)
71 init_c3(c);
72 }
74 static unsigned int centaur_size_cache(struct cpuinfo_x86 * c, unsigned int size)
75 {
76 /* VIA C3 CPUs (670-68F) need further shifting. */
77 if ((c->x86 == 6) && ((c->x86_model == 7) || (c->x86_model == 8)))
78 size >>= 8;
80 /* VIA also screwed up Nehemiah stepping 1, and made
81 it return '65KB' instead of '64KB'
82 - Note, it seems this may only be in engineering samples. */
83 if ((c->x86==6) && (c->x86_model==9) && (c->x86_mask==1) && (size==65))
84 size -=1;
86 return size;
87 }
89 static struct cpu_dev centaur_cpu_dev __initdata = {
90 .c_vendor = "Centaur",
91 .c_ident = { "CentaurHauls" },
92 .c_init = init_centaur,
93 .c_size_cache = centaur_size_cache,
94 };
96 int __init centaur_init_cpu(void)
97 {
98 cpu_devs[X86_VENDOR_CENTAUR] = &centaur_cpu_dev;
99 return 0;
100 }
102 //early_arch_initcall(centaur_init_cpu);