PATCH: Winchip support (2.3.12)

Jones D (djones2@glam.ac.uk)
Fri, 30 Jul 1999 09:04:01 +0100


This is diffed against 2.3.12
It increases the support for IDT Winchips.
o Enables use of CMPXCHG8B instruction
o Reports 3DNow! in /proc/cpuinfo for Winchip 2
o Replaced a large if/else with a switch.

(A patch against 2.2.10ac12 is in another mail)

regards,

d.

diff -urN linux.vanilla/CREDITS linux.dj/CREDITS
--- linux.vanilla/CREDITS Sun Jul 18 22:08:53 1999
+++ linux.dj/CREDITS Thu Jul 29 23:11:13 1999
@@ -998,6 +998,13 @@
S: DK-8230 Åbyhøj
S: Denmark

+N: Dave Jones
+E: dave@powertweak.com
+W: http://linux.powertweak.com
+D: Centaur/IDT Winchip/Winchip 2 tweaks
+D: Misc clean ups.
+S: (email for current address)
+
N: Andrzej M. Krzysztofowicz
E: ankry@mif.pg.gda.pl
D: XT disk driver
diff -urN linux.vanilla/arch/i386/kernel/setup.c
linux.dj/arch/i386/kernel/setup.c
--- linux.vanilla/arch/i386/kernel/setup.c Sun Jul 25 21:45:25 1999
+++ linux.dj/arch/i386/kernel/setup.c Thu Jul 29 23:11:13 1999
@@ -14,6 +14,9 @@
* Bart Hartgers <bart@etpmod.phys.tue.nl>, May 1999.
*
* Intel Mobile Pentium II detection fix. Sean Gilley, June 1999.
+ *
+ * IDT Winchip tweaks, misc clean ups.
+ * Dave Jones <dave@powertweak.com>, July 1999
*/

/*
@@ -824,7 +827,6 @@
p = "Celeron (Dixon)";
}
}
-
}

if (p) {
@@ -874,22 +876,25 @@
printk("%s", c->x86_model_id);

if (c->x86_mask || c->cpuid_level>=0)
- printk(" stepping %02x", c->x86_mask);
+ printk(" stepping %02x\n", c->x86_mask);

- if(c->x86_vendor == X86_VENDOR_CENTAUR)
- {
+ if(c->x86_vendor == X86_VENDOR_CENTAUR) {
u32 hv,lv;
rdmsr(0x107, lv, hv);
- printk("\nCentaur FSR was 0x%X ",lv);
- lv|=(1<<8);
- lv|=(1<<7);
+ printk("Centaur FSR was 0x%X ",lv);
+ lv|=(1<<1 | 1<<2 | 1<<7);
/* lv|=(1<<6); - may help too if the board can cope */
- printk("now 0x%X", lv);
+ printk("now 0x%X\n", lv);
wrmsr(0x107, lv, hv);
/* Emulate MTRRs using Centaur's MCR. */
- c->x86_capability |= X86_FEATURE_MTRR;
+ c->x86_capability |= X86_FEATURE_MTRR;
+
+ /* Set 3DNow! on Winchip 2 and above. */
+ if (c->x86_model >=8)
+ c->x86_capability |= X86_FEATURE_AMD3D;
+
+ c->x86_capability |= X86_FEATURE_CX8;
}
- printk("\n");
}

/*
@@ -924,7 +929,7 @@
c->x86 + '0',
c->x86_model,
c->x86_model_id[0] ? c->x86_model_id :
"unknown");
-
+
if (c->x86_mask || c->cpuid_level >= 0)
p += sprintf(p, "stepping\t: %d\n", c->x86_mask);
else
@@ -940,14 +945,20 @@
p += sprintf(p, "cache size\t: %d KB\n",
c->x86_cache_size);

/* Modify the capabilities according to chip type */
- if (c->x86_vendor == X86_VENDOR_CYRIX) {
+ switch (c->x86_vendor) {
+
+ case X86_VENDOR_CYRIX:
x86_cap_flags[24] = "cxmmx";
- } else if (c->x86_vendor == X86_VENDOR_AMD) {
- x86_cap_flags[16] = "fcmov";
- x86_cap_flags[31] = "3dnow";
+ break;
+
+ case X86_VENDOR_AMD:
if (c->x86 == 5 && c->x86_model == 6)
x86_cap_flags[10] = "sep";
- } else if (c->x86_vendor == X86_VENDOR_INTEL) {
+ x86_cap_flags[16] = "fcmov";
+ x86_cap_flags[31] = "3dnow";
+ break;
+
+ case X86_VENDOR_INTEL:
x86_cap_flags[6] = "pae";
x86_cap_flags[9] = "apic";
x86_cap_flags[14] = "mca";
@@ -955,6 +966,16 @@
x86_cap_flags[17] = "pse36";
x86_cap_flags[18] = "psn";
x86_cap_flags[24] = "osfxsr";
+ break;
+
+ case X86_VENDOR_CENTAUR:
+ if (c->x86_model >=8) /* Only Winchip2 and above
*/
+ x86_cap_flags[31] = "3dnow";
+ break;
+
+ default:
+ /* Unknown CPU manufacturer. Transmeta ? :-) */
+ break;
}

sep_bug = c->x86_vendor == X86_VENDOR_INTEL &&

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/