|
As already said: I started to prepare something like this prior to arrival of the 1st OPi PC -- see below. The goal is to walk through all possible combinations, adjust settings, exchange script.bin, reboot and test again.
Thanks to you I discovered that my setup was crap (headless) and you've also take into account that one H3 behaves like this and another like that (you can read in the linux-sunxi archives about stuff like this when they started a few years back with Cubieboards and rolled out a few voltage settings that worked reliable on all dev's boards but not in the wild). So stable settings here and there should be compared and sane voltage adjustments (increase) applied. But what we know right now is simple: Even if we don't decrease voltages to the minimum it already helps defining a few additional OPPs (and limiting cpufreq to 1.2 GHz) for H3 based Orange Pis to solve many of the thermal/stability issues users suffer from.
Still work in progress and that's just a really early stub (to get the idea what's different when you want to have a script run unattended over hours with lots of reboots in between):
- #!/bin/bash
- #
- # dvfs-check.sh
- #
- # This script needs a fex file suitable for sunxi-3.3/3.4 kernels containing dvfs operating
- # points and starts to test lower voltage settings for each specified cpufrequency by
- # continually decreasing the voltage in steps of 20mV until cpufreq-ljt-stress-test reports
- # the first error.
- #
- # Since the whole attempt requires modifiying script.bin and restarting afterwards the script
- # has to be called from /etc/rc.local (or as a daemon when distros are used that don't know
- # rc.local). Logging and error reporting happen to syslog.
- #
- # Add prior to "exit 0" in /etc/rc.local: /path/to/dvfs-check.sh &
- #
- # prerequisits:
- # - ensure that [/media]/boot gets mounted (/etc/fstab)
- # - ensure that script.bin is the right place to write otherwise adjust in the script
- # - ensure that $PATH contains the location of fex2bin, cpuburn-a7 and cpufreq-ljt-stress-test
- # - install RPi-Monitor with the appropriate H3 template
- # - a master fex file ${MyFex} points to that contains LV entries in usual order: LV1 being
- # the highest clockspeed and decreasing from then on
- # Results:
- #
- # The file specified in ${MyResults} should contain for every specified cpufreq a single
- # line containing all tested voltages tab separated. The first voltage that leads to errors
- # will be marked with "-FAILED"
- export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
- MyFex="/Users/tk/Documents/Projekte/aktuell/Mini-Server-Buch/Orange Pi PC/dvfs test/basis.fex"
- MyScriptBin="/boot/script.bin"
- MyResults="/Users/tk/Documents/Projekte/aktuell/Mini-Server-Buch/Orange Pi PC/dvfs test/results.txt"
- MyCommandFile="/Users/tk/Documents/Projekte/aktuell/Mini-Server-Buch/Orange Pi PC/dvfs test/next.test"
- Main() {
- if [ ! -f "${MyCommandFile}" ]; then
- # start from scratch
- export LastFreq=0
- export LastVoltage=100000000
- NextFreq=$(GetNextCpuFreq)
- NextVoltage=$(GetNextVoltage)
- echo -e "${NextFreq}\t${NextVoltage}" >"${MyCommandFile}" || (logger -t "dvfs-check" -s "Could not write command file ${MyCommandFile}. Exiting"; exit 1)
-
-
- logger -t "dvfs-check" "Preparing $(( ${NextFreq} / 1000000 ))MHz@${NextVoltage}mV test"
- fi
- } # Main
- GetNextCpuFreq() {
- # This function walks through availabe dvfs entries in the fex file and chooses the next
- # one compared to $1
-
- # walk through defined dvfs operating points from lowest freq to highest
- grep "^LV._freq" "${MyFex}" | sort -r | while read ; do
- set ${REPLY}
- CPUFreq=$3
- if [ ${CPUFreq} -gt ${LastFreq} ]; then
- echo -n ${CPUFreq}
- break
- fi
- done
- } # GetNextCpuFreq
- GetNextVoltage() {
- # this function tries to get the next voltage setting to test for cpufreq $1
- if [ ${LastVoltage} -eq 100000000 ]; then
- } # GetNextVoltage
- Main
Copy code
|
|