Fixes for BPi M2+, integrate corekeeper.sh to bring back killed CPU cores

This commit is contained in:
ThomasKaiser
2016-04-06 20:16:12 +02:00
parent e51da6d355
commit f0da43ba96
6 changed files with 46 additions and 5582 deletions

View File

@@ -398,9 +398,11 @@ _EOF_
fi fi
# h3disp for sun8i/3.4.x # h3disp/sun8i-corekeeper.sh for sun8i/3.4.x
if [ "$BOARD" = "orangepiplus" -o "$BOARD" = "orangepih3" ]; then if [ "${LINUXFAMILY}" = "sun8i" -a "${BRANCH}" = "default" ]; then
install -m 755 "$SRC/lib/scripts/h3disp" "$CACHEDIR/sdcard/usr/local/bin" install -m 755 "$SRC/lib/scripts/h3disp" "$CACHEDIR/sdcard/usr/local/bin"
install -m 755 "$SRC/lib/scripts/sun8i-corekeeper.sh" "$CACHEDIR/sdcard/usr/local/bin"
sed -i 's|^exit\ 0$|/usr/local/bin/corekeeper.sh \&\n\n&|' "$CACHEDIR/sdcard/etc/rc.local"
fi fi
} }

View File

@@ -370,9 +370,7 @@ gpio_pin_28 = port:PL03<0><default><default><1>
[leds_para] [leds_para]
leds_used = 1 leds_used = 1
green_led = port:PL10<1><default><default><1> red_led = port:PL10<1><default><default><1>
green_led_active_low = 0
red_led = port:PA15<1><default><default><0>
red_led_active_low = 0 red_led_active_low = 0
;---------------------------------------------------------------------------------- ;----------------------------------------------------------------------------------
@@ -390,8 +388,8 @@ red_led_active_low = 0
[ths_para] [ths_para]
ths_used = 1 ths_used = 1
ths_trip1_count = 6 ths_trip1_count = 6
ths_trip1_0 = 70 ths_trip1_0 = 60
ths_trip1_1 = 80 ths_trip1_1 = 75
ths_trip1_2 = 85 ths_trip1_2 = 85
ths_trip1_3 = 90 ths_trip1_3 = 90
ths_trip1_4 = 95 ths_trip1_4 = 95
@@ -420,11 +418,13 @@ ths_trip2_0 = 105
;---------------------------------------------------------------------------------- ;----------------------------------------------------------------------------------
[cooler_table] [cooler_table]
cooler_count = 4 cooler_count = 6
cooler0 = "1200000 4 4294967295 0" cooler0 = "1200000 4 4294967295 0"
cooler1 = "1008000 4 4294967295 0" cooler1 = "912000 4 4294967295 0"
cooler2 = "816000 4 4294967295 0" cooler2 = "720000 4 4294967295 0"
cooler3 = "648000 1 4294967295 0" cooler3 = "648000 4 4294967295 0"
cooler4 = "480000 2 4294967295 0"
cooler5 = "240000 1 4294967295 0"
[nand0_para] [nand0_para]
nand_support_2ch = 0 nand_support_2ch = 0

View File

@@ -1512,6 +1512,11 @@ CONFIG_ATH6KL_USB=m
# CONFIG_B43 is not set # CONFIG_B43 is not set
# CONFIG_B43LEGACY is not set # CONFIG_B43LEGACY is not set
# CONFIG_BCMDHD is not set # CONFIG_BCMDHD is not set
CONFIG_AP6210=m
CONFIG_AP6210_FW_PATH="/lib/firmware/ap6210/fw_bcmxxxx.bin"
CONFIG_AP6210_NVRAM_PATH="/lib/firmware/ap6210/nvram_apxxxx.txt"
CONFIG_AP6210_OOB=y
# CONFIG_AP6210_SDIO_IRQ is not set
CONFIG_BRCMUTIL=m CONFIG_BRCMUTIL=m
CONFIG_BRCMFMAC=m CONFIG_BRCMFMAC=m
CONFIG_BRCMFMAC_SDIO=y CONFIG_BRCMFMAC_SDIO=y
@@ -2517,6 +2522,7 @@ CONFIG_DVB_USB_TECHNISAT_USB2=m
CONFIG_DVB_USB_IT913X=m CONFIG_DVB_USB_IT913X=m
CONFIG_DVB_USB_MXL111SF=m CONFIG_DVB_USB_MXL111SF=m
CONFIG_DVB_USB_RTL28XXU=m CONFIG_DVB_USB_RTL28XXU=m
# CONFIG_DVB_USB_RTL2832U is not set
CONFIG_SMS_SIANO_MDTV=m CONFIG_SMS_SIANO_MDTV=m
# #

View File

@@ -261,7 +261,7 @@ case $BOARD in
BOOTCONFIG="orangepi_plus_defconfig" BOOTCONFIG="orangepi_plus_defconfig"
MODULES="#gpio_sunxi #w1-sunxi #w1-gpio #w1-therm #ap6211" MODULES="#gpio_sunxi #w1-sunxi #w1-gpio #w1-therm #ap6211"
MODULES_NEXT="brcmfmac" MODULES_NEXT="brcmfmac"
CPUMIN="648000" CPUMIN="240000"
CPUMAX="1200000" CPUMAX="1200000"
GOVERNOR="interactive" GOVERNOR="interactive"
CLI_TARGET="%,%" CLI_TARGET="%,%"

File diff suppressed because it is too large Load Diff

26
scripts/sun8i-corekeeper.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/bin/sh
#
# Simple script to enable CPU cores automatically again if cooling state is
# 3 or lower.
#
set -e
get_cooling_state() {
echo $(cat /sys/devices/virtual/thermal/cooling_device0/cur_state)
}
enable_cpu() {
if [ $(cat /sys/devices/system/cpu/cpu$1/online) = 0 ]; then
echo 1 > /sys/devices/system/cpu/cpu$1/online || true
fi
}
while true; do
for c in 0 1 2 3; do
if [ $(get_cooling_state) -le 3 ]; then
enable_cpu $c
fi
done
sleep 5
done