C&P of change in rpi.conf (maybe factor out)
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.
This commit is contained in:
parent
7a6a862a20
commit
8a25fadb3b
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: armv7.conf,v 1.9 2015/12/13 23:02:56 jmcneill Exp $
|
||||
# $NetBSD: armv7.conf,v 1.10 2015/12/19 14:57:49 skrll Exp $
|
||||
# ARMv7 customization script used by mkimage
|
||||
#
|
||||
board=armv7
|
||||
|
@ -73,6 +73,23 @@ EOF
|
|||
)
|
||||
|
||||
fi
|
||||
|
||||
#
|
||||
# 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 >> ${mnt}/etc/rc.local << 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_amlogic() {
|
||||
|
|
Loading…
Reference in New Issue