Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions config/sources/families/spacemit.conf
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ case "${BRANCH}" in
;;
edge)
declare -g KERNELSOURCE="https://github.com/jmontleon/linux-bianbu.git"
declare -g KERNELBRANCH="branch:linux-6.16.y"
declare -g KERNELBRANCH="branch:linux-6.17.y"
declare -g EXTRAWIFI="no" # WiFi drivers are already included in the kernel
declare -g KERNEL_MAJOR_MINOR="6.16"
declare -g KERNEL_MAJOR_MINOR="6.17"
declare -g LINUXCONFIG="linux-${LINUXFAMILY}-edge"
;;
esac
Expand Down
45 changes: 45 additions & 0 deletions patch/kernel/archive/spacemit-6.17/0000.patching_config.yaml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
From 5e370980eaf7c4f6aa64bb27e755e57b9220212d Mon Sep 17 00:00:00 2001
From: Patrick Yavitz <pyavitz@gmail.com>
Date: Mon, 20 Oct 2025 08:07:16 -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 bdaf0097d..c2f8aeca9 100644
--- a/drivers/net/wireless/realtek/rtl8852bs/Makefile
+++ b/drivers/net/wireless/realtek/rtl8852bs/Makefile
@@ -142,7 +142,7 @@ ccflags-y += -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 5d41dc48f..dab9ac8ce 100644
--- a/drivers/net/wireless/realtek/rtl8852bs/core/rtw_xmit.c
+++ b/drivers/net/wireless/realtek/rtl8852bs/core/rtw_xmit.c
@@ -6681,7 +6681,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.43.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
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

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From 7ab21f462be1275af4552df2bd3e87607fab1957 Mon Sep 17 00:00:00 2001
From: Patrick Yavitz <pyavitz@gmail.com>
Date: Mon, 20 Oct 2025 08:09:31 -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 5300c942a..6375c5cf9 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -718,6 +718,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);
@@ -751,6 +752,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

Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
From e2ac8e7fddb7ca0a18a7466bf2dc37547ec72d30 Mon Sep 17 00:00:00 2001
From: Patrick Yavitz <pyavitz@gmail.com>
Date: Fri, 3 Oct 2025 15:54:47 -0400
Subject: [PATCH] SpacemiT: K1-X: Forward port 6.6.y DTSI

Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
---
arch/riscv/boot/dts/spacemit/k1-x.dtsi | 66 ++++++++++++++++++++++----
1 file changed, 58 insertions(+), 8 deletions(-)

diff --git a/arch/riscv/boot/dts/spacemit/k1-x.dtsi b/arch/riscv/boot/dts/spacemit/k1-x.dtsi
index 8f411e7f01f3..24366372e064 100644
--- a/arch/riscv/boot/dts/spacemit/k1-x.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k1-x.dtsi
@@ -430,7 +430,7 @@ rcpu_mem_0: mem@c0800000 {
};

/* rcpu's heap */
- rcpu_mem_1: mem@30000000 {
+ rcpu_mem_heap: rcpu_mem_heap@30000000 {
reg = <0x0 0x30000000 0x0 0x200000>;
no-map;
};
@@ -465,6 +465,12 @@ rcpu_mem_snapshots: rcpu_mem_snapshots@30300000 {
reg = <0x0 0x30300000 0x0 0x40000>;
no-map;
};
+
+ /* the dtb file of rcpu */
+ rcpu_mem_dtb: rcpu_mem_dtb@30300000 {
+ reg = <0x0 0x30340000 0x0 0x40000>;
+ no-map;
+ };
};

