autocore: add bcm53xx support

This commit is contained in:
CN_SZTL 2020-08-23 23:31:16 +08:00
parent 28f7305a73
commit c7e6a991ff
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
2 changed files with 9 additions and 2 deletions

View File

@ -16,7 +16,9 @@ include $(INCLUDE_DIR)/package.mk
define Package/autocore-arm
TITLE:=Arm auto core loadbalance script.
MAINTAINER:=CN_SZTL
DEPENDS:=@(TARGET_bcm27xx||TARGET_ipq40xx||TARGET_ipq806x) +TARGET_ipq40xx:lm-sensors
DEPENDS:=@(TARGET_bcm27xx||TARGET_bcm53xx||TARGET_ipq40xx||TARGET_ipq806x) \
+TARGET_bcm53xx:nvram \
+TARGET_ipq40xx:lm-sensors
VARIANT:=arm
endef

View File

@ -4,7 +4,12 @@ cpu_arch="$(cat "/proc/cpuinfo" | grep "model name" | sed -n "1p" | awk -F ': '
[ -z "${cpu_arch}" ] && cpu_arch="ARMv8 Processor"
cpu_cores="$(cat "/proc/cpuinfo" | grep "processor" | wc -l)"
cpu_freq="$(expr $(cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq) / 1000)MHz"
if grep -q "bcm53xx" "/etc/openwrt_release"; then
cpu_freq="$(nvram get clkfreq | awk -F ',' '{print $1}')MHz"
else
cpu_freq="$(expr $(cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq) / 1000)MHz"
fi
if grep -q "ipq40xx" "/etc/openwrt_release"; then
sys_temp="$(sensors | grep -Eo '\+[0-9]+.+C' | sed ':a;N;$!ba;s/\n/ /g;s/+//g')"
else