From 00417197dd326160a3b7c054d941782312c86a8a Mon Sep 17 00:00:00 2001 From: Gauthier Provost Date: Thu, 3 Jan 2019 17:31:05 +0800 Subject: [PATCH 1/3] [ helios4 ] Add correct cesa module in /etc/modules --- config/boards/helios4.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/boards/helios4.conf b/config/boards/helios4.conf index fb77426c32..c711d1f875 100644 --- a/config/boards/helios4.conf +++ b/config/boards/helios4.conf @@ -3,7 +3,8 @@ BOARD_NAME="Helios4" BOARDFAMILY="mvebu" BOOTCONFIG="armada_38x_helios4_config" BOOTCONFIG_NEXT="helios4_defconfig" -MODULES="mv_cesa" +MODULES="marvell_cesa" +MODULES_NEXT="marvell_cesa" BUILD_DESKTOP="no" FORCE_BOOTSCRIPT_UPDATE="yes" From 128000e8c978f05b081774dbba0430ac3100748b Mon Sep 17 00:00:00 2001 From: Gauthier Provost Date: Fri, 4 Jan 2019 23:55:05 +0800 Subject: [PATCH 2/3] [ helios4 ] Improve temperature reading. Issue #1135 * Use mvebu thermal_zone0 as temp source for armbianmonitor * Remove -20C tweak * Add ambient temp source to motd --- .../etc/update-motd.d/30-armbian-sysinfo | 37 ++++++++++--------- .../usr/lib/armbian/armbian-hardware-monitor | 9 ++++- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/packages/bsp/common/etc/update-motd.d/30-armbian-sysinfo b/packages/bsp/common/etc/update-motd.d/30-armbian-sysinfo index 22db3bd4f4..e58eba156d 100755 --- a/packages/bsp/common/etc/update-motd.d/30-armbian-sysinfo +++ b/packages/bsp/common/etc/update-motd.d/30-armbian-sysinfo @@ -45,10 +45,7 @@ function getboardtemp() { # Allwinner legacy kernels output degree C board_temp=${raw_temp} else - # Marvell gets special treatment for whatever reasons - grep -qi Marvell /proc/cpuinfo && \ - board_temp=$(( $(awk '{printf("%d",$1/1000)}' <<<${raw_temp}) - 20 )) || \ - board_temp=$(awk '{printf("%d",$1/1000)}' <<<${raw_temp}) + board_temp=$(awk '{printf("%d",$1/1000)}' <<<${raw_temp}) fi elif [ -f /etc/armbianmonitor/datasources/pmictemp ]; then # fallback to PMIC temperature @@ -91,20 +88,26 @@ function batteryinfo() { } # batteryinfo function ambienttemp() { - # read ambient temperature from USB device if available - if [[ ! -f /usr/bin/temper ]]; then - echo "" - return - fi - amb_temp=$(temper -c 2>/dev/null) - case ${amb_temp} in - *"find the USB device"*) + if [ -f /etc/armbianmonitor/datasources/ambienttemp ]; then + read raw_temp /dev/null + amb_temp=$(awk '{printf("%d",$1/1000)}' <<<${raw_temp}) + echo $amb_temp + else + # read ambient temperature from USB device if available + if [[ ! -f /usr/bin/temper ]]; then echo "" - ;; - *) - amb_temp=$(awk '{print $NF}' <<<$amb_temp | sed 's/C//g') - echo -n "scale=1;${amb_temp}/1" | grep -oE "\-?[[:digit:]]+\.[[:digit:]]" - esac + return + fi + amb_temp=$(temper -c 2>/dev/null) + case ${amb_temp} in + *"find the USB device"*) + echo "" + ;; + *) + amb_temp=$(awk '{print $NF}' <<<$amb_temp | sed 's/C//g') + echo -n "scale=1;${amb_temp}/1" | grep -oE "\-?[[:digit:]]+\.[[:digit:]]" + esac + fi } # ambienttemp #function get_ip_addresses() { diff --git a/packages/bsp/common/usr/lib/armbian/armbian-hardware-monitor b/packages/bsp/common/usr/lib/armbian/armbian-hardware-monitor index a499a1445f..2056c0b513 100755 --- a/packages/bsp/common/usr/lib/armbian/armbian-hardware-monitor +++ b/packages/bsp/common/usr/lib/armbian/armbian-hardware-monitor @@ -40,7 +40,7 @@ prepare_temp_monitoring() { if [[ -d "/sys/devices/platform/a20-tp-hwmon" ]]; then # sun7i legacy ln -fs /sys/devices/platform/a20-tp-hwmon/temp1_input /etc/armbianmonitor/datasources/soctemp - elif [[ -f /sys/class/hwmon/hwmon0/temp1_input ]]; then + elif [[ -f /sys/class/hwmon/hwmon0/temp1_input && ${BOARDFAMILY} != "mvebu" ]]; then # usual convention with modern kernels ln -fs /sys/class/hwmon/hwmon0/temp1_input /etc/armbianmonitor/datasources/soctemp else @@ -48,6 +48,11 @@ prepare_temp_monitoring() { [[ ${BOARDFAMILY} == s500 ]] && THERMAL_ZONE="thermal_zone1" || THERMAL_ZONE="thermal_zone0" ln -fs /sys/devices/virtual/thermal/${THERMAL_ZONE}/temp /etc/armbianmonitor/datasources/soctemp fi + + # Ambient temp + if [[ ${BOARD} == "helios4" && -f /sys/class/hwmon/hwmon4/temp1_input ]]; then + ln -fs /sys/class/hwmon/hwmon4/temp1_input /etc/armbianmonitor/datasources/ambienttemp + fi } # prepare_temp_monitoring log_hardware_info() { @@ -136,7 +141,7 @@ case $1 in *start*) # check sd card speed once on 3rd boot too warn for too slow media check_sd_card_speed & - + # prepare correct temperature readouts prepare_temp_monitoring & From 795efc6e79f65d5b94581fdb3dcc07ac91339849 Mon Sep 17 00:00:00 2001 From: Gauthier Provost Date: Tue, 8 Jan 2019 12:55:01 +0800 Subject: [PATCH 3/3] [ helios4 ] Use a more deterministic path for ambient source temp. --- packages/bsp/common/usr/lib/armbian/armbian-hardware-monitor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/bsp/common/usr/lib/armbian/armbian-hardware-monitor b/packages/bsp/common/usr/lib/armbian/armbian-hardware-monitor index 2056c0b513..7a13d3f295 100755 --- a/packages/bsp/common/usr/lib/armbian/armbian-hardware-monitor +++ b/packages/bsp/common/usr/lib/armbian/armbian-hardware-monitor @@ -50,8 +50,8 @@ prepare_temp_monitoring() { fi # Ambient temp - if [[ ${BOARD} == "helios4" && -f /sys/class/hwmon/hwmon4/temp1_input ]]; then - ln -fs /sys/class/hwmon/hwmon4/temp1_input /etc/armbianmonitor/datasources/ambienttemp + if [[ ${BOARD} == "helios4" && -f /dev/thermal-board/temp1_input ]]; then + ln -fs /dev/thermal-board/temp1_input /etc/armbianmonitor/datasources/ambienttemp fi } # prepare_temp_monitoring