soc: soc {
@@ -495,13 +501,13 @@ dram_range1: dram_range@1 {
status = "okay";
};

- /* dram mapping for pcie for ex. */
+ /* dram mapping for pcie0 for ex. */
dram_range2: dram_range@2 {
compatible = "spacemit-dram-bus";
#address-cells = <2>;
#size-cells = <2>;
dma-ranges = <0x0 0x00000000 0x0 0x00000000 0x0 0x80000000>,
- <0x0 0xb8000000 0x1 0x38000000 0x3 0x48000000>;
+ <0x0 0x90000000 0x1 0x10000000 0x3 0x70000000>;
#interconnect-cells = <0>;
status = "okay";
};
@@ -539,6 +545,30 @@ dram_range5: dram_range@5 {
status = "okay";
};

+ /* dram mapping for pcie1 for ex. */
+ dram_range6: dram_range@6 {
+ compatible = "spacemit-dram-bus";
+ #address-cells = <2>;
+ #size-cells = <2>;
+ dma-ranges = <0x0 0x00000000 0x0 0x00000000 0x0 0x80000000>,
+ <0x0 0x80000000 0x1 0x00000000 0x0 0x10000000>,
+ <0x0 0xa0000000 0x1 0x20000000 0x3 0x60000000>;
+ #interconnect-cells = <0>;
+ status = "okay";
+ };
+
+ /* dram mapping for pcie2 for ex. */
+ dram_range7: dram_range@7 {
+ compatible = "spacemit-dram-bus";
+ #address-cells = <2>;
+ #size-cells = <2>;
+ dma-ranges = <0x0 0x00000000 0x0 0x00000000 0x0 0x80000000>,
+ <0x0 0x80000000 0x1 0x00000000 0x0 0x20000000>,
+ <0x0 0xb8000000 0x1 0x38000000 0x3 0x48000000>;
+ #interconnect-cells = <0>;
+ status = "okay";
+ };
+
clint0: clint@e4000000 {
compatible = "riscv,clint0";
interrupts-extended = <
@@ -615,7 +645,8 @@ &cpu7_intc 11 &cpu7_intc 9
pinctrl: pinctrl@d401e000 {
compatible = "pinconf-single-aib";
reg = <0x0 0xd401e000 0x0 0x250>,
- <0x0 0xd4019800 0x0 0x10>;
+ <0x0 0xd4019800 0x0 0x10>,
+ <0x0 0xd4019000 0x0 0x800>;
#address-cells = <1>;
#size-cells = <1>;
#pinctrl-cells = <2>;
@@ -1398,8 +1429,8 @@ ri2c0: ri2c@c0887000 {
spacemit,i2c-wcr = <0x142a>;
/* apb clock: 26MHz or 52MHz */
spacemit,apb_clock = <52000000>;
- power-domains = <&power K1X_PMU_BUS_PWR_DOMAIN>;
- cpuidle,pm-runtime,sleep;
+ power-domains = <&power K1X_PMU_BUS_PWR_DOMAIN>;
+ cpuidle,pm-runtime,sleep;
interconnects = <&dram_range4>;
interconnect-names = "dma-mem";
status = "okay";
@@ -1865,6 +1896,17 @@ gcb3: gpio3 {
};
};

+ ec_master: ethercat_master {
+ compatible = "igh,k1x-ec-master";
+ run-on-cpu = <1>;
+ debug-level = <0>;
+ master-count = <1>;
+ ec-devices = <&eth0>,<&eth1>;
+ master-indexes = <0>,<0>;
+ modes = "ec_main","ec_backup";
+ status = "disable";
+ };
+
eth0: ethernet@cac80000 {
compatible = "spacemit,k1x-emac";
reg = <0x00000000 0xCAC80000 0x00000000 0x00000420>;
@@ -2239,7 +2281,7 @@ pcie1_rc: pcie@ca400000 {
#size-cells = <2>;
ranges = <0x01000000 0x0 0x9f002000 0 0x9f002000 0x0 0x100000>,
<0x02000000 0x0 0x90000000 0 0x90000000 0x0 0x0f000000>;
- interconnects = <&dram_range2>;
+ interconnects = <&dram_range6>;
interconnect-names = "dma-mem";

interrupts = <142>, <146>;
@@ -2289,7 +2331,7 @@ pcie2_rc: pcie@ca800000 {
ranges = <0x01000000 0x0 0xb7002000 0 0xb7002000 0x0 0x100000>,
<0x42000000 0x0 0xa0000000 0 0xa0000000 0x0 0x10000000>,
<0x02000000 0x0 0xb0000000 0 0xb0000000 0x0 0x7000000>;
- interconnects = <&dram_range2>;
+ interconnects = <&dram_range7>;
interconnect-names = "dma-mem";

interrupts = <143>, <147>;
@@ -2486,6 +2528,14 @@ spacemit_crypto_engine@d8600000 {
status = "okay";
};

+ crng: crng@f0703800 {
+ compatible = "spacemit,hw_crng";
+ reg = <0x0 0xf0703800 0x0 0x100>;
+ clocks = <&ccu CLK_AES>;
+ resets = <&reset RESET_AES>;
+ status = "okay";
+ };
+
efuse: fuse@f0702800 {
compatible = "simple-mfd";
#address-cells = <1>;
--
2.43.0

Loading