Skip to contentSkip to conversation

Coppermine is a PIII or a Celeron? WINCHIP2/WINCHIP3D diff?

PATCH Giacomo A. Catenazzi 5 participants 5 messages Jan 2, 2001 – Jan 3, 2001 Kbuild

lore
Share & tools
lore
#0 lore raw

Hello!

When working in cpu autoconfiguration I found some problems:

I have to identify this processor:
Vendor: Intel
Family: 6
Model: 8
Is it a "Pentium III (Coppermine)" (setup.c:1709)
or a "Celeron (Coppermine)" (setup.c:1650) ?

What is the difference between MWINCHIP2 and MWINCHIP3D? I don't find differences in the sources

giacomo

Version 3 of my cpu detection and configuration:

CREDITS +6 -0
diff -uNr old.linux/CREDITS linux/CREDITS
@@ -458,6 +458,12 @@
 S: Fremont, California 94539
 S: USA
 
+N: Giacomo Catenazzi
+E: [email protected]
+D: Random kernel hack and fixes
+D: Author of scripts/cpu_detect.sh
+S: Switzerland
+
 N: Gordon Chaffee
 E: [email protected]
 W: http://bmrc.berkeley.edu/people/chaffee/
Makefile +10 -0
diff -uNr old.linux/Makefile linux/Makefile
@@ -65,6 +65,16 @@
 do-it-all:	config
 endif
 
+# Second stage configuration
+# Note that GNU make will read again this Makefile, so the CONFIG are
+# updated
+ifeq ($(CONFIG_CPU_CURRENT), y)
+CONFIGURATION = config2
+do-it-all:      config2
+.config:        config2
+	@echo "Rescanning the main Makefile"
+endif
+
 #
 # INSTALL_PATH specifies where to place the updated kernel and system

map

 # images.  Uncomment if you want to place them anywhere other than
root.
@@ -273,6 +283,14 @@

config: symlinks
$(CONFIG_SHELL) scripts/Configure arch/$(ARCH)/config.in
+
+config2:
+ echo "CONFIG_CPU_CURRENT=n" >> .config
+ echo $(CONFIG_SHELL) $(TOPDIR)/scripts/cpu_detect.sh=y >> .config
+ $(MAKE) oldconfig
+
+config2.test:
+ echo "CONFIG_CPU_CURRENT=$(CONFIG_CPU_CURRENT)"

include/config/MARKER: scripts/split-include include/linux/autoconf.h
scripts/split-include include/linux/autoconf.h include/config

arch/i386/config.in +7 -1
diff -uNr old.linux/arch/i386/config.in linux/arch/i386/config.in
@@ -26,7 +26,9 @@
 
 mainmenu_option next_comment
 comment 'Processor type and features'
-choice 'Processor family' \
+bool "Optimize for current CPU" CONFIG_CPU_CURRENT
+if [ "$CONFIG_CPU_CURRENT" != "y" ]; then
+   choice 'Processor family' \
 	"386				CONFIG_M386 \
 	 486				CONFIG_M486 \
 	 586/K5/5x86/6x86/6x86MX	CONFIG_M586 \
@@ -41,6 +43,10 @@
 	 Winchip-C6			CONFIG_MWINCHIPC6 \
 	 Winchip-2			CONFIG_MWINCHIP2 \
 	 Winchip-2A/Winchip-3		CONFIG_MWINCHIP3D" Pentium-Pro
+else
+   # First configuration stage: Allow all possible processors deps
+   define_bool CONFIG_M386 y
+fi
 #
 # Define implied options from the CPU selection here
 #
