Skip to content

Commit

Permalink
BananaPi BPI-F3: Update to linux-6.6.70 & overclock to 1.8GHz
Browse files Browse the repository at this point in the history
Run at max freq:
echo "1" > /sys/devices/system/cpu/cpufreq/boost

Signed-off-by: Patrick Yavitz <[email protected]>
  • Loading branch information
pyavitz committed Jan 9, 2025
1 parent 2be9ed9 commit 24bf1fb
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config/sources/families/spacemit.conf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ declare -g BOOTCONFIG="k1_defconfig" # Boot with generic SpacemiT K1 config
case "${BRANCH}" in
current)
declare -g KERNELSOURCE='https://github.com/jmontleon/linux-bianbu.git'
declare -g KERNELBRANCH='commit:46927cc73d6e7261fb89dadc2295f1054c9a1fa9'
declare -g KERNELBRANCH='commit:d68e874061433bb36c1d2ed2dafe717b96abc379'
declare -g EXTRAWIFI="no" # WiFi drivers are already included in the kernel
declare -g KERNEL_MAJOR_MINOR="6.6"
declare -g LINUXCONFIG="linux-${LINUXFAMILY}-current"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
From 4698d0e59f66da7282bd8c9e46e353d1ca64a92e Mon Sep 17 00:00:00 2001
From: Patrick Yavitz <[email protected]>
Date: Thu, 9 Jan 2025 10:14:18 -0500
Subject: [PATCH] Max freq limitation 1.8GHz

Signed-off-by: Patrick Yavitz <[email protected]>
---
drivers/cpufreq/spacemit-cpufreq.c | 20 ++++----------------
1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/drivers/cpufreq/spacemit-cpufreq.c b/drivers/cpufreq/spacemit-cpufreq.c
index 745844e9d2b2..f784e8fe545b 100644
--- a/drivers/cpufreq/spacemit-cpufreq.c
+++ b/drivers/cpufreq/spacemit-cpufreq.c
@@ -49,7 +49,7 @@ of_hotplug_cooling_register(struct cpufreq_policy *policy);
#define FILTER_POINTS_0 (135)
#define FILTER_POINTS_1 (142)

-#define K1_MAX_FREQ_LIMITATION (1600000)
+#define K1_MAX_FREQ_LIMITATION (1800000)
#define M1_MAX_FREQ_LIMITATION (1800000)

#endif
@@ -427,18 +427,8 @@ int spacmeit_cpufreq_veritfy(struct cpufreq_policy_data *policy)
if (!policy->freq_table)
return -ENODEV;

- if ((wafer_prop << 16 | product_prop) == PRODUCT_ID_M1) {
- /* M1 */
- /* can update to 1.8G */
- cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
- policy->cpuinfo.max_freq);
- } else {
- /* K1 */
- /* only 1.6G allowed max */
- policy->max = policy->max > K1_MAX_FREQ_LIMITATION ? K1_MAX_FREQ_LIMITATION : policy->max;
- cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
- K1_MAX_FREQ_LIMITATION);
- }
+ cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
+ policy->cpuinfo.max_freq);

cpufreq_for_each_valid_entry(pos, policy->freq_table) {
freq = pos->frequency;
@@ -470,9 +460,7 @@ void spacemit_cpufreq_ready(struct cpufreq_policy *policy)
if ((wafer_prop << 16 | product_prop) == PRODUCT_ID_M1) {
/* M1 */
} else {
- /* K1 or other */
- remove_policy_boost_sysfs_file(policy);
- remove_boost_sysfs_file();
+ /* K1 */
}
}

--
2.39.5

0 comments on commit 24bf1fb

Please sign in to comment.