1 #include <linux/bitops.h>
2 #include <linux/kernel.h>
5 #include <asm/processor.h>
12 #ifdef CONFIG_X86_OOSTORE
47 u32 clip = 0xFFFFFFFF
UL;
51 for (i = 0; i <
e820.nr_map; i++) {
54 if (
e820.map[i].addr > 0xFFFFFFFFUL)
61 if (
e820.map[i].addr >= 0x100000UL &&
62 e820.map[i].addr < clip)
63 clip =
e820.map[
i].addr;
66 start =
e820.map[
i].addr;
111 high = power2(mem-top);
122 if (base <= 1024*1024)
132 else if (floor == 512*1024)
140 if (fspace > high && fspace > low) {
141 centaur_mcr_insert(ct, floor, fspace, key);
143 }
else if (high > low) {
144 centaur_mcr_insert(ct, top, high, key);
146 }
else if (low > 0) {
148 centaur_mcr_insert(ct, base, low, key);
160 static void __cpuinit centaur_create_optimal_mcr(
void)
175 used = centaur_mcr_compute(6, 31);
180 for (i = used; i < 8; i++)
184 static void __cpuinit winchip2_create_optimal_mcr(
void)
199 used = centaur_mcr_compute(6, 25);
205 for (i = 0; i <
used; i++)
213 for (i = used; i < 8; i++)
220 static void __cpuinit winchip2_unprotect_mcr(
void)
232 static void __cpuinit winchip2_protect_mcr(
void)
242 #define ACE_PRESENT (1 << 6)
243 #define ACE_ENABLED (1 << 7)
244 #define ACE_FCR (1 << 28)
246 #define RNG_PRESENT (1 << 2)
247 #define RNG_ENABLED (1 << 3)
248 #define RNG_ENABLE (1 << 6)
255 if (cpuid_eax(0xC0000000) >= 0xC0000001) {
256 u32 tmp = cpuid_edx(0xC0000001);
353 clear_cpu_cap(c, 0*32+31);
355 early_init_centaur(c);
366 #ifdef CONFIG_X86_OOSTORE
367 centaur_create_optimal_mcr();
396 #ifdef CONFIG_X86_OOSTORE
397 winchip2_unprotect_mcr();
398 winchip2_create_optimal_mcr();
408 winchip2_protect_mcr();
416 #ifdef CONFIG_X86_OOSTORE
417 winchip2_unprotect_mcr();
418 winchip2_create_optimal_mcr();
428 winchip2_protect_mcr();
436 newlo = (lo|fcr_set) & (~fcr_clr);
453 if (cpuid_eax(0x80000000) >= 0x80000005) {
455 cpuid(0x80000005, &aa, &bb, &cc, &dd);
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,