summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog9
-rw-r--r--debian/control1
-rw-r--r--debian/ubuntu-vexpress-extras-config.upstart46
3 files changed, 36 insertions, 20 deletions
diff --git a/debian/changelog b/debian/changelog
index feef09e..8b3735c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+ubuntu-vexpress-extras-config (0.4) quantal; urgency=low
+
+ * Update upstart script to be smart about detecting CPU core types
+ when setting the cpufreq governor.
+ * Drop Vcs-Bzr entry from control file as I can't be bothered with the
+ hassle of using bazaar.
+
+ -- Jon Medhurst (Tixy) <jon.medhurst@linaro.org> Fri, 22 Feb 2013 14:19:00 +0000
+
ubuntu-vexpress-extras-config (0.3) quantal; urgency=low
* Update postinst/postrm scripts to disable cpufrequtils so it
diff --git a/debian/control b/debian/control
index 6aeef8d..677eddb 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,6 @@ Priority: extra
Maintainer: Linaro Developers <linaro-dev@lists.linaro.org>
Build-Depends: debhelper (>= 9)
Standards-Version: 3.9.3
-Vcs-Bzr: https://code.launchpad.net/~linaro-maintainers/linaro-ubuntu/ubuntu-vexpress-extras-config
Package: ubuntu-vexpress-extras-config
Architecture: all
diff --git a/debian/ubuntu-vexpress-extras-config.upstart b/debian/ubuntu-vexpress-extras-config.upstart
index f0aa4c0..6920736 100644
--- a/debian/ubuntu-vexpress-extras-config.upstart
+++ b/debian/ubuntu-vexpress-extras-config.upstart
@@ -5,23 +5,31 @@ task
script
# Setup cpufeq
#
- # We want to setup big cores to 'performance' and LITTLE cores
- # to 'ondemand' but currently there isn't any way to determine
- # which is which. So what we'll do for now is:
- # a) assume that N big cores are numbered 0..N-1 and LITTLE
- # cores are N..
- # b) assume that N<=4
- # c) all cores in a cluster have the same cpufreq driver, so
- # that setting the frequency of one CPU also sets the others.
- # With these assumptions, the following will set the LITTLE
- # cluster to 'ondemand' then set the big cluster to
- # 'performance'.
- # Note, no non-big.LITTLE boards support cpufreq so this will
- # have no effect on them.
- #
- echo "ondemand" > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor 2>/dev/null || true
- echo "ondemand" > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor 2>/dev/null || true
- echo "ondemand" > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor 2>/dev/null || true
- echo "ondemand" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor 2>/dev/null || true
- echo "performance" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 2>/dev/null || true
+ # On big.LITTLE we want to setup big cores to 'performance' and LITTLE cores
+ # to 'ondemand'. We assume other systems don't support cpufreq and so are
+ # unaffected by what we do here...
+
+ set_governor_for_cores() {
+ part_id=${1}
+ governor=${2}
+ IFS=$'\n'
+ for line in `cat /proc/cpuinfo | tr '[:blank:]' ' ' `
+ do
+ cpu_try=`echo "$line" | sed -n -e 's/^processor : \([0-9][0-9]*\)$/\1/p'`
+ if [ -n "$cpu_try" ]
+ then
+ cpu=${cpu_try}
+ else
+ part_id_try=`echo "$line" | sed -n -e 's/^CPU part : \(.*\)$/\1/p'`
+ if [ "$part_id_try" = "$part_id" ]
+ then
+ echo "$governor" > /sys/devices/system/cpu/cpu${cpu}/cpufreq/scaling_governor || true
+ fi
+ fi
+ done
+ }
+
+ set_governor_for_cores 0xc07 ondemand # A7 cores
+ set_governor_for_cores 0xc0f performance # A15 cores
+
end script