* Shell script to select the right cpufreq module?
@ 2004-03-30 19:27 Michael Opdenacker
2004-03-30 20:31 ` Dominik Brodowski
0 siblings, 1 reply; 13+ messages in thread
From: Michael Opdenacker @ 2004-03-30 19:27 UTC (permalink / raw)
To: cpufreq mailing list
Hello,
I'm testing Fedora Core 2 test 2 (FC2T2) and cpufreq works just fine!
Thanks a lot for your good work!
By the way, in FC2T2, you have to set the DRIVER variable in
/etc/cpuspeed.conf according to your processor (DRIVER=p4-clockmod in my
case). Otherwise, even if you start the /etc/init.d/cpuspeed script,
nothing happens.
I would like to automate that so that the /etc/init.d/cpuspeed script
automatically loads the right cpufreq module if the cpu is supported. If
users don't want cpu frequency scaling, they just have to disable this
service at startup.
Does anyone here already have a shell script that reads /proc/cpuinfo
and returns the name of the corresponding cpufreq module if the
processor is supported?
Otherwise, I'll start to write one and ask you guys to test it, as I can
only make tests on P4.
Thank you in advance,
Cheers,
Michael.
--
Michael Opdenacker
http://opdenacker.org/
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Shell script to select the right cpufreq module?
2004-03-30 19:27 Shell script to select the right cpufreq module? Michael Opdenacker
@ 2004-03-30 20:31 ` Dominik Brodowski
2004-03-30 21:02 ` Michael Opdenacker
2004-03-31 15:34 ` Carl Thompson
0 siblings, 2 replies; 13+ messages in thread
From: Dominik Brodowski @ 2004-03-30 20:31 UTC (permalink / raw)
To: Michael Opdenacker; +Cc: cpufreq mailing list
On Tue, Mar 30, 2004 at 09:27:33PM +0200, Michael Opdenacker wrote:
> Does anyone here already have a shell script that reads /proc/cpuinfo
> and returns the name of the corresponding cpufreq module if the
> processor is supported?
>
> Otherwise, I'll start to write one and ask you guys to test it, as I can
> only make tests on P4.
I proposed one such shell script a couple of weeks ago and submitted a
draft, which I can't locate in the archives ATM so here it is again:
#!/bin/sh
# Copyright (C) 2004 Dominik Brodowski <linux@brodo.de>
#
# This script is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This script tries to detect the best suited x86 cpufreq driver, and
# load it using "modprobe" commands.
#
#
DEBUG=1
KV="$(uname -r | cut -c1-3)"
if [ "$KV" != "2.6" ]; then
echo "Wrong kernel version"
exit 1
fi
# the cpufreq drivers
ACPI=0
P4CLOCKMOD=0
SPEEDSTEP_SMI=0
SPEEDSTEP_ICH=0
SPEEDSTEP_CENTRINO=0
FLAG_EST=0
FLAG_ACPI=0
FLAG_ACC=0
# parse /proc/cpuinfo
FAMILY="$(cat /proc/cpuinfo | grep "cpu family" | cut -c14-)"
MODEL="$(cat /proc/cpuinfo | grep "model" | grep -v "model name" | cut -c10-)"
STEPPING="$(cat /proc/cpuinfo | grep "stepping" | cut -c12-)"
# parse for vendor
cat /proc/cpuinfo | grep vendor_id | grep Intel &> /dev/null && INTEL=1
# parse flags
cat /proc/cpuinfo | grep "flags" | grep " est" &> /dev/null && FLAG_EST=1
cat /proc/cpuinfo | grep "flags" | grep " acpi" &> /dev/null && FLAG_ACPI=1
cat /proc/cpuinfo | grep "flags" | grep " tm" &> /dev/null && FLAG_ACC=1
if [ $DEBUG -eq 1 ]; then
echo "CPU family is $FAMILY"
echo "CPU model is $MODEL"
echo "CPU stepping is $STEPPING"
echo "CPU vendor: Intel? $INTEL"
fi
if [ $INTEL -eq 1 ]; then
case "$FAMILY" in
"6")
if [ $DEBUG -eq 1 ]; then
echo "Pentium 3 or Pentium M detected."
fi
case "$MODEL" in
"9")
if [ "$STEPPING" == "5" ] ; then
if [ $FLAG_EST -eq 1 ]; then
SPEEDSTEP_CENTRINO=1
fi
fi
;;
"8")
SPEEDSTEP_SMI=1
SPEEDSTEP_ICH=1
;;
"11")
SPEEDSTEP_ICH=1
;;
*)
echo "Unknown CPU."
;;
esac
;;
"15")
if [ $DEBUG -eq 1 ]; then
echo "Pentium 4 detected."
fi
if [ "$MODEL" == "2" ]; then
case "$STEPPING" in
"4")
SPEEDSTEP_ICH=1
;;
"7")
SPEEDSTEP_ICH=1
;;
"9")
SPEEDSTEP_ICH=1
;;
*)
true
;;
esac
fi
;;
*)
echo "unknown Intel Processor. Aborting."
exit 1
;;
esac
if [ $FLAG_ACPI -eq 1 ]; then
if [ $FLAG_ACC -eq 1 ]; then
P4CLOCKMOD=1;
fi
fi
ACPI=1
fi
if [ $DEBUG -eq 1 ]; then
echo "ACPI? $ACPI"
echo "P4CLOCKMOD? $P4CLOCKMOD"
echo "SPEEDSTEP_CENTRINO? $SPEEDSTEP_CENTRINO"
echo "SPEEDSTEP_ICH? $SPEEDSTEP_ICH"
echo "SPEEDSTEP_SMI? $SPEEDSTEP_SMI"
fi
if [ $SPEEDSTEP_CENTRINO -eq 1 ]; then
modprobe speedstep-centrino
fi
if [ $SPEEDSTEP_ICH -eq 1 ]; then
modprobe speedstep-ich
fi
if [ $ACPI -eq 1 ]; then
modprobe acpi
fi
if [ $P4CLOCKMOD -eq 1 ]; then
modprobe p4-clockmod
fi
if [ $SPEEDSTEP_SMI -eq 1 ]; then
modprobe speedstep-smi
fi
end of script... and as I'm more interested in the kernel side of cpufreq
anyways, I'd be glad if somebody else would finish this script and make it
ready for prime-time usage. Are you willing to do so? Would be great!
Dominik
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Shell script to select the right cpufreq module?
2004-03-30 20:31 ` Dominik Brodowski
@ 2004-03-30 21:02 ` Michael Opdenacker
2004-03-31 15:34 ` Carl Thompson
1 sibling, 0 replies; 13+ messages in thread
From: Michael Opdenacker @ 2004-03-30 21:02 UTC (permalink / raw)
To: Dominik Brodowski; +Cc: cpufreq mailing list
Hi Dominik!
That's a very good start... thanks a lot!
I will modify it according to my needs (just need something that sets a
variable to the right module name, or leaves it with an empty value
otherwise), and will post it to this list for testing, in particular on
non Intel processors.
:-)
Michael.
>On Tue, Mar 30, 2004 at 09:27:33PM +0200, Michael Opdenacker wrote:
>
>
>>Does anyone here already have a shell script that reads /proc/cpuinfo
>>and returns the name of the corresponding cpufreq module if the
>>processor is supported?
>>
>>Otherwise, I'll start to write one and ask you guys to test it, as I can
>>only make tests on P4.
>>
>>
>
>I proposed one such shell script a couple of weeks ago and submitted a
>draft, which I can't locate in the archives ATM so here it is again:
>
>#!/bin/sh
>
># Copyright (C) 2004 Dominik Brodowski <linux@brodo.de>
>#
># This script is free software; you can redistribute it and/or modify
># it under the terms of the GNU General Public License version 2 as
># published by the Free Software Foundation.
>#
># This script tries to detect the best suited x86 cpufreq driver, and
># load it using "modprobe" commands.
>#
>#
>
>DEBUG=1
>
>KV="$(uname -r | cut -c1-3)"
>
>if [ "$KV" != "2.6" ]; then
> echo "Wrong kernel version"
> exit 1
>fi
>
># the cpufreq drivers
>ACPI=0
>P4CLOCKMOD=0
>SPEEDSTEP_SMI=0
>SPEEDSTEP_ICH=0
>SPEEDSTEP_CENTRINO=0
>FLAG_EST=0
>FLAG_ACPI=0
>FLAG_ACC=0
>
># parse /proc/cpuinfo
>FAMILY="$(cat /proc/cpuinfo | grep "cpu family" | cut -c14-)"
>MODEL="$(cat /proc/cpuinfo | grep "model" | grep -v "model name" | cut -c10-)"
>STEPPING="$(cat /proc/cpuinfo | grep "stepping" | cut -c12-)"
>
># parse for vendor
>cat /proc/cpuinfo | grep vendor_id | grep Intel &> /dev/null && INTEL=1
>
># parse flags
>cat /proc/cpuinfo | grep "flags" | grep " est" &> /dev/null && FLAG_EST=1
>cat /proc/cpuinfo | grep "flags" | grep " acpi" &> /dev/null && FLAG_ACPI=1
>cat /proc/cpuinfo | grep "flags" | grep " tm" &> /dev/null && FLAG_ACC=1
>
>
>if [ $DEBUG -eq 1 ]; then
> echo "CPU family is $FAMILY"
> echo "CPU model is $MODEL"
> echo "CPU stepping is $STEPPING"
> echo "CPU vendor: Intel? $INTEL"
>fi
>
>
>if [ $INTEL -eq 1 ]; then
> case "$FAMILY" in
> "6")
> if [ $DEBUG -eq 1 ]; then
> echo "Pentium 3 or Pentium M detected."
> fi
> case "$MODEL" in
> "9")
> if [ "$STEPPING" == "5" ] ; then
> if [ $FLAG_EST -eq 1 ]; then
> SPEEDSTEP_CENTRINO=1
> fi
> fi
> ;;
> "8")
> SPEEDSTEP_SMI=1
> SPEEDSTEP_ICH=1
> ;;
> "11")
> SPEEDSTEP_ICH=1
> ;;
> *)
> echo "Unknown CPU."
> ;;
> esac
> ;;
> "15")
> if [ $DEBUG -eq 1 ]; then
> echo "Pentium 4 detected."
> fi
> if [ "$MODEL" == "2" ]; then
> case "$STEPPING" in
> "4")
> SPEEDSTEP_ICH=1
> ;;
> "7")
> SPEEDSTEP_ICH=1
> ;;
> "9")
> SPEEDSTEP_ICH=1
> ;;
> *)
> true
> ;;
> esac
> fi
> ;;
> *)
> echo "unknown Intel Processor. Aborting."
> exit 1
> ;;
> esac
> if [ $FLAG_ACPI -eq 1 ]; then
> if [ $FLAG_ACC -eq 1 ]; then
> P4CLOCKMOD=1;
> fi
> fi
> ACPI=1
>fi
>
>if [ $DEBUG -eq 1 ]; then
> echo "ACPI? $ACPI"
> echo "P4CLOCKMOD? $P4CLOCKMOD"
> echo "SPEEDSTEP_CENTRINO? $SPEEDSTEP_CENTRINO"
> echo "SPEEDSTEP_ICH? $SPEEDSTEP_ICH"
> echo "SPEEDSTEP_SMI? $SPEEDSTEP_SMI"
>fi
>
>if [ $SPEEDSTEP_CENTRINO -eq 1 ]; then
> modprobe speedstep-centrino
>fi
>
>if [ $SPEEDSTEP_ICH -eq 1 ]; then
> modprobe speedstep-ich
>fi
>
>if [ $ACPI -eq 1 ]; then
> modprobe acpi
>fi
>
>if [ $P4CLOCKMOD -eq 1 ]; then
> modprobe p4-clockmod
>fi
>
>if [ $SPEEDSTEP_SMI -eq 1 ]; then
> modprobe speedstep-smi
>fi
>
>
>
>end of script... and as I'm more interested in the kernel side of cpufreq
>anyways, I'd be glad if somebody else would finish this script and make it
>ready for prime-time usage. Are you willing to do so? Would be great!
>
> Dominik
>
>
>
>
--
Michael Opdenacker
http://opdenacker.org/
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Shell script to select the right cpufreq module?
2004-03-30 20:31 ` Dominik Brodowski
2004-03-30 21:02 ` Michael Opdenacker
@ 2004-03-31 15:34 ` Carl Thompson
2004-03-31 15:44 ` Dominik Brodowski
2004-03-31 15:48 ` Michael Opdenacker
1 sibling, 2 replies; 13+ messages in thread
From: Carl Thompson @ 2004-03-31 15:34 UTC (permalink / raw)
To: Dominik Brodowski; +Cc: cpufreq mailing list
Does Vendor/Family/Model/Stepping give you enough information to
determine the appropriate cpufreq driver? I notice that you are also
looking for the acpi processor flag which will override everything else
and using the p4-clockmod driver. Otherwise, it looks like my Dell
laptop would have used speedstep-ich according to your script. Is
p4-clockmod better than speedstep-ich? Is it true that any processor
that has the 'acpi' flag set will use the p4-clockmod driver as your
script assumes? Fedora Core 2 does not seem to even include the
speedstep-ich driver. Is it obsolete? (Sorry, most of my experience
is with AMD mobile processors).
Where can I find more complete info on possible values for the fields of
/proc/cpuinfo and the different cpufreq drivers they represent? It
doesn't have to be a working script; with the info I'll write my own to
include with cpuspeed.
Thanks,
Carl
Quoting Dominik Brodowski <linux@dominikbrodowski.de>:
> On Tue, Mar 30, 2004 at 09:27:33PM +0200, Michael Opdenacker wrote:
>> Does anyone here already have a shell script that reads
>> /proc/cpuinfo and returns the name of the corresponding cpufreq
>> module if the processor is supported?
>>
>> Otherwise, I'll start to write one and ask you guys to test it, as I
>> can only make tests on P4.
>
> I proposed one such shell script a couple of weeks ago and submitted a
> draft, which I can't locate in the archives ATM so here it is again:
>
> #!/bin/sh
>
> # Copyright (C) 2004 Dominik Brodowski <linux@brodo.de>
> #
> # This script is free software; you can redistribute it and/or modify
> # it under the terms of the GNU General Public License version 2 as
> # published by the Free Software Foundation.
> #
> # This script tries to detect the best suited x86 cpufreq driver, and
> # load it using "modprobe" commands.
> #
> #
>
> DEBUG=1
>
> KV="$(uname -r | cut -c1-3)"
>
> if [ "$KV" != "2.6" ]; then
> echo "Wrong kernel version"
> exit 1
> fi
>
> # the cpufreq drivers
> ACPI=0
> P4CLOCKMOD=0
> SPEEDSTEP_SMI=0
> SPEEDSTEP_ICH=0
> SPEEDSTEP_CENTRINO=0
> FLAG_EST=0
> FLAG_ACPI=0
> FLAG_ACC=0
>
> # parse /proc/cpuinfo
> FAMILY="$(cat /proc/cpuinfo | grep "cpu family" | cut -c14-)"
> MODEL="$(cat /proc/cpuinfo | grep "model" | grep -v "model name" |
> cut -c10-)"
> STEPPING="$(cat /proc/cpuinfo | grep "stepping" | cut -c12-)"
>
> # parse for vendor
> cat /proc/cpuinfo | grep vendor_id | grep Intel &> /dev/null && INTEL=1
>
> # parse flags
> cat /proc/cpuinfo | grep "flags" | grep " est" &> /dev/null && FLAG_EST=1
> cat /proc/cpuinfo | grep "flags" | grep " acpi" &> /dev/null && FLAG_ACPI=1
> cat /proc/cpuinfo | grep "flags" | grep " tm" &> /dev/null && FLAG_ACC=1
>
>
> if [ $DEBUG -eq 1 ]; then
> echo "CPU family is $FAMILY"
> echo "CPU model is $MODEL"
> echo "CPU stepping is $STEPPING"
> echo "CPU vendor: Intel? $INTEL"
> fi
>
>
> if [ $INTEL -eq 1 ]; then
> case "$FAMILY" in
> "6")
> if [ $DEBUG -eq 1 ]; then
> echo "Pentium 3 or Pentium M detected."
> fi
> case "$MODEL" in
> "9")
> if [ "$STEPPING" == "5" ] ; then
> if [ $FLAG_EST -eq 1 ]; then
> SPEEDSTEP_CENTRINO=1
> fi
> fi
> ;;
> "8")
> SPEEDSTEP_SMI=1
> SPEEDSTEP_ICH=1
> ;;
> "11")
> SPEEDSTEP_ICH=1
> ;;
> *)
> echo "Unknown CPU."
> ;;
> esac
> ;;
> "15")
> if [ $DEBUG -eq 1 ]; then
> echo "Pentium 4 detected."
> fi
> if [ "$MODEL" == "2" ]; then
> case "$STEPPING" in
> "4")
> SPEEDSTEP_ICH=1
> ;;
> "7")
> SPEEDSTEP_ICH=1
> ;;
> "9")
> SPEEDSTEP_ICH=1
> ;;
> *)
> true
> ;;
> esac
> fi
> ;;
> *)
> echo "unknown Intel Processor. Aborting."
> exit 1
> ;;
> esac
> if [ $FLAG_ACPI -eq 1 ]; then
> if [ $FLAG_ACC -eq 1 ]; then
> P4CLOCKMOD=1;
> fi
> fi
> ACPI=1
> fi
>
> if [ $DEBUG -eq 1 ]; then
> echo "ACPI? $ACPI"
> echo "P4CLOCKMOD? $P4CLOCKMOD"
> echo "SPEEDSTEP_CENTRINO? $SPEEDSTEP_CENTRINO"
> echo "SPEEDSTEP_ICH? $SPEEDSTEP_ICH"
> echo "SPEEDSTEP_SMI? $SPEEDSTEP_SMI"
> fi
>
> if [ $SPEEDSTEP_CENTRINO -eq 1 ]; then
> modprobe speedstep-centrino
> fi
>
> if [ $SPEEDSTEP_ICH -eq 1 ]; then
> modprobe speedstep-ich
> fi
>
> if [ $ACPI -eq 1 ]; then
> modprobe acpi
> fi
>
> if [ $P4CLOCKMOD -eq 1 ]; then
> modprobe p4-clockmod
> fi
>
> if [ $SPEEDSTEP_SMI -eq 1 ]; then
> modprobe speedstep-smi
> fi
>
>
>
> end of script... and as I'm more interested in the kernel side of cpufreq
> anyways, I'd be glad if somebody else would finish this script and make it
> ready for prime-time usage. Are you willing to do so? Would be great!
>
> Dominik
>
> _______________________________________________
> Cpufreq mailing list
> Cpufreq@www.linux.org.uk
> http://www.linux.org.uk/mailman/listinfo/cpufreq
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Shell script to select the right cpufreq module?
2004-03-31 15:34 ` Carl Thompson
@ 2004-03-31 15:44 ` Dominik Brodowski
2004-03-31 15:59 ` Dave Jones
2004-03-31 15:48 ` Michael Opdenacker
1 sibling, 1 reply; 13+ messages in thread
From: Dominik Brodowski @ 2004-03-31 15:44 UTC (permalink / raw)
To: Carl Thompson, davej; +Cc: cpufreq mailing list
[-- Attachment #1.1: Type: text/plain, Size: 1762 bytes --]
On Wed, Mar 31, 2004 at 07:34:55AM -0800, Carl Thompson wrote:
> Does Vendor/Family/Model/Stepping give you enough information to
> determine the appropriate cpufreq driver?
Well, checking for the acpi flag is easier than compiling the
vendor/family/model/stepping check for _any_ such CPU...
> I notice that you are also looking for the acpi processor flag which
> will override everything else and using the p4-clockmod driver.
No -- it p4-clockmod is loaded [almost] last, so all other drivers are tried
first, if the CPU supports them. And that's the sane thing to do, as
p4-clockmod hardly ever saves any power.
> Otherwise, it looks like my Dell
> laptop would have used speedstep-ich according to your script. Is
> p4-clockmod better than speedstep-ich? Is it true that any processor
> that has the 'acpi' flag set will use the p4-clockmod driver as your
> script assumes?
speedstep-ich is better as it also scales voltage in addition to frequency,
and if your system executes the "hlt" instruction properly, or even has ACPI
C2-support, p4-clockmod will not save you _anything_.
> Fedora Core 2 does not seem to even include the
> speedstep-ich driver.
OOOOPS. Dave?
> Is it obsolete? (Sorry, most of my experience
> is with AMD mobile processors).
No, it's not obsolete, it is _recommended_ for many systems.
> Where can I find more complete info on possible values for the fields of
> /proc/cpuinfo and the different cpufreq drivers they represent? It
> doesn't have to be a working script; with the info I'll write my own to
> include with cpuspeed.
For Intel-based CPUs, the info I provided should be enough, for AMD, well,
you asked a lot of people for it a few minutes ago...
Dominik
[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 143 bytes --]
_______________________________________________
Cpufreq mailing list
Cpufreq@www.linux.org.uk
http://www.linux.org.uk/mailman/listinfo/cpufreq
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Shell script to select the right cpufreq module?
2004-03-31 15:34 ` Carl Thompson
2004-03-31 15:44 ` Dominik Brodowski
@ 2004-03-31 15:48 ` Michael Opdenacker
1 sibling, 0 replies; 13+ messages in thread
From: Michael Opdenacker @ 2004-03-31 15:48 UTC (permalink / raw)
To: Carl Thompson; +Cc: cpufreq mailing list
Hi Carl,
Are you trying to write this script for the FC2 /etc/init.d/cpuspeed
too? If you can do it, that's great!
Here are details about my processor. According to the specs, it's an
Intel Pentium 4B processor at 2.4 GHz (Northwood 533 MHz, 0.13 um, 512
KB cache):
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Intel(R) Pentium(R) 4 CPU 2.40GHz
stepping : 7
cpu MHz : 899.900
cache size : 512 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 mtrr pge mca cmov
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid
bogomips : 4734.97
Note that this processor works with a reduced frequency at the moment... :-)
Cheers,
Michael.
> Does Vendor/Family/Model/Stepping give you enough information to
> determine the appropriate cpufreq driver? I notice that you are also
> looking for the acpi processor flag which will override everything else
> and using the p4-clockmod driver. Otherwise, it looks like my Dell
> laptop would have used speedstep-ich according to your script. Is
> p4-clockmod better than speedstep-ich? Is it true that any processor
> that has the 'acpi' flag set will use the p4-clockmod driver as your
> script assumes? Fedora Core 2 does not seem to even include the
> speedstep-ich driver. Is it obsolete? (Sorry, most of my experience
> is with AMD mobile processors).
>
> Where can I find more complete info on possible values for the fields of
> /proc/cpuinfo and the different cpufreq drivers they represent? It
> doesn't have to be a working script; with the info I'll write my own to
> include with cpuspeed.
>
> Thanks,
> Carl
>
> Quoting Dominik Brodowski <linux@dominikbrodowski.de>:
>
>> On Tue, Mar 30, 2004 at 09:27:33PM +0200, Michael Opdenacker wrote:
>>
>>> Does anyone here already have a shell script that reads
>>> /proc/cpuinfo and returns the name of the corresponding cpufreq
>>> module if the processor is supported?
>>>
>>> Otherwise, I'll start to write one and ask you guys to test it, as I
>>> can only make tests on P4.
>>
>>
>> I proposed one such shell script a couple of weeks ago and submitted a
>> draft, which I can't locate in the archives ATM so here it is again:
>>
>> #!/bin/sh
>>
>> # Copyright (C) 2004 Dominik Brodowski <linux@brodo.de>
>> #
>> # This script is free software; you can redistribute it and/or modify
>> # it under the terms of the GNU General Public License version 2 as
>> # published by the Free Software Foundation.
>> #
>> # This script tries to detect the best suited x86 cpufreq driver, and
>> # load it using "modprobe" commands.
>> #
>> #
>>
>> DEBUG=1
>>
>> KV="$(uname -r | cut -c1-3)"
>>
>> if [ "$KV" != "2.6" ]; then
>> echo "Wrong kernel version"
>> exit 1
>> fi
>>
>> # the cpufreq drivers
>> ACPI=0
>> P4CLOCKMOD=0
>> SPEEDSTEP_SMI=0
>> SPEEDSTEP_ICH=0
>> SPEEDSTEP_CENTRINO=0
>> FLAG_EST=0
>> FLAG_ACPI=0
>> FLAG_ACC=0
>>
>> # parse /proc/cpuinfo
>> FAMILY="$(cat /proc/cpuinfo | grep "cpu family" | cut -c14-)"
>> MODEL="$(cat /proc/cpuinfo | grep "model" | grep -v "model name" |
>> cut -c10-)"
>> STEPPING="$(cat /proc/cpuinfo | grep "stepping" | cut -c12-)"
>>
>> # parse for vendor
>> cat /proc/cpuinfo | grep vendor_id | grep Intel &> /dev/null && INTEL=1
>>
>> # parse flags
>> cat /proc/cpuinfo | grep "flags" | grep " est" &> /dev/null &&
>> FLAG_EST=1
>> cat /proc/cpuinfo | grep "flags" | grep " acpi" &> /dev/null &&
>> FLAG_ACPI=1
>> cat /proc/cpuinfo | grep "flags" | grep " tm" &> /dev/null && FLAG_ACC=1
>>
>>
>> if [ $DEBUG -eq 1 ]; then
>> echo "CPU family is $FAMILY"
>> echo "CPU model is $MODEL"
>> echo "CPU stepping is $STEPPING"
>> echo "CPU vendor: Intel? $INTEL"
>> fi
>>
>>
>> if [ $INTEL -eq 1 ]; then
>> case "$FAMILY" in
>> "6")
>> if [ $DEBUG -eq 1 ]; then
>> echo "Pentium 3 or Pentium M detected."
>> fi
>> case "$MODEL" in
>> "9")
>> if [ "$STEPPING" == "5" ] ; then
>> if [ $FLAG_EST -eq 1 ]; then
>> SPEEDSTEP_CENTRINO=1
>> fi
>> fi
>> ;;
>> "8")
>> SPEEDSTEP_SMI=1
>> SPEEDSTEP_ICH=1
>> ;;
>> "11")
>> SPEEDSTEP_ICH=1
>> ;;
>> *)
>> echo "Unknown CPU."
>> ;;
>> esac
>> ;;
>> "15")
>> if [ $DEBUG -eq 1 ]; then
>> echo "Pentium 4 detected."
>> fi
>> if [ "$MODEL" == "2" ]; then
>> case "$STEPPING" in
>> "4")
>> SPEEDSTEP_ICH=1
>> ;;
>> "7")
>> SPEEDSTEP_ICH=1
>> ;;
>> "9")
>> SPEEDSTEP_ICH=1
>> ;;
>> *)
>> true
>> ;;
>> esac
>> fi
>> ;;
>> *)
>> echo "unknown Intel Processor. Aborting."
>> exit 1
>> ;;
>> esac
>> if [ $FLAG_ACPI -eq 1 ]; then
>> if [ $FLAG_ACC -eq 1 ]; then
>> P4CLOCKMOD=1;
>> fi
>> fi
>> ACPI=1
>> fi
>>
>> if [ $DEBUG -eq 1 ]; then
>> echo "ACPI? $ACPI"
>> echo "P4CLOCKMOD? $P4CLOCKMOD"
>> echo "SPEEDSTEP_CENTRINO? $SPEEDSTEP_CENTRINO"
>> echo "SPEEDSTEP_ICH? $SPEEDSTEP_ICH"
>> echo "SPEEDSTEP_SMI? $SPEEDSTEP_SMI"
>> fi
>>
>> if [ $SPEEDSTEP_CENTRINO -eq 1 ]; then
>> modprobe speedstep-centrino
>> fi
>>
>> if [ $SPEEDSTEP_ICH -eq 1 ]; then
>> modprobe speedstep-ich
>> fi
>>
>> if [ $ACPI -eq 1 ]; then
>> modprobe acpi
>> fi
>>
>> if [ $P4CLOCKMOD -eq 1 ]; then
>> modprobe p4-clockmod
>> fi
>>
>> if [ $SPEEDSTEP_SMI -eq 1 ]; then
>> modprobe speedstep-smi
>> fi
>>
>>
>>
>> end of script... and as I'm more interested in the kernel side of
>> cpufreq
>> anyways, I'd be glad if somebody else would finish this script and
>> make it
>> ready for prime-time usage. Are you willing to do so? Would be great!
>>
>> Dominik
>>
>> _______________________________________________
>> Cpufreq mailing list
>> Cpufreq@www.linux.org.uk
>> http://www.linux.org.uk/mailman/listinfo/cpufreq
>
>
>
>
>
>
>
--
Michael Opdenacker
http://opdenacker.org/
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Shell script to select the right cpufreq module?
2004-03-31 15:44 ` Dominik Brodowski
@ 2004-03-31 15:59 ` Dave Jones
2004-04-01 4:52 ` Carl Thompson
0 siblings, 1 reply; 13+ messages in thread
From: Dave Jones @ 2004-03-31 15:59 UTC (permalink / raw)
To: Carl Thompson, Michael Opdenacker, cpufreq mailing list
On Wed, Mar 31, 2004 at 05:44:00PM +0200, Dominik Brodowski wrote:
> > Fedora Core 2 does not seem to even include the
> > speedstep-ich driver.
> OOOOPS. Dave?
A grep shows..
CONFIG_X86_SPEEDSTEP_ICH=y
Dave
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Shell script to select the right cpufreq module?
2004-03-31 15:59 ` Dave Jones
@ 2004-04-01 4:52 ` Carl Thompson
2004-04-01 7:53 ` Mattia Dongili
2004-04-01 12:48 ` Dave Jones
0 siblings, 2 replies; 13+ messages in thread
From: Carl Thompson @ 2004-04-01 4:52 UTC (permalink / raw)
To: Dave Jones; +Cc: Carl Thompson, cpufreq mailing list
Well, if the module name is supposed to be "speedstep-ich.ko" then I'm
not seeing it installed anywhere...
Thanks,
Carl
Quoting Dave Jones <davej@redhat.com>:
> On Wed, Mar 31, 2004 at 05:44:00PM +0200, Dominik Brodowski wrote:
>
> > > Fedora Core 2 does not seem to even include the
> > > speedstep-ich driver.
> > OOOOPS. Dave?
>
> A grep shows..
> CONFIG_X86_SPEEDSTEP_ICH=y
>
> Dave
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Shell script to select the right cpufreq module?
2004-04-01 4:52 ` Carl Thompson
@ 2004-04-01 7:53 ` Mattia Dongili
2004-04-01 12:48 ` Dave Jones
1 sibling, 0 replies; 13+ messages in thread
From: Mattia Dongili @ 2004-04-01 7:53 UTC (permalink / raw)
To: cpufreq mailing list
On Wed, Mar 31, 2004 at 08:52:56PM -0800, Carl Thompson wrote:
> Well, if the module name is supposed to be "speedstep-ich.ko" then I'm
> not seeing it installed anywhere...
[...]
> >A grep shows..
> >CONFIG_X86_SPEEDSTEP_ICH=y
^^^
not *m*
it's compiled statically :)
bye
--
mattia
:wq!
Hodie Kalendis Aprilibus MMDCCLVII ab urbe condita est
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Shell script to select the right cpufreq module?
2004-04-01 4:52 ` Carl Thompson
2004-04-01 7:53 ` Mattia Dongili
@ 2004-04-01 12:48 ` Dave Jones
2004-04-02 22:15 ` Carl Thompson
1 sibling, 1 reply; 13+ messages in thread
From: Dave Jones @ 2004-04-01 12:48 UTC (permalink / raw)
To: Carl Thompson; +Cc: cpufreq mailing list
On Wed, Mar 31, 2004 at 08:52:56PM -0800, Carl Thompson wrote:
> > > > Fedora Core 2 does not seem to even include the
> > > > speedstep-ich driver.
> > > OOOOPS. Dave?
> >
> >A grep shows..
> >CONFIG_X86_SPEEDSTEP_ICH=y
> >
> Well, if the module name is supposed to be "speedstep-ich.ko" then I'm
> not seeing it installed anywhere...
=y means non-modular. It's compiled in.
Dave
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Shell script to select the right cpufreq module?
2004-04-01 12:48 ` Dave Jones
@ 2004-04-02 22:15 ` Carl Thompson
2004-04-02 22:36 ` Dave Jones
0 siblings, 1 reply; 13+ messages in thread
From: Carl Thompson @ 2004-04-02 22:15 UTC (permalink / raw)
To: Dave Jones; +Cc: Carl Thompson, cpufreq mailing list
Sorry! Well, then, if it's compiled in how do I activate it so that it
actually works? No cpufreq functionality seems to be active on
startup...
Thanks,
Carl
Quoting Dave Jones <davej@redhat.com>:
> On Wed, Mar 31, 2004 at 08:52:56PM -0800, Carl Thompson wrote:
>
> > > > > Fedora Core 2 does not seem to even include the
> > > > > speedstep-ich driver.
> > > > OOOOPS. Dave?
> > >
> > >A grep shows..
> > >CONFIG_X86_SPEEDSTEP_ICH=y
> > >
> > Well, if the module name is supposed to be "speedstep-ich.ko" then I'm
> > not seeing it installed anywhere...
>
> =y means non-modular. It's compiled in.
>
> Dave
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Shell script to select the right cpufreq module?
2004-04-02 22:15 ` Carl Thompson
@ 2004-04-02 22:36 ` Dave Jones
2004-04-02 23:42 ` Carl Thompson
0 siblings, 1 reply; 13+ messages in thread
From: Dave Jones @ 2004-04-02 22:36 UTC (permalink / raw)
To: Carl Thompson; +Cc: cpufreq mailing list
On Fri, Apr 02, 2004 at 02:15:22PM -0800, Carl Thompson wrote:
> Sorry! Well, then, if it's compiled in how do I activate it so that it
> actually works? No cpufreq functionality seems to be active on
> startup...
hmm puzzling. no cpufreq messages at all during boot ?
What does /proc/cpuinfo say, and is there anything in /sys/devices/system/cpu/cpu0/cpufreq ?
(if so, what are the contents of those files)
Dave
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Shell script to select the right cpufreq module?
2004-04-02 22:36 ` Dave Jones
@ 2004-04-02 23:42 ` Carl Thompson
0 siblings, 0 replies; 13+ messages in thread
From: Carl Thompson @ 2004-04-02 23:42 UTC (permalink / raw)
To: Dave Jones; +Cc: Carl Thompson, cpufreq mailing list
D'oh! It appears that this is simply not a mobile CPU.
Thanks,
Carl
Quoting Dave Jones <davej@redhat.com>:
> On Fri, Apr 02, 2004 at 02:15:22PM -0800, Carl Thompson wrote:
> > Sorry! Well, then, if it's compiled in how do I activate it so that it
> > actually works? No cpufreq functionality seems to be active on
> > startup...
>
> hmm puzzling. no cpufreq messages at all during boot ?
>
> What does /proc/cpuinfo say, and is there anything in
> /sys/devices/system/cpu/cpu0/cpufreq ?
> (if so, what are the contents of those files)
>
> Dave
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2004-04-02 23:42 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-30 19:27 Shell script to select the right cpufreq module? Michael Opdenacker
2004-03-30 20:31 ` Dominik Brodowski
2004-03-30 21:02 ` Michael Opdenacker
2004-03-31 15:34 ` Carl Thompson
2004-03-31 15:44 ` Dominik Brodowski
2004-03-31 15:59 ` Dave Jones
2004-04-01 4:52 ` Carl Thompson
2004-04-01 7:53 ` Mattia Dongili
2004-04-01 12:48 ` Dave Jones
2004-04-02 22:15 ` Carl Thompson
2004-04-02 22:36 ` Dave Jones
2004-04-02 23:42 ` Carl Thompson
2004-03-31 15:48 ` Michael Opdenacker
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.