scripts/cpu_detect.sh +31 -0
diff -uNr old.linux/scripts/cpu_detect.sh linux/scripts/cpu_detect.sh
@@ -0,0 +1,81 @@
+#! /bin/bash
+
+# Copyright (C) 2000-2001  Giacomo Catenazzi  <[email protected]>
+# This is free software, see GNU General Public License 2 for details.
+
+# This script try to autodetect the CPU.
+# On SMP I assume that all processors are of the same type as the first
+
+# Version 3
+
+
+function check_cpu () {
+    if echo "$cpu_id" | egrep -e "$1" ; then
+	# CPU detected
+	echo $2
+	exit 0
+    fi
+}
+
+
+### i386 ###
+
+if [ "$ARCH" = "i386" ] ; then
+
+    if [ ! -r /proc/cpuinfo ] ; then
+	echo "cpu_detect: Could not read /proc/cpuinfo" 1>&2
+	echo CONFIG_M386
+	exit 2
+    fi
+
+  vendor=$(sed -n 's/^vendor_id.*: *\([-A-Za-z0-9_]*\).*$/\1/pg'

/proc/cpuinfo)
+ cpu_fam=$(sed -n 's/^cpu family.*: *\([0-9A-Za-z]*\).*$/\1/pg' /proc/cpuinfo)
+ cpu_mod=$(sed -n 's/^model[^a-z]*: *\([0-9A-Za-z]*\).*$/\1/pg' /proc/cpuinfo)
+ cpu_name=$(sed -n 's/^model name.*: *\(.*\)$/\1/pg' /proc/cpuinfo)
+ cpu_id="$vendor:$cpu_fam:$cpu_mod:$cpu_name"
+
+ #echo $cpu_id # for debug
+

+    check_cpu '^GenuineIntel:.*:.*:Pentium [67]'  CONFIG_M586TSC
+    check_cpu '^GenuineIntel:.*:.*:Pentium MMX'   CONFIG_M586MMX
+    check_cpu '^GenuineIntel:.*:.*:Pentium Pro'   CONFIG_M686
+    check_cpu '^GenuineIntel:.*:.*:Pentium II\>'  CONFIG_M686
+    check_cpu '^GenuineIntel:.*:.*:Celeron'       CONFIG_M686
+    check_cpu '^GenuineIntel:.*:.*:Pentium III'   CONFIG_M686FXSR
+    check_cpu '^GenuineIntel:.*:.*:Pentium IV'    CONFIG_MPENTIUM4   #
???
+    check_cpu '^GenuineIntel:4:.*:'               CONFIG_M486
+    check_cpu '^GenuineIntel:5:[01237]:'          CONFIG_M586TSC
+    check_cpu '^GenuineIntel:5:[48]:'             CONFIG_M586MMX
+    check_cpu '^GenuineIntel:6:[01356]:'          CONFIG_M686
+    check_cpu '^GenuineIntel:6:[789]:'            CONFIG_M686FXSR
+    check_cpu '^GenuineIntel:6:1[1]:'             CONFIG_M686FXSR
+
+    check_cpu '^AuthenticAMD:.*:.*:K5'            CONFIG_M586
+    check_cpu '^AuthenticAMD:.*:.*:K6'            CONFIG_MK6
+    check_cpu '^AuthenticAMD:.*:.*:Athlon'        CONFIG_MK7
+    check_cpu '^AuthenticAMD:4:.*:'               CONFIG_M486
+    check_cpu '^AuthenticAMD:5:[0123]:'           CONFIG_M586
+    check_cpu '^AuthenticAMD:5:[89]:'             CONFIG_MK6
+    check_cpu '^AuthenticAMD:5:1[01]:'            CONFIG_MK6
+    check_cpu '^AuthenticAMD:6:[0124]:'           CONFIG_MK7
+
+    check_cpu '^UMC:4:[12]:'                      CONFIG_M486
+    check_cpu '^NexGenDriven:.*:.*:Nx586'         CONFIG_M386
+    check_cpu '^NexGenDriven:5:0:'                CONFIG_M386
+    check_cpu '^TransmetaCPU:.*:.*:'              CONFIG_MCRUSOE
+    check_cpu '^GenuineTMx86:.*:.*:'              CONFIG_MCRUSOE
+
+    check_cpu '^CentaurHauls:.*:.*:WinChip C6'    CONFIG_MWINCHIPC6
+    check_cpu '^CentaurHauls:.*:.*:WinChip 2\>'   CONFIG_MWINCHIP2
+    check_cpu '^CentaurHauls:.*:.*:WinChip 2[AB]' CONFIG_MWINCHIP2A
+    check_cpu '^CentaurHauls:.*:.*:WinChip [34]'  CONFIG_MWINCHIP2A
+    check_cpu '^CentaurHauls:5:4:'                CONFIG_MWINCHIPC6
+
+    # default value
+    check_cpu '^.*:.*:.*:'                        CONFIG_M386
+    echo "cpu_detect: CPU not detected. Using default" 2>&1
+    exit 1

