Skip to content

Commit

Permalink
pkg: pine64: linux-megi: upgrade to 6.1.7
Browse files Browse the repository at this point in the history
Signed-off-by: Danct12 <[email protected]>
  • Loading branch information
Danct12 committed Jan 19, 2023
1 parent bcc3ab3 commit ef09f25
Show file tree
Hide file tree
Showing 5 changed files with 339 additions and 134 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
From 4c8fb634216bf73fac117436e1b936557dc97793 Mon Sep 17 00:00:00 2001
From: Samuel Holland <[email protected]>
Date: Sat, 13 Mar 2021 23:54:25 -0600
Subject: [PATCH] arm64: dts: allwinner: a64/h5: Add CPU idle states

Powering off idle CPUs saves about 30 mW compared to using WFI only.
Additional power savings are possible by idling the L2 and downclocking
the cluster when all CPUs are idle.

Entry and exit latency were measured using a logic analyzer, with GPIO
pins toggled in Linux after the calls to trace_cpu_idle() in
cpuidle_enter_state(), and in the power management firmware after CPU
power-off completes and immediately after detecting an interrupt.

800 us and 1500 us are worst-case values, largely driven by the fact
that the power management firmware is single threaded. It can only
handle commands to power off CPUs one at a time, and it cannot process
any commands while powering on a CPU in response to an interrupt.

The cluster suspend process reliably takes 36 us; I rounded this up to
50 us. If all CPUs enter the cluster idle state at the same time, exit
latency is actually reduced, because there is no contention in that
case. However, if only some CPUs enter the cluster idle state, behavior
is the same as for CPU idle.

Polling delay for the power management firmware to detect a pending
interrupt is insignificant; it is less than 20 us.

min-residency was chosen as the point where enabling the idle state
consumed no more average power than disabling the idle state at a
variety of interrupt rates.

Signed-off-by: Samuel Holland <[email protected]>
---
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 26 +++++++++++++++++++
arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi | 26 +++++++++++++++++++
2 files changed, 52 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index cac47cc50..83b198d12 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -61,6 +61,7 @@ cpu0: cpu@0 {
clocks = <&ccu CLK_CPUX>;
clock-names = "cpu";
#cooling-cells = <2>;
+ cpu-idle-states = <&cpu_sleep>, <&cluster_sleep>;
};

