armbian-build/patch/kernel/archive/spacemit-6.18/002-Max-freq-limitation-1.8GHz.patch
Patrick Yavitz 41b0fa731b SpacemiT: Add linux-6.18.y support
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
2025-12-16 14:24:48 -05:00

59 lines
1.9 KiB
Diff

From 1abbdfc943e3bf7f1827c8bb092410342a5940ad Mon Sep 17 00:00:00 2001
From: Patrick Yavitz <pyavitz@gmail.com>
Date: Mon, 20 Oct 2025 08:08:50 -0400
Subject: [PATCH] Max freq limitation 1.8GHz
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
---
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 7b4df5fb7..69a712d36 100644
--- a/drivers/cpufreq/spacemit-cpufreq.c
+++ b/drivers/cpufreq/spacemit-cpufreq.c
@@ -51,7 +51,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
@@ -429,18 +429,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;
@@ -469,9 +459,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.43.0