Skip to content

Commit

Permalink
autocore: use mhz to calc cpufreq for ipq807x
Browse files Browse the repository at this point in the history
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
  • Loading branch information
1715173329 committed Oct 20, 2022
1 parent f24b52c commit 4c22c08
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions package/emortal/autocore/Makefile
Expand Up @@ -11,7 +11,8 @@ PKG_RELEASE:=$(COMMITCOUNT)

PKG_CONFIG_DEPENDS:= \
CONFIG_TARGET_bcm27xx \
CONFIG_TARGET_bcm53xx
CONFIG_TARGET_bcm53xx \
CONFIG_TARGET_ipq807x

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/target.mk
Expand All @@ -21,7 +22,8 @@ define Package/autocore-arm
MAINTAINER:=CN_SZTL
DEPENDS:=@(arm||aarch64) \
+TARGET_bcm27xx:bcm27xx-userland \
+TARGET_bcm53xx:nvram
+TARGET_bcm53xx:nvram \
+TARGET_ipq807x:mhz
VARIANT:=arm
endef

Expand Down
5 changes: 3 additions & 2 deletions package/emortal/autocore/files/generic/cpuinfo
Expand Up @@ -23,9 +23,10 @@ case "$DISTRIB_TARGET" in
cpu_freq="$(nvram get clkfreq | awk -F ',' '{print $1}')MHz" ;;
"mvebu"/*)
cpu_freq="$(awk -F ': ' '/BogoMIPS/ {print $2}' "$CPUINFO_PATH" | head -n1)MHz" ;;
"ipq807x"/*)
cpu_freq="$(mhz | awk -F 'cpu_MHz=' '{printf("%.fMHz",$2)}')" ;;
"x86"/*)
cpu_freq="$(awk -F ': ' '/MHz/ {print $2}' "$CPUINFO_PATH" | head -n1)MHz"
;;
cpu_freq="$(awk -F ': ' '/MHz/ {print $2}' "$CPUINFO_PATH" | head -n1)MHz" ;;
*)
[ ! -e "$CPUFREQ_PATH/policy0/cpuinfo_cur_freq" ] || \
cpu_freq="$(awk '{printf("%.fMHz", $0 / 1000)}' "$CPUFREQ_PATH/policy0/cpuinfo_cur_freq")"
Expand Down

0 comments on commit 4c22c08

Please sign in to comment.