From 1e36f5d11ccbcb12ed4dec227dda2cead53ccb4d Mon Sep 17 00:00:00 2001 From: CN_SZTL <22235437+1715173329@users.noreply.github.com> Date: Sat, 14 Nov 2020 00:52:55 +0800 Subject: [PATCH] autocore-arm: add support for mvebu (#5781) Co-authored-by: 486057 <4860575@qq.com> --- package/lean/autocore/Makefile | 2 +- package/lean/autocore/files/arm/sbin/cpuinfo | 2 ++ target/linux/mvebu/Makefile | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package/lean/autocore/Makefile b/package/lean/autocore/Makefile index 2c2ea5dbb..1c0bb7428 100644 --- a/package/lean/autocore/Makefile +++ b/package/lean/autocore/Makefile @@ -16,7 +16,7 @@ include $(INCLUDE_DIR)/package.mk define Package/autocore-arm TITLE:=Arm auto core loadbalance script. MAINTAINER:=CN_SZTL - DEPENDS:=@(TARGET_bcm27xx||TARGET_bcm53xx||TARGET_ipq40xx||TARGET_ipq806x||TARGET_rockchip) \ + DEPENDS:=@(TARGET_bcm27xx||TARGET_bcm53xx||TARGET_mvebu||TARGET_ipq40xx||TARGET_ipq806x||TARGET_rockchip) \ +TARGET_bcm53xx:nvram \ +TARGET_ipq40xx:lm-sensors VARIANT:=arm diff --git a/package/lean/autocore/files/arm/sbin/cpuinfo b/package/lean/autocore/files/arm/sbin/cpuinfo index 3b870290d..5a525a58c 100755 --- a/package/lean/autocore/files/arm/sbin/cpuinfo +++ b/package/lean/autocore/files/arm/sbin/cpuinfo @@ -6,6 +6,8 @@ cpu_cores="$(cat "/proc/cpuinfo" | grep "processor" | wc -l)" if grep -q "bcm53xx" "/etc/openwrt_release"; then cpu_freq="$(nvram get clkfreq | awk -F ',' '{print $1}')MHz" +elif grep -q "mvebu" "/etc/openwrt_release"; then + cpu_freq="$(cat "/proc/cpuinfo" | grep "BogoMIPS" | sed -n "1p" | awk -F ': ' '{print $2}')MHz" else cpu_freq="$(expr $(cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq) / 1000)MHz" fi diff --git a/target/linux/mvebu/Makefile b/target/linux/mvebu/Makefile index b9a6a79fe..b8055891e 100644 --- a/target/linux/mvebu/Makefile +++ b/target/linux/mvebu/Makefile @@ -16,6 +16,7 @@ KERNEL_TESTING_PATCHVER:=5.4 include $(INCLUDE_DIR)/target.mk -DEFAULT_PACKAGES += uboot-envtools kmod-gpio-button-hotplug +DEFAULT_PACKAGES += uboot-envtools kmod-gpio-button-hotplug \ + autocore-arm $(eval $(call BuildTarget))