cpu1: cpu@1 {
@@ -72,6 +73,7 @@ cpu1: cpu@1 {
clocks = <&ccu CLK_CPUX>;
clock-names = "cpu";
#cooling-cells = <2>;
+ cpu-idle-states = <&cpu_sleep>, <&cluster_sleep>;
};

cpu2: cpu@2 {
@@ -83,6 +85,7 @@ cpu2: cpu@2 {
clocks = <&ccu CLK_CPUX>;
clock-names = "cpu";
#cooling-cells = <2>;
+ cpu-idle-states = <&cpu_sleep>, <&cluster_sleep>;
};

cpu3: cpu@3 {
@@ -94,6 +97,29 @@ cpu3: cpu@3 {
clocks = <&ccu CLK_CPUX>;
clock-names = "cpu";
#cooling-cells = <2>;
+ cpu-idle-states = <&cpu_sleep>, <&cluster_sleep>;
+ };
+
+ idle-states {
+ entry-method = "psci";
+
+ cpu_sleep: cpu-sleep {
+ compatible = "arm,idle-state";
+ local-timer-stop;
+ entry-latency-us = <800>;
+ exit-latency-us = <1500>;
+ min-residency-us = <25000>;
+ arm,psci-suspend-param = <0x00010003>;
+ };
+
+ cluster_sleep: cluster-sleep {
+ compatible = "arm,idle-state";
+ local-timer-stop;
+ entry-latency-us = <850>;
+ exit-latency-us = <1500>;
+ min-residency-us = <50000>;
+ arm,psci-suspend-param = <0x01010013>;
+ };
};

L2: l2-cache {
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi
index 62952660b..975a76a9f 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi
@@ -24,6 +24,7 @@ cpu0: cpu@0 {
clocks = <&ccu CLK_CPUX>;
clock-latency-ns = <244144>; /* 8 32k periods */
#cooling-cells = <2>;
+ cpu-idle-states = <&cpu_sleep>, <&cluster_sleep>;
};

cpu1: cpu@1 {
@@ -34,6 +35,7 @@ cpu1: cpu@1 {
clocks = <&ccu CLK_CPUX>;
clock-latency-ns = <244144>; /* 8 32k periods */
#cooling-cells = <2>;
+ cpu-idle-states = <&cpu_sleep>, <&cluster_sleep>;
};

cpu2: cpu@2 {
@@ -44,6 +46,7 @@ cpu2: cpu@2 {
clocks = <&ccu CLK_CPUX>;
clock-latency-ns = <244144>; /* 8 32k periods */
#cooling-cells = <2>;
+ cpu-idle-states = <&cpu_sleep>, <&cluster_sleep>;
};

cpu3: cpu@3 {
@@ -54,6 +57,29 @@ cpu3: cpu@3 {
clocks = <&ccu CLK_CPUX>;
clock-latency-ns = <244144>; /* 8 32k periods */
#cooling-cells = <2>;
+ cpu-idle-states = <&cpu_sleep>, <&cluster_sleep>;
+ };
+
+ idle-states {
+ entry-method = "psci";
+
+ cpu_sleep: cpu-sleep {
+ compatible = "arm,idle-state";
+ local-timer-stop;
+ entry-latency-us = <800>;
+ exit-latency-us = <1500>;
+ min-residency-us = <25000>;
+ arm,psci-suspend-param = <0x00010003>;
+ };
+
+ cluster_sleep: cluster-sleep {
+ compatible = "arm,idle-state";
+ local-timer-stop;
+ entry-latency-us = <850>;
+ exit-latency-us = <1500>;
+ min-residency-us = <50000>;
+ arm,psci-suspend-param = <0x01010013>;
+ };
};
};

--
2.39.0

32 changes: 14 additions & 18 deletions PKGBUILDS/pine64/linux-megi/0001-bootsplash.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,21 @@ diff --git a/MAINTAINERS b/MAINTAINERS
index a74227ad082e..b5633b56391e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3582,6 +3614,18 @@ F: drivers/net/bonding/
F: include/net/bond*
F: include/uapi/linux/if_bonding.h
@@ -3615,6 +3615,14 @@
F: Documentation/devicetree/bindings/iio/accel/bosch,bma400.yaml
F: drivers/iio/accel/bma400*

+BOOTSPLASH
+M: Max Staudt <[email protected]>
+L: [email protected]
+S: Maintained
+F: Documentation/ABI/testing/sysfs-platform-bootsplash
+F: Documentation/bootsplash.rst
+F: drivers/video/fbdev/core/bootsplash*.*
+F: drivers/video/fbdev/core/dummycon.c
+F: include/linux/bootsplash.h
+F: include/uapi/linux/bootsplash_file.h
+F: tools/bootsplash/*
+
BOSCH SENSORTEC BMA400 ACCELEROMETER IIO DRIVER
M: Dan Robertson <[email protected]>
L: [email protected]
+M: Max Staudt <[email protected]>
+L: [email protected]
+S: Maintained
+F: drivers/video/fbdev/core/bootsplash*.*
+F: drivers/video/fbdev/core/dummycon.c
+F: include/linux/bootsplash.h
+
BPF [GENERAL] (Safe Dynamic Programs and Tools)
M: Alexei Starovoitov <[email protected]>
M: Daniel Borkmann <[email protected]>
diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig
index 7f1f1fbcef9e..f3ff976266fe 100644
--- a/drivers/video/console/Kconfig
Expand Down Expand Up @@ -674,7 +670,7 @@ index 04612f938bab..9a39a6fcfe98 100644

static int fbcon_invalid_charcount(struct fb_info *info, unsigned charcount)
@@ -2184,6 +2203,9 @@ static int fbcon_switch(struct vc_data *vc)
info = registered_fb[con2fb_map[vc->vc_num]];
info = fbcon_registered_fb[con2fb_map[vc->vc_num]];
ops = info->fbcon_par;

+ if (bootsplash_would_render_now())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@
+
+static void fbcon_scrolldelta(struct vc_data *vc, int lines)
+{
+ struct fb_info *info = registered_fb[con2fb_map[fg_console]];
+ struct fb_info *info = fbcon_registered_fb[con2fb_map[fg_console]];
+ struct fbcon_ops *ops = info->fbcon_par;
+ struct fbcon_display *disp = &fb_display[fg_console];
+ int offset, limit, scrollback_old;
Expand Down
15 changes: 9 additions & 6 deletions PKGBUILDS/pine64/linux-megi/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildarch=8

pkgbase=linux-megi
_desc="Megous Kernel"
pkgver=6.0.10
pkgver=6.1.7
pkgrel=1
arch=('aarch64')
url="https://github.com/megous/linux"
Expand All @@ -15,13 +15,15 @@ makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc' 'git' 'uboot-tools' '
options=('!strip')

# Source
_commit="e191fb41a4fa9d8e8e3b2f4b0452c536222c087e"
_commit="aa3e5fabfb690946cab52a6ea8de32c3a1fc75e8"
source=("linux-$_commit.tar.gz::https://github.com/megous/linux/archive/${_commit}.tar.gz"
'config'
'linux.preset'
'60-linux.hook'
'90-linux.hook'
# Patches
# Sleep Mode
'0001-arm64-dts-allwinner-a64-h5-Add-CPU-idle-states.patch'
# PinePhone Patches
'dts-pinephone-drop-modem-power-node.patch'
'dts-pinephone-pro-remove-modem-node.patch'
Expand Down Expand Up @@ -245,11 +247,12 @@ for _p in "${pkgname[@]}"; do
}"
done

md5sums=('101ff66b4cf2bba4b3166d2451f142fa'
'b8dcdf5e9dc64efe12ae2452b4e05fd8'
md5sums=('d700d8a68f4f01ddb298e1008ee71fa7'
'29399e5670b600b8b0070cd499d64225'
'86d4a35722b5410e3b29fc92dae15d4b'
'ce6c81ad1ad1f8b333fd6077d47abdaf'
'3dc88030a8f2f5a5f97266d99b149f77'
'081b35c2970e3fec444b32f941a26e1d'
'10d200e0a964f24cdb744678a758e22b'
'ed972b8da2887aef963e63268b055cd3'
'7d80f76f1647afa00de320f5866484a1'
Expand All @@ -259,8 +262,8 @@ md5sums=('101ff66b4cf2bba4b3166d2451f142fa'
'60e9d1ccba52bd2634fbe8034b110e36'
'a31a435ab6cd8e7a47601159d665ce50'
'fed6ae4ac4c3f56178fa4aca6c934d6f'
'c52849cc82994edbd8ec665a2a6048a3'
'b796ce863a8ce07d8e01623577fcf659'
'ee3fad8e3468bba539a42ee3ed2b488f'
'8878beda05ef17755a6228ab3250bbbc'
'cd3d72f7f71192225f2126abe11800a9'
'a6407dceae1838f5aa27450401a91be6'
'cb78b1c11b917a4d31c4b1567183b76f'
Expand Down
Loading

0 comments on commit ef09f25

Please sign in to comment.