Using cpufreq

Bruno Ducrot ducrot at poupinou.org
Mon Mar 14 11:09:20 PST 2005


On Sun, Mar 13, 2005 at 12:40:19PM +0100, Alexander S. Usov wrote:
> Doug White wrote:
> 
> > On Fri, 11 Mar 2005, Alexander S. Usov wrote:
> > 
> >> Hi!
> >>
> >> I have upgraded to 5.4-PRERELEASE this weekend, and can't figure out
> >> how to use/enable cpufreq framework.
> >>
> >> With my standart kernel config I have no cpufreq.ko not acpi_perf.ko.
> >> Adding "device cpufreq" (mentioned in cpufreq(4)) to the kernel config
> >> does not work either.
> > 
> > I don't believe any of the CPU-specific drivers have been ported to
> > RELENG_5 yet. You may be able to copy them out of -CURRENT and build them.
> > No guarantees.
> 
> Can you suggest what exactly should be copied from there?

"somewhere" (~myuser/cpufreq/ for example) do something like this:

cvs co src/sys/dev/acpica/acpi_perf.c
cvs co -P src/sys/dev/cpufreq
cvs co -P src/sys/i386/cpufreq

Create two directory:
mkdir acpi_perf
mkdir cpufreq

Then:
cp src/sys/dev/acpica/acpi_perf.c acpi_perf/
cp src/sys/dev/cpufreq/*.c cpufreq
cp src/sys/i386/cpufreq/*.c cpufreq

Remove src (rm -rf src), then for each of directories
acpi_perf, cpufreq; create a makefile:

For acpi_perf/Makefile:

CFLAGS+=	-I@/contrib/dev/acpica
KMOD=		acpi_perf
WARNS?=		2
SRCS=		acpi_perf.c
SRCS+=		acpi_if.h bus_if.h cpufreq_if.h device_if.h opt_acpi.h \
		pci_if.h

.include <bsd.kmod.mk>

and for cpufreq/Makefile:

KMOD=		cpufreq
WARNS?=		2
SRCS=		ichss.c est.c p4tcc.c
SRCS+=		bus_if.h cpufreq_if.h device_if.h pci_if.h

.include <bsd.kmod.mk>

Go to each directories, issue a make install
Then try to kldload acpi_perf and kldload cpufreq.
If that ok, you may want to add to /boot/loader.conf

acpi_perf_load="YES"
cpufreq_load="YES"

Note that ichss require loading at boot.

Note also that you *must* not compile kernel with P4TCC support
(or do not include p4tcc.c in the SRCS line in the above Makefile).

And if you have a powernow capable processor, you may want to try
http://www.poupinou.org/cpufreq/bsd/powernow.tar.gz

(which may require acpi_perf sometimes if it failed if the provided
BIOS table failed).

Hope this help,

-- 
Bruno Ducrot

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.


More information about the freebsd-current mailing list