Module Name: src
Committed By: snj
Date: Sun Feb 8 22:09:27 UTC 2015
Modified Files:
src/distrib/utils/embedded/conf [netbsd-7]: rpi.conf
Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #496):
distrib/utils/embedded/conf/rpi.conf: revision 1.25
By default, RPI firmware sets the max CPU frequency to 600MHz. This can be
overridden by setting arm_freq in config.txt, but the default freq at boot
is still 600MHz.
Add logic to rc.local to compare the current vs. max CPU frequency; if they
differ, set the target frequency to the maximum.
To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.24.4.1 src/distrib/utils/embedded/conf/rpi.conf
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/distrib/utils/embedded/conf/rpi.conf
diff -u src/distrib/utils/embedded/conf/rpi.conf:1.24 src/distrib/utils/embedded/conf/rpi.conf:1.24.4.1
--- src/distrib/utils/embedded/conf/rpi.conf:1.24 Thu Nov 28 13:39:18 2013
+++ src/distrib/utils/embedded/conf/rpi.conf Sun Feb 8 22:09:27 2015
@@ -1,4 +1,4 @@
-# $NetBSD: rpi.conf,v 1.24 2013/11/28 13:39:18 skrll Exp $
+# $NetBSD: rpi.conf,v 1.24.4.1 2015/02/08 22:09:27 snj Exp $
# Raspberry Pi customization script used by mkimage
#
@@ -29,6 +29,22 @@ wscons=YES
devpubd=YES
EOF
+ #
+ # If arm_freq is specified in config.txt, set CPU frequency
+ # to match at boot time.
+ #
+ cp ${release}/etc/rc.local ${mnt}/etc/rc.local
+ cat > /tmp/a << EOF
+if /sbin/sysctl -q machdep.cpu.frequency.max; then
+ cpufreq_max=\$(/sbin/sysctl -n machdep.cpu.frequency.max)
+ cpufreq_cur=\$(/sbin/sysctl -n machdep.cpu.frequency.current)
+ if [ ! "\$cpufreq_max" = "\$cpufreq_cur" ]; then
+ /sbin/sysctl -w machdep.cpu.frequency.target=\$cpufreq_max
+ fi
+fi
+EOF
+ echo "./etc/rc.local type=file uname=root gname=wheel mode=0644" \
+ >> "$tmp/selected_sets"
}
populate() {