add pi2 overclock preset and ask to reboot after devicetree change

This commit is contained in:
Alex Bradbury 2015-01-31 20:18:38 +00:00
parent 55d1daad79
commit 4ee1fde44e

View File

@ -285,6 +285,7 @@ See http://elinux.org/RPi_Overclocking for more information.\
"Medium" "900MHz ARM, 250MHz core, 450MHz SDRAM, 2 overvolt" \
"High" "950MHz ARM, 250MHz core, 450MHz SDRAM, 6 overvolt" \
"Turbo" "1000MHz ARM, 500MHz core, 600MHz SDRAM, 6 overvolt" \
"Pi2" "1000MHz ARM, 500MHz core, 500MHz SDRAM, 2 overvolt" \
3>&1 1>&2 2>&3)
if [ $? -eq 0 ]; then
case "$OVERCLOCK" in
@ -303,6 +304,9 @@ See http://elinux.org/RPi_Overclocking for more information.\
Turbo)
set_overclock Turbo 1000 500 600 6
;;
Pi2)
set_overclock Pi2 1000 500 500 2
;;
*)
whiptail --msgbox "Programmer error, unrecognised overclock preset" 20 60 2
return 1
@ -369,6 +373,7 @@ do_devicetree() {
if [ $SETTING != $CURRENT_SETTING ]; then
TENSE="will be"
REBOOT=" after a reboot"
ASK_TO_REBOOT=1
fi
whiptail --msgbox "Device Tree $TENSE $SETTING$REBOOT" 20 60 1
}
@ -404,6 +409,7 @@ do_spi() {
if [ $SETTING != $CURRENT_SETTING ]; then
TENSE="will be"
REBOOT=" after a reboot"
ASK_TO_REBOOT=1
fi
sed $CONFIG -i -r -e "s/^((device_tree_param|dtparam)=([^,]*,)*spi)(=[^,]*)?/\1=$SETTING/"
if ! grep -q -E "^(device_tree_param|dtparam)=([^,]*,)*spi=[^,]*" $CONFIG; then
@ -422,6 +428,10 @@ do_spi() {
DEFAULT=--defaultno
fi
if ! [ -e $BLACKLIST ]; then
touch $BLACKLIST
fi
whiptail --yesno "Would you like the SPI kernel module to be loaded by default?" $DEFAULT 20 60 2
RET=$?
if [ $RET -eq 0 ]; then
@ -470,6 +480,7 @@ do_i2c() {
if [ $SETTING != $CURRENT_SETTING ]; then
TENSE="will be"
REBOOT=" after a reboot"
ASK_TO_REBOOT=1
fi
sed $CONFIG -i -r -e "s/^((device_tree_param|dtparam)=([^,]*,)*i2c(_arm)?)(=[^,]*)?/\1=$SETTING/"
if ! grep -q -E "^(device_tree_param|dtparam)=([^,]*,)*i2c(_arm)?=[^,]*" $CONFIG; then
@ -488,6 +499,10 @@ do_i2c() {
DEFAULT=--defaultno
fi
if ! [ -e $BLACKLIST ]; then
touch $BLACKLIST
fi
whiptail --yesno "Would you like the I2C kernel module to be loaded by default?" $DEFAULT 20 60 2
RET=$?
if [ $RET -eq 0 ]; then