+fi
+
+echo "cpu_detect: ARCH '$ARCH' not implemented" 2>&1
+exit 3
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#1 lore raw
Followup to:  <[email protected]>
By author:    "Giacomo A. Catenazzi" <[email protected]>
In newsgroup: linux.dev.kernel
Quoted 10 lines

When working in cpu autoconfiguration I found some problems:

I have to identify this processor:
Vendor: Intel
Family: 6
Model: 8
Is it a "Pentium III (Coppermine)" (setup.c:1709)
or a "Celeron (Coppermine)" (setup.c:1650) ?

Line 1650 takes precedence, *IF* the L2$ size is 128K.

-hpa

Signature · 7 lines
<[email protected]> at work, <[email protected]> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/
#2 lore raw
In reply to Giacomo A. Catenazzi
Quoted 8 lines · Giacomo A. Catenazzi

When working in cpu autoconfiguration I found some problems:

I have to identify this processor:
Vendor: Intel
Family: 6
Model: 8
Is it a "Pentium III (Coppermine)" (setup.c:1709)
or a "Celeron (Coppermine)" (setup.c:1650) ?

Celeron (Coppermine). Here is the output from /proc/cpuinfo on my laptop:

processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 8
model name : Celeron (Coppermine)
stepping : 1
cpu MHz : 501.140
cache size : 128 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr sse
bogomips : 999.42

Erik

Signature · 9 lines
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
of Electrical Engineering, Faculty of Information Technology and Systems,
Delft University of Technology, PO BOX 5031,  2600 GA Delft, The Netherlands
Phone: +31-15-2783635  Fax: +31-15-2781843  Email: [email protected]
WWW: http://www-ict.its.tudelft.nl/~erik/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/
#3 lore raw
In reply to Giacomo A. Catenazzi
Quoted 3 lines · Giacomo A. Catenazzi

When working in cpu autoconfiguration I found some problems:
What is the difference between MWINCHIP2 and MWINCHIP3D? I don't find differences in the sources

MWINCHIP3D is for the Winchip-2A and above, which have 3dnow! instructions. Until recently it was using the 3dnow memcopy stuff. It got disabled when the memcopy stuff was overhauled to give even bigger wins on the Athlon. Which makes sense given that there are a lot more Athlons out there than Winchips.

Who knows, maybe the old 3dnow! copy routine will make a comeback in a future kernel just for Winchip-2As and above. Just needs someone to find the time.

regards,

Davej.

Signature · 7 lines
| Dave Jones.        http://www.suse.de/~davej
| SuSE Labs

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/
#4 lore raw
In reply to Giacomo A. Catenazzi
Quoted 11 lines · On 2001.01.02 Giacomo A. Catenazzi wrote:

Hello!

When working in cpu autoconfiguration I found some problems:

I have to identify this processor:
Vendor: Intel
Family: 6
Model: 8
Is it a "Pentium III (Coppermine)" (setup.c:1709)
or a "Celeron (Coppermine)" (setup.c:1650) ?

AFAIK, both. Coppermine is the code name of the low level arch of the chip.

Really, the kernel should be querying the builder: Have you a Deschutes, a Mendocino or a Coppermine ? How much cache do you have ? But that is rarely known (Uh? I bought a Pentium III). You have to guess from the answer to:
Have you a PII, an old Celeron (Mendocino) or a new Cel-PIII (Copper).

Signature · 9 lines
J.A. Magallon                                         $> cd pub
mailto:[email protected]                             $> more beer

Linux werewolf 2.2.19-pre3-aa3 #3 SMP Wed Dec 27 10:25:32 CET 2000 i686

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/