linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Coppermine is a PIII or a Celeron? WINCHIP2/WINCHIP3D diff?
@ 2001-01-02 19:46 Giacomo A. Catenazzi
  2001-01-02 20:04 ` H. Peter Anvin
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Giacomo A. Catenazzi @ 2001-01-02 19:46 UTC (permalink / raw)
  To: linux-kernel

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:


diff -uNr old.linux/CREDITS linux/CREDITS
--- old.linux/CREDITS	Fri Dec 29 13:32:46 2000
+++ linux/CREDITS	Fri Dec 29 13:43:02 2000
@@ -458,6 +458,12 @@
 S: Fremont, California 94539
 S: USA
 
+N: Giacomo Catenazzi
+E: cate@debian.org
+D: Random kernel hack and fixes
+D: Author of scripts/cpu_detect.sh
+S: Switzerland
+
 N: Gordon Chaffee
 E: chaffee@cs.berkeley.edu
 W: http://bmrc.berkeley.edu/people/chaffee/
diff -uNr old.linux/Makefile linux/Makefile
--- old.linux/Makefile	Fri Dec 29 11:26:55 2000
+++ linux/Makefile	Fri Dec 29 13:32:10 2000
@@ -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
diff -uNr old.linux/arch/i386/config.in linux/arch/i386/config.in
--- old.linux/arch/i386/config.in	Fri Dec 29 11:26:55 2000
+++ linux/arch/i386/config.in	Fri Dec 29 13:14:58 2000
@@ -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
 #
diff -uNr old.linux/scripts/cpu_detect.sh linux/scripts/cpu_detect.sh
--- old.linux/scripts/cpu_detect.sh	Thu Jan  1 01:00:00 1970
+++ linux/scripts/cpu_detect.sh	Tue Jan  2 10:29:31 2001
@@ -0,0 +1,81 @@
+#! /bin/bash
+
+# Copyright (C) 2000-2001  Giacomo Catenazzi  <cate@debian.org>
+# 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 majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Coppermine is a PIII or a Celeron? WINCHIP2/WINCHIP3D diff?
  2001-01-02 19:46 Coppermine is a PIII or a Celeron? WINCHIP2/WINCHIP3D diff? Giacomo A. Catenazzi
@ 2001-01-02 20:04 ` H. Peter Anvin
  2001-01-02 21:57 ` Erik Mouw
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: H. Peter Anvin @ 2001-01-02 20:04 UTC (permalink / raw)
  To: linux-kernel

Followup to:  <3A523012.CF78B83D@dplanet.ch>
By author:    "Giacomo A. Catenazzi" <cate@dplanet.ch>
In newsgroup: linux.dev.kernel
> 
> 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
-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> 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 majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Coppermine is a PIII or a Celeron? WINCHIP2/WINCHIP3D diff?
  2001-01-02 19:46 Coppermine is a PIII or a Celeron? WINCHIP2/WINCHIP3D diff? Giacomo A. Catenazzi
  2001-01-02 20:04 ` H. Peter Anvin
@ 2001-01-02 21:57 ` Erik Mouw
  2001-01-02 23:44 ` davej
  2001-01-03  0:14 ` J . A . Magallon
  3 siblings, 0 replies; 5+ messages in thread
From: Erik Mouw @ 2001-01-02 21:57 UTC (permalink / raw)
  To: Giacomo A. Catenazzi; +Cc: linux-kernel

On Tue, Jan 02, 2001 at 08:46:26PM +0100, Giacomo A. Catenazzi wrote:
> 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

-- 
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: J.A.K.Mouw@its.tudelft.nl
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 majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Coppermine is a PIII or a Celeron? WINCHIP2/WINCHIP3D diff?
  2001-01-02 19:46 Coppermine is a PIII or a Celeron? WINCHIP2/WINCHIP3D diff? Giacomo A. Catenazzi
  2001-01-02 20:04 ` H. Peter Anvin
  2001-01-02 21:57 ` Erik Mouw
@ 2001-01-02 23:44 ` davej
  2001-01-03  0:14 ` J . A . Magallon
  3 siblings, 0 replies; 5+ messages in thread
From: davej @ 2001-01-02 23:44 UTC (permalink / raw)
  To: Giacomo A. Catenazzi; +Cc: linux-kernel

On Tue, 2 Jan 2001, Giacomo A. Catenazzi wrote:

> 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.

-- 
| 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 majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Coppermine is a PIII or a Celeron? WINCHIP2/WINCHIP3D diff?
  2001-01-02 19:46 Coppermine is a PIII or a Celeron? WINCHIP2/WINCHIP3D diff? Giacomo A. Catenazzi
                   ` (2 preceding siblings ...)
  2001-01-02 23:44 ` davej
@ 2001-01-03  0:14 ` J . A . Magallon
  3 siblings, 0 replies; 5+ messages in thread
From: J . A . Magallon @ 2001-01-03  0:14 UTC (permalink / raw)
  To: Giacomo A . Catenazzi; +Cc: linux-kernel


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).

-- 
J.A. Magallon                                         $> cd pub
mailto:jamagallon@able.es                             $> 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 majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-01-03  0:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-02 19:46 Coppermine is a PIII or a Celeron? WINCHIP2/WINCHIP3D diff? Giacomo A. Catenazzi
2001-01-02 20:04 ` H. Peter Anvin
2001-01-02 21:57 ` Erik Mouw
2001-01-02 23:44 ` davej
2001-01-03  0:14 ` J . A . Magallon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).