SpacemiT: Add edge patches

Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
This commit is contained in:
Patrick Yavitz
2025-08-11 06:56:54 -04:00
committed by c0rnelius
parent 2425801a79
commit 925e22c093
5 changed files with 1351 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
config: # This is file 'patch/kernel/spacemit-legacy-6.1/0000.patching_config.yaml'
# PATCH NUMBERING INFO
#
# Patches should be ordered in such a way that general kernel patches are applied first, then SoC-related patches and at last board-specific patches
#
# Patch numbers in this folder are sorted by category:
#
# 000* for general patches
# 0** for Bianbu-Linux-related patches
# 1** for other SoC-related patches
# 5** for board specific patches
# Just some info stuff; not used by the patching scripts
name: spacemit-6.16
kind: kernel
type: vendor # or: edge
branch: linux-6.16.y
last-known-good-tag: v6.16
maintainers:
- { github: none, name: none, email: none, armbian-forum: none }
# .dts files in these directories will be copied as-is to the build tree; later ones overwrite earlier ones.
# This is meant to provide a way to "add a board DTS" without having to null-patch them in.
dts-directories:
- { source: "dt", target: "arch/riscv/boot/dts/spacemit" }
# Every file in these directories will be copied as-is to the build tree; later ones overwrite earlier ones
# This is meant as a way to have overlays, bare, in a directory, without having to null-patch them in.
# @TODO need a solution to auto-Makefile the overlays as well
overlay-directories:
- { source: "overlay", target: "arch/riscv/boot/dts/spacemit/overlay" }
# The Makefile in each of these directories will be magically patched to include the dts files copied
# or patched-in; overlay subdir will be included "-y" if it exists.
# No more Makefile patching needed, yay!
#auto-patch-dt-makefile:
# - { directory: "arch/riscv/boot/dts/spacemit", config-var: "CONFIG_SOC_SPACEMIT_K1X" }
# Configuration for when applying patches to git / auto-rewriting patches (development cycle helpers)
patches-to-git:
do-not-commit-files:
- "MAINTAINERS" # constant churn, drop them. sorry.
do-not-commit-regexes: # Python-style regexes
- "^arch/([a-zA-Z0-9]+)/boot/dts/([a-zA-Z0-9]+)/Makefile$" # ignore DT Makefile patches, we've an auto-patcher now

View File

@@ -0,0 +1,40 @@
From d77e410afa4ee896a00335f268f37b59c6f44ea1 Mon Sep 17 00:00:00 2001
From: Patrick Yavitz <pyavitz@gmail.com>
Date: Sat, 17 Aug 2024 11:49:20 -0400
Subject: [PATCH] rtl8852bs: Turn off DEBUG and remove RTW_WARN_LM
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
---
drivers/net/wireless/realtek/rtl8852bs/Makefile | 2 +-
drivers/net/wireless/realtek/rtl8852bs/core/rtw_xmit.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8852bs/Makefile b/drivers/net/wireless/realtek/rtl8852bs/Makefile
index 2af36254f..181d9320b 100644
--- a/drivers/net/wireless/realtek/rtl8852bs/Makefile
+++ b/drivers/net/wireless/realtek/rtl8852bs/Makefile
@@ -138,7 +138,7 @@ EXTRA_CFLAGS += -DCONFIG_RTW_ANDROID=$(CONFIG_RTW_ANDROID)
endif
########################## Debug ###########################
-CONFIG_RTW_DEBUG = y
+CONFIG_RTW_DEBUG = n
# default log level is _DRV_INFO_ = 4,
# please refer to "How_to_set_driver_debug_log_level.doc" to set the available level.
CONFIG_RTW_LOG_LEVEL = 2
diff --git a/drivers/net/wireless/realtek/rtl8852bs/core/rtw_xmit.c b/drivers/net/wireless/realtek/rtl8852bs/core/rtw_xmit.c
index f50926762..5310587f4 100644
--- a/drivers/net/wireless/realtek/rtl8852bs/core/rtw_xmit.c
+++ b/drivers/net/wireless/realtek/rtl8852bs/core/rtw_xmit.c
@@ -6677,7 +6677,7 @@ static void fill_txreq_list_skb(_adapter *padapter,
if (skb_total_frag_nr(head_skb) > NUM_PKT_LIST_PER_TXREQ - 2) {
rtw_skb_linearize(head_skb);
- RTW_WARN_LMT("skb total frag nr over %d\n", NUM_PKT_LIST_PER_TXREQ - 2);
+ //RTW_WARN_LMT("skb total frag nr over %d\n", NUM_PKT_LIST_PER_TXREQ - 2);
}
_fill_txreq_list_skb(padapter, txreq, pkt_list, head_skb, &req_sz, &offset);
--
2.39.2

View File

@@ -0,0 +1,58 @@
From 4698d0e59f66da7282bd8c9e46e353d1ca64a92e Mon Sep 17 00:00:00 2001
From: Patrick Yavitz <pyavitz@gmail.com>
Date: Thu, 9 Jan 2025 10:14:18 -0500
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 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

View File

@@ -0,0 +1,33 @@
From 64346ab82c7ff0f4ad5ba7140d205e22f8278960 Mon Sep 17 00:00:00 2001
From: Patrick Yavitz <pyavitz@gmail.com>
Date: Fri, 8 Aug 2025 19:47:21 -0400
Subject: [PATCH] Add spacemit k1x-spi support
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
---
drivers/spi/spidev.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index 6108959c28d9..b25aff873cc5 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -717,6 +717,7 @@ static const struct spi_device_id spidev_spi_ids[] = {
{ .name = /* semtech */ "sx1301" },
{ .name = /* silabs */ "em3581" },
{ .name = /* silabs */ "si3210" },
+ { .name = /* spacemit */ "k1x-spi" },
{},
};
MODULE_DEVICE_TABLE(spi, spidev_spi_ids);
@@ -749,6 +750,7 @@ static const struct of_device_id spidev_dt_ids[] = {
{ .compatible = "semtech,sx1301", .data = &spidev_of_check },
{ .compatible = "silabs,em3581", .data = &spidev_of_check },
{ .compatible = "silabs,si3210", .data = &spidev_of_check },
+ { .compatible = "spacemit,k1x-spi", .data = &spidev_of_check },
{},
};
MODULE_DEVICE_TABLE(of, spidev_dt_ids);
--
2.43.0

File diff suppressed because it is too large Load Diff