Skip to content

Commit 5decdbf

Browse files
committed
SpacemiT: Update EDGE to linux-6.17.y
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
1 parent 596b6c6 commit 5decdbf

File tree

7 files changed

+1511
-2
lines changed

7 files changed

+1511
-2
lines changed

config/sources/families/spacemit.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ case "${BRANCH}" in
3838
;;
3939
edge)
4040
declare -g KERNELSOURCE="https://github.com/jmontleon/linux-bianbu.git"
41-
declare -g KERNELBRANCH="branch:linux-6.16.y"
41+
declare -g KERNELBRANCH="branch:linux-6.17.y"
4242
declare -g EXTRAWIFI="no" # WiFi drivers are already included in the kernel
43-
declare -g KERNEL_MAJOR_MINOR="6.16"
43+
declare -g KERNEL_MAJOR_MINOR="6.17"
4444
declare -g LINUXCONFIG="linux-${LINUXFAMILY}-edge"
4545
;;
4646
esac
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
config: # This is file 'patch/kernel/spacemit-legacy-6.1/0000.patching_config.yaml'
2+
3+
# PATCH NUMBERING INFO
4+
#
5+
# 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
6+
#
7+
# Patch numbers in this folder are sorted by category:
8+
#
9+
# 000* for general patches
10+
# 0** for Bianbu-Linux-related patches
11+
# 1** for other SoC-related patches
12+
# 5** for board specific patches
13+
14+
# Just some info stuff; not used by the patching scripts
15+
name: spacemit-6.16
16+
kind: kernel
17+
type: vendor # or: edge
18+
branch: linux-6.16.y
19+
last-known-good-tag: v6.16
20+
maintainers:
21+
- { github: none, name: none, email: none, armbian-forum: none }
22+
23+
# .dts files in these directories will be copied as-is to the build tree; later ones overwrite earlier ones.
24+
# This is meant to provide a way to "add a board DTS" without having to null-patch them in.
25+
dts-directories:
26+
- { source: "dt", target: "arch/riscv/boot/dts/spacemit" }
27+
28+
# Every file in these directories will be copied as-is to the build tree; later ones overwrite earlier ones
29+
# This is meant as a way to have overlays, bare, in a directory, without having to null-patch them in.
30+
# @TODO need a solution to auto-Makefile the overlays as well
31+
overlay-directories:
32+
- { source: "overlay", target: "arch/riscv/boot/dts/spacemit/overlay" }
33+
34+
# The Makefile in each of these directories will be magically patched to include the dts files copied
35+
# or patched-in; overlay subdir will be included "-y" if it exists.
36+
# No more Makefile patching needed, yay!
37+
#auto-patch-dt-makefile:
38+
# - { directory: "arch/riscv/boot/dts/spacemit", config-var: "CONFIG_SOC_SPACEMIT_K1X" }
39+
40+
# Configuration for when applying patches to git / auto-rewriting patches (development cycle helpers)
41+
patches-to-git:
42+
do-not-commit-files:
43+
- "MAINTAINERS" # constant churn, drop them. sorry.
44+
do-not-commit-regexes: # Python-style regexes
45+
- "^arch/([a-zA-Z0-9]+)/boot/dts/([a-zA-Z0-9]+)/Makefile$" # ignore DT Makefile patches, we've an auto-patcher now
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
From 5e370980eaf7c4f6aa64bb27e755e57b9220212d Mon Sep 17 00:00:00 2001
2+
From: Patrick Yavitz <pyavitz@gmail.com>
3+
Date: Mon, 20 Oct 2025 08:07:16 -0400
4+
Subject: [PATCH] rtl8852bs: Turn off DEBUG and remove RTW_WARN_LM
5+
6+
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
7+
---
8+
drivers/net/wireless/realtek/rtl8852bs/Makefile | 2 +-
9+
drivers/net/wireless/realtek/rtl8852bs/core/rtw_xmit.c | 2 +-
10+
2 files changed, 2 insertions(+), 2 deletions(-)
11+
12+
diff --git a/drivers/net/wireless/realtek/rtl8852bs/Makefile b/drivers/net/wireless/realtek/rtl8852bs/Makefile
13+
index bdaf0097d..c2f8aeca9 100644
14+
--- a/drivers/net/wireless/realtek/rtl8852bs/Makefile
15+
+++ b/drivers/net/wireless/realtek/rtl8852bs/Makefile
16+
@@ -142,7 +142,7 @@ ccflags-y += -DCONFIG_RTW_ANDROID=$(CONFIG_RTW_ANDROID)
17+
endif
18+
19+
########################## Debug ###########################
20+
-CONFIG_RTW_DEBUG = y
21+
+CONFIG_RTW_DEBUG = n
22+
# default log level is _DRV_INFO_ = 4,
23+
# please refer to "How_to_set_driver_debug_log_level.doc" to set the available level.
24+
CONFIG_RTW_LOG_LEVEL = 2
25+
diff --git a/drivers/net/wireless/realtek/rtl8852bs/core/rtw_xmit.c b/drivers/net/wireless/realtek/rtl8852bs/core/rtw_xmit.c
26+
index 5d41dc48f..dab9ac8ce 100644
27+
--- a/drivers/net/wireless/realtek/rtl8852bs/core/rtw_xmit.c
28+
+++ b/drivers/net/wireless/realtek/rtl8852bs/core/rtw_xmit.c
29+
@@ -6681,7 +6681,7 @@ static void fill_txreq_list_skb(_adapter *padapter,
30+
31+
if (skb_total_frag_nr(head_skb) > NUM_PKT_LIST_PER_TXREQ - 2) {
32+
rtw_skb_linearize(head_skb);
33+
- RTW_WARN_LMT("skb total frag nr over %d\n", NUM_PKT_LIST_PER_TXREQ - 2);
34+
+ //RTW_WARN_LMT("skb total frag nr over %d\n", NUM_PKT_LIST_PER_TXREQ - 2);
35+
}
36+
37+
_fill_txreq_list_skb(padapter, txreq, pkt_list, head_skb, &req_sz, &offset);
38+
--
39+
2.43.0
40+
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
From 1abbdfc943e3bf7f1827c8bb092410342a5940ad Mon Sep 17 00:00:00 2001
2+
From: Patrick Yavitz <pyavitz@gmail.com>
3+
Date: Mon, 20 Oct 2025 08:08:50 -0400
4+
Subject: [PATCH] Max freq limitation 1.8GHz
5+
6+
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
7+
---
8+
drivers/cpufreq/spacemit-cpufreq.c | 20 ++++----------------
9+
1 file changed, 4 insertions(+), 16 deletions(-)
10+
11+
diff --git a/drivers/cpufreq/spacemit-cpufreq.c b/drivers/cpufreq/spacemit-cpufreq.c
12+
index 7b4df5fb7..69a712d36 100644
13+
--- a/drivers/cpufreq/spacemit-cpufreq.c
14+
+++ b/drivers/cpufreq/spacemit-cpufreq.c
15+
@@ -51,7 +51,7 @@ of_hotplug_cooling_register(struct cpufreq_policy *policy);
16+
#define FILTER_POINTS_0 (135)
17+
#define FILTER_POINTS_1 (142)
18+
19+
-#define K1_MAX_FREQ_LIMITATION (1600000)
20+
+#define K1_MAX_FREQ_LIMITATION (1800000)
21+
#define M1_MAX_FREQ_LIMITATION (1800000)
22+
23+
#endif
24+
@@ -429,18 +429,8 @@ int spacmeit_cpufreq_veritfy(struct cpufreq_policy_data *policy)
25+
if (!policy->freq_table)
26+
return -ENODEV;
27+
28+
- if ((wafer_prop << 16 | product_prop) == PRODUCT_ID_M1) {
29+
- /* M1 */
30+
- /* can update to 1.8G */
31+
- cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
32+
- policy->cpuinfo.max_freq);
33+
- } else {
34+
- /* K1 */
35+
- /* only 1.6G allowed max */
36+
- policy->max = policy->max > K1_MAX_FREQ_LIMITATION ? K1_MAX_FREQ_LIMITATION : policy->max;
37+
- cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
38+
- K1_MAX_FREQ_LIMITATION);
39+
- }
40+
+ cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
41+
+ policy->cpuinfo.max_freq);
42+
43+
cpufreq_for_each_valid_entry(pos, policy->freq_table) {
44+
freq = pos->frequency;
45+
@@ -469,9 +459,7 @@ void spacemit_cpufreq_ready(struct cpufreq_policy *policy)
46+
if ((wafer_prop << 16 | product_prop) == PRODUCT_ID_M1) {
47+
/* M1 */
48+
} else {
49+
- /* K1 or other */
50+
- remove_policy_boost_sysfs_file(policy);
51+
- remove_boost_sysfs_file();
52+
+ /* K1 */
53+
}
54+
}
55+
56+
--
57+
2.43.0
58+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
From 7ab21f462be1275af4552df2bd3e87607fab1957 Mon Sep 17 00:00:00 2001
2+
From: Patrick Yavitz <pyavitz@gmail.com>
3+
Date: Mon, 20 Oct 2025 08:09:31 -0400
4+
Subject: [PATCH] Add spacemit k1x-spi support
5+
6+
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
7+
---
8+
drivers/spi/spidev.c | 2 ++
9+
1 file changed, 2 insertions(+)
10+
11+
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
12+
index 5300c942a..6375c5cf9 100644
13+
--- a/drivers/spi/spidev.c
14+
+++ b/drivers/spi/spidev.c
15+
@@ -718,6 +718,7 @@ static const struct spi_device_id spidev_spi_ids[] = {
16+
{ .name = /* semtech */ "sx1301" },
17+
{ .name = /* silabs */ "em3581" },
18+
{ .name = /* silabs */ "si3210" },
19+
+ { .name = /* spacemit */ "k1x-spi" },
20+
{},
21+
};
22+
MODULE_DEVICE_TABLE(spi, spidev_spi_ids);
23+
@@ -751,6 +752,7 @@ static const struct of_device_id spidev_dt_ids[] = {
24+
{ .compatible = "semtech,sx1301", .data = &spidev_of_check },
25+
{ .compatible = "silabs,em3581", .data = &spidev_of_check },
26+
{ .compatible = "silabs,si3210", .data = &spidev_of_check },
27+
+ { .compatible = "spacemit,k1x-spi", .data = &spidev_of_check },
28+
{},
29+
};
30+
MODULE_DEVICE_TABLE(of, spidev_dt_ids);
31+
--
32+
2.43.0
33+
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
From e2ac8e7fddb7ca0a18a7466bf2dc37547ec72d30 Mon Sep 17 00:00:00 2001
2+
From: Patrick Yavitz <pyavitz@gmail.com>
3+
Date: Fri, 3 Oct 2025 15:54:47 -0400
4+
Subject: [PATCH] SpacemiT: K1-X: Forward port 6.6.y DTSI
5+
6+
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
7+
---
8+
arch/riscv/boot/dts/spacemit/k1-x.dtsi | 66 ++++++++++++++++++++++----
9+
1 file changed, 58 insertions(+), 8 deletions(-)
10+
11+
diff --git a/arch/riscv/boot/dts/spacemit/k1-x.dtsi b/arch/riscv/boot/dts/spacemit/k1-x.dtsi
12+
index 8f411e7f01f3..24366372e064 100644
13+
--- a/arch/riscv/boot/dts/spacemit/k1-x.dtsi
14+
+++ b/arch/riscv/boot/dts/spacemit/k1-x.dtsi
15+
@@ -430,7 +430,7 @@ rcpu_mem_0: mem@c0800000 {
16+
};
17+
18+
/* rcpu's heap */
19+
- rcpu_mem_1: mem@30000000 {
20+
+ rcpu_mem_heap: rcpu_mem_heap@30000000 {
21+
reg = <0x0 0x30000000 0x0 0x200000>;
22+
no-map;
23+
};
24+
@@ -465,6 +465,12 @@ rcpu_mem_snapshots: rcpu_mem_snapshots@30300000 {
25+
reg = <0x0 0x30300000 0x0 0x40000>;
26+
no-map;
27+
};
28+
+
29+
+ /* the dtb file of rcpu */
30+
+ rcpu_mem_dtb: rcpu_mem_dtb@30300000 {
31+
+ reg = <0x0 0x30340000 0x0 0x40000>;
32+
+ no-map;
33+
+ };
34+
};
35+
36+
soc: soc {
37+
@@ -495,13 +501,13 @@ dram_range1: dram_range@1 {
38+
status = "okay";
39+
};
40+
41+
- /* dram mapping for pcie for ex. */
42+
+ /* dram mapping for pcie0 for ex. */
43+
dram_range2: dram_range@2 {
44+
compatible = "spacemit-dram-bus";
45+
#address-cells = <2>;
46+
#size-cells = <2>;
47+
dma-ranges = <0x0 0x00000000 0x0 0x00000000 0x0 0x80000000>,
48+
- <0x0 0xb8000000 0x1 0x38000000 0x3 0x48000000>;
49+
+ <0x0 0x90000000 0x1 0x10000000 0x3 0x70000000>;
50+
#interconnect-cells = <0>;
51+
status = "okay";
52+
};
53+
@@ -539,6 +545,30 @@ dram_range5: dram_range@5 {
54+
status = "okay";
55+
};
56+
57+
+ /* dram mapping for pcie1 for ex. */
58+
+ dram_range6: dram_range@6 {
59+
+ compatible = "spacemit-dram-bus";
60+
+ #address-cells = <2>;
61+
+ #size-cells = <2>;
62+
+ dma-ranges = <0x0 0x00000000 0x0 0x00000000 0x0 0x80000000>,
63+
+ <0x0 0x80000000 0x1 0x00000000 0x0 0x10000000>,
64+
+ <0x0 0xa0000000 0x1 0x20000000 0x3 0x60000000>;
65+
+ #interconnect-cells = <0>;
66+
+ status = "okay";
67+
+ };
68+
+
69+
+ /* dram mapping for pcie2 for ex. */
70+
+ dram_range7: dram_range@7 {
71+
+ compatible = "spacemit-dram-bus";
72+
+ #address-cells = <2>;
73+
+ #size-cells = <2>;
74+
+ dma-ranges = <0x0 0x00000000 0x0 0x00000000 0x0 0x80000000>,
75+
+ <0x0 0x80000000 0x1 0x00000000 0x0 0x20000000>,
76+
+ <0x0 0xb8000000 0x1 0x38000000 0x3 0x48000000>;
77+
+ #interconnect-cells = <0>;
78+
+ status = "okay";
79+
+ };
80+
+
81+
clint0: clint@e4000000 {
82+
compatible = "riscv,clint0";
83+
interrupts-extended = <
84+
@@ -615,7 +645,8 @@ &cpu7_intc 11 &cpu7_intc 9
85+
pinctrl: pinctrl@d401e000 {
86+
compatible = "pinconf-single-aib";
87+
reg = <0x0 0xd401e000 0x0 0x250>,
88+
- <0x0 0xd4019800 0x0 0x10>;
89+
+ <0x0 0xd4019800 0x0 0x10>,
90+
+ <0x0 0xd4019000 0x0 0x800>;
91+
#address-cells = <1>;
92+
#size-cells = <1>;
93+
#pinctrl-cells = <2>;
94+
@@ -1398,8 +1429,8 @@ ri2c0: ri2c@c0887000 {
95+
spacemit,i2c-wcr = <0x142a>;
96+
/* apb clock: 26MHz or 52MHz */
97+
spacemit,apb_clock = <52000000>;
98+
- power-domains = <&power K1X_PMU_BUS_PWR_DOMAIN>;
99+
- cpuidle,pm-runtime,sleep;
100+
+ power-domains = <&power K1X_PMU_BUS_PWR_DOMAIN>;
101+
+ cpuidle,pm-runtime,sleep;
102+
interconnects = <&dram_range4>;
103+
interconnect-names = "dma-mem";
104+
status = "okay";
105+
@@ -1865,6 +1896,17 @@ gcb3: gpio3 {
106+
};
107+
};
108+
109+
+ ec_master: ethercat_master {
110+
+ compatible = "igh,k1x-ec-master";
111+
+ run-on-cpu = <1>;
112+
+ debug-level = <0>;
113+
+ master-count = <1>;
114+
+ ec-devices = <&eth0>,<&eth1>;
115+
+ master-indexes = <0>,<0>;
116+
+ modes = "ec_main","ec_backup";
117+
+ status = "disable";
118+
+ };
119+
+
120+
eth0: ethernet@cac80000 {
121+
compatible = "spacemit,k1x-emac";
122+
reg = <0x00000000 0xCAC80000 0x00000000 0x00000420>;
123+
@@ -2239,7 +2281,7 @@ pcie1_rc: pcie@ca400000 {
124+
#size-cells = <2>;
125+
ranges = <0x01000000 0x0 0x9f002000 0 0x9f002000 0x0 0x100000>,
126+
<0x02000000 0x0 0x90000000 0 0x90000000 0x0 0x0f000000>;
127+
- interconnects = <&dram_range2>;
128+
+ interconnects = <&dram_range6>;
129+
interconnect-names = "dma-mem";
130+
131+
interrupts = <142>, <146>;
132+
@@ -2289,7 +2331,7 @@ pcie2_rc: pcie@ca800000 {
133+
ranges = <0x01000000 0x0 0xb7002000 0 0xb7002000 0x0 0x100000>,
134+
<0x42000000 0x0 0xa0000000 0 0xa0000000 0x0 0x10000000>,
135+
<0x02000000 0x0 0xb0000000 0 0xb0000000 0x0 0x7000000>;
136+
- interconnects = <&dram_range2>;
137+
+ interconnects = <&dram_range7>;
138+
interconnect-names = "dma-mem";
139+
140+
interrupts = <143>, <147>;
141+
@@ -2486,6 +2528,14 @@ spacemit_crypto_engine@d8600000 {
142+
status = "okay";
143+
};
144+
145+
+ crng: crng@f0703800 {
146+
+ compatible = "spacemit,hw_crng";
147+
+ reg = <0x0 0xf0703800 0x0 0x100>;
148+
+ clocks = <&ccu CLK_AES>;
149+
+ resets = <&reset RESET_AES>;
150+
+ status = "okay";
151+
+ };
152+
+
153+
efuse: fuse@f0702800 {
154+
compatible = "simple-mfd";
155+
#address-cells = <1>;
156+
--
157+
2.43.0
158+

0 commit comments

Comments
 (0)