Skip to contentSkip to conversation

cpufreq core for 2.5

PATCH In review Russell King 4 participants 4 messages Jun 2, 2002 – Jun 5, 2002 CPU frequency scaling framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpufreq core for 2.5

Linus, lkml,

The following patch adds the cpufreq core code to 2.5.19 (and beyond). The cpufreq core offers a common interface to the CPU clock speed features of both ARM and x86 CPUs. We offer a set of sysctl entries, placed in /proc/sys/cpu/0 for communication with user space. Entries provided are:

speed-min (readonly)
speed-max (readonly)
speed (read/write)

In order for this code to be built, an architecture must define the CONFIG_CPU_FREQ configuration symbol. The merged ARM code already has the necessary configuration in place; the x86 part will be sent later with the x86 specific patch.

Specifically on ARM CPUs, the core is especially important, since various ARM system on a chip implementations derive peripheral clocks from the CPU clock (eg, LCD controllers, SDRAM controllers, etc). The core allows these peripherals to take action either prior and/or after the actual CPU clock adjustment so we don't go out of tolerance.

Comments welcome; however please ensure that the cpufreq development list at [email protected] receives a copy of all comments.

 include/linux/cpufreq.h |   94 ++++++++
 kernel/Makefile         |    3
 kernel/cpufreq.c        |  536 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 632 insertions, 1 deletion
kernel/Makefile +2 -1
diff -urN orig/kernel/Makefile linux/kernel/Makefile
@@ -10,7 +10,7 @@
 O_TARGET := kernel.o
 
 export-objs = signal.o sys.o kmod.o context.o ksyms.o pm.o exec_domain.o \
-		printk.o platform.o suspend.o
+	      printk.o platform.o suspend.o cpufreq.o
 
 obj-y     = sched.o dma.o fork.o exec_domain.o panic.o printk.o \
 	    module.o exit.o itimer.o info.o time.o softirq.o resource.o \
@@ -17,6 +17,7 @@
 	    sysctl.o capability.o ptrace.o timer.o user.o \
 	    signal.o sys.o kmod.o context.o futex.o platform.o
 
+obj-$(CONFIG_CPU_FREQ) += cpufreq.o
 obj-$(CONFIG_UID16) += uid16.o
 obj-$(CONFIG_MODULES) += ksyms.o
 obj-$(CONFIG_PM) += pm.o
kernel/cpufreq.c +536 -0

536 lines not on this page · raw message

include/linux/cpufreq.h renamed from incldue/linux/cpufreq.h +94 -0

94 lines not on this page · raw message

Signature · 2 lines
Russell King ([email protected])                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html
#1 lore raw

Hi Russell,

include/linux/cpufreq.h line 42

Quoted 11 lines

...

include/linux/cpufreq.h renamed from incldue/linux/cpufreq.h +4 -0
...
+#ifndef CONFIG_SMP
...
+#else
...
+#error fill in SMP version
+#endif
...

this means that it's impossible to compile it into a kernel with CONFIG_SMP enabled. Are there any plans to fix this?

TIA
Adrian

Signature · 3 lines
You only think this is a free country. Like the US the UK spends a lot of
time explaining its a free country because its a police state.
								Alan Cox
#2 lore raw
In reply to Russell King

Hi!

Quoted 5 lines

+/*
+ * cpufreq_max command line parameter. Use:
+ * cpufreq=59000-221000
+ * to set the CPU frequency to 59 to 221MHz.
+ */

I guess this comment went out of date.

Pavel

Signature · 2 lines
Philips Velo 1: 1"x4"x8", 300gram, 60, 12MB, 40bogomips, linux, mutt,
details at http://atrey.karlin.mff.cuni.cz/~pavel/velo/index.html.
#3 lore raw
In reply to Russell King
Quoted 9 lines · Pavel Machek

Hi!

Quoted 5 lines

+/*
+ * cpufreq_max command line parameter. Use:
+ * cpufreq=59000-221000
+ * to set the CPU frequency to 59 to 221MHz.
+ */

I guess this comment went out of date.

I am not sure, but I think this is for ARM arch.

Signature · 3 lines
Ducrot Bruno
http://www.poupinou.org        Page profaissionelle
http://toto.tu-me-saoules.com  Haume page