wait so the a72s were nerfed the whole time???

i literally just found out another probably important thing about my pinebook pro, which is that the cpufreq driver for the big cluster (2x cortex a72) was limiting them to ~400mhz, for unknown reasons. so i've actually been running the pinebook pro for months, this whole time, with practically no big cluster

fix for this is pretty easy, just echo the real max frequency (1.8ghz) into the /sys node. i did notice with the big cluster properly scaled up things do seem a bit more snappy. if y(ou have a pinebook pro you should probably check this

$ cat /sys/devices/system/cpu/cpufreq/policy4/scaling_max_freq

if it says 1800000 you're good to go. if not, echo 1800000 into the node -- you'll need to do this every boot, so i integrated it into TLP. here's a snippet from my current modifications to TLP that makes sure that on AC power both clusters are operating at maximum possible performance

EDIT: there's a patch for certain distros' linux kernel that enables an "unsupported" 2.0 GHz operating frequency, so your number might need to be 2000000. i'm going to probably change my kernel/device tree to include this patch1

echo 1416000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq
echo 1800000 > /sys/devices/system/cpu/cpufreq/policy4/scaling_max_freq
echo performance > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
echo performance > /sys/devices/system/cpu/cpufreq/policy4/scaling_governor

and here's my full current TLP patch file which includes control of the cpu and gpu scaling in a kind of nonportable manner (i manually edited this patch so it may be a bit wacky,)

on battery power, i switch the cpus to ondemand (scaling based on cpu load) and the gpu to simple_ondemand which i believe similarly scales clock frequency based on utilization

EDIT: on second thought i changed the governors on battery power from schedutil/powersave to ondemand for both clusters

From 4bb0a5937fb55e3fb0eea4bae081b78215ef1e5f Mon Sep 17 00:00:00 2001
From: haskal <haskal@awoo.systems>
Date: Sun, 20 Sep 2020 01:48:02 -0400
Subject: [PATCH] add pinebook-pro-specifc power management

---
 tlp.in | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/tlp.in b/tlp.in
index 2d36c87..059a052 100644
--- a/tlp.in
+++ b/tlp.in
@@ -42,6 +42,23 @@ apply_common_settings () { # apply settings common to all modes
     set_sound_power_mode $1
     set_runtime_pm $1
 
+    # pinebook pro mods
+    # set the GPU scaling to performance/powersave mode
+    # ensure CPU scaling is configured and set to performance/powersave
+    if [ "$1" == "0" ]; then
+        echo performance > /sys/class/devfreq/ff9a0000.gpu/governor
+        # enable max frequencies
+        echo 1416000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq
+        echo 1800000 > /sys/devices/system/cpu/cpufreq/policy4/scaling_max_freq
+        echo performance > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
+        echo performance > /sys/devices/system/cpu/cpufreq/policy4/scaling_governor
+    else
+        echo simple_ondemand > /sys/class/devfreq/ff9a0000.gpu/governor
+        echo ondemand > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
+        echo ondemand > /sys/devices/system/cpu/cpufreq/policy4/scaling_governor
+    fi
+    # end pinebook pro mods
+
     return 0
 }
 
-- 
2.28.0

because TLP is awful archware i'm seriously considering writing power management software specifically for the pinebook pro to replace TLP and help you apply better power profiles tuned to the pinebook pro hardware. i'd also add the feature to control hardware wakeup sources because i have to admit the laptop waking itself every time you plug or unplug power or move a the bluetooth mouse is pretty annoying2. ideally, i'd also add the ability to have more profiles than just "battery" or "AC" -- there could be a range of profiles from "conserve all possible power" to "enable maximum performance" depending on what you're working on and how long you need the battery to last


2

if you look for power subdirectories in /sys you can find wakeup nodes for various devices. echoing disabled into these nodes will disable that device as a wakeup source. i'd ideally restrict the default set of wakeup sources to the keyboard, lid switch, battery, and rtc. having proper power management software for this would be nice though

1

as i've ranted about before, the pine64 philosophy of not ever dealing with software directly makes this really difficult. tracking down this patch was annoying, and i wish pine64 had a canonical "mainline-with-patches" kernel instead of every distro tracking their own kernel versions with their own set of patches -- both BSP and mainline. the fragmentation in this space is really unnecessary