diff --git a/board/common/rootfs/bin/load.sh b/board/common/rootfs/bin/load.sh new file mode 100755 index 00000000..a678cb06 --- /dev/null +++ b/board/common/rootfs/bin/load.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +sleep 30 + +stress-ng --cpu 8 --io 4 --vm 2 --vm-bytes 128M --fork 4 -t 0 diff --git a/board/common/rootfs/bin/temp.sh b/board/common/rootfs/bin/temp.sh new file mode 100755 index 00000000..5f32c6f1 --- /dev/null +++ b/board/common/rootfs/bin/temp.sh @@ -0,0 +1,76 @@ +#!/bin/sh + +tstamp() +{ + if [ "$1" = "head" ]; then + printf '%9s' time + else + printf '%9s' $(date +%T) + fi +} + +thermal() +{ + for th in /sys/class/thermal/thermal_zone*; do + if [ "$1" = "head" ]; then + printf '%5s' $(cat $th/type | \ + sed -e 's/-thermal//' -e 's/ap-cpu/cpu/' -e 's/-ic//') + else + printf '%5d' \ + $((($(cat $th/temp) + 500) / 1000)) + fi + done +} + + +hwmon() +{ + for hw in /sys/class/hwmon/*; do + [ -f $hw/temp1_input ] || continue + + if [ "$1" = "head" ]; then + printf '%5s' \ + $(cat $hw/name | sed -e 's/cp0configspacef2000000mdio12a200switch0mdio0/p/' -e 's/f212a600mdiomii0/xp/') + else + printf '%5d' \ + $((($(cat $hw/temp1_input) + 500) / 1000)) + fi + done +} + +xphys() +{ + for xphy in 4 5; do + mdio f212a6* $xphy:31 0xf08a 0x4d00 + + if [ "$1" = "head" ]; then + printf '%5s' \ + p$((xphy + 5)) + else + printf '%5d' \ + $(($(mdio f212a6* $xphy:31 0xf08a) & 0xff - 75)) + fi + done +} + +if [ "$1" != "-H" ]; then +# tstamp head + thermal head + hwmon head +# xphys head + echo +fi + +while :; do +# tstamp + thermal + hwmon +# xphys + echo + + if [ "$1" == "-n" ]; then + sleep ${2:-10} + else + break + fi +done diff --git a/board/common/rootfs/etc/finit.d/available/temp.conf b/board/common/rootfs/etc/finit.d/available/temp.conf new file mode 100644 index 00000000..9eea7461 --- /dev/null +++ b/board/common/rootfs/etc/finit.d/available/temp.conf @@ -0,0 +1,3 @@ +service [2345789] log:/var/log/temp.log /bin/temp.sh -n 10 -- Temperature monitor +service [2345789] log:/var/log/load.log /bin/load.sh -- CPU load generator +service [2345789] log:/var/log/memtester.log /usr/bin/memtester 1G -- Memory load generator diff --git a/board/common/rootfs/etc/finit.d/enabled/temp.conf b/board/common/rootfs/etc/finit.d/enabled/temp.conf new file mode 120000 index 00000000..64989651 --- /dev/null +++ b/board/common/rootfs/etc/finit.d/enabled/temp.conf @@ -0,0 +1 @@ +../available/temp.conf \ No newline at end of file diff --git a/configs/aarch64_defconfig b/configs/aarch64_defconfig index 11543b60..2423bfd3 100644 --- a/configs/aarch64_defconfig +++ b/configs/aarch64_defconfig @@ -47,6 +47,7 @@ BR2_PACKAGE_EUDEV_RULES_GEN=y BR2_PACKAGE_GPTFDISK=y BR2_PACKAGE_GPTFDISK_SGDISK=y BR2_PACKAGE_MDIO_TOOLS=y +BR2_PACKAGE_MEMTESTER=y BR2_PACKAGE_RNG_TOOLS=y BR2_PACKAGE_UBOOT_TOOLS=y BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT=y