diff --git a/patch/kernel/archive/spacemit-6.16/001-rtl8852bs-Turn-off-DEBUG-and-remove-RTW_WARN_LM.patch b/patch/kernel/archive/spacemit-6.16/001-rtl8852bs-Turn-off-DEBUG-and-remove-RTW_WARN_LM.patch deleted file mode 100644 index 329a775dc8..0000000000 --- a/patch/kernel/archive/spacemit-6.16/001-rtl8852bs-Turn-off-DEBUG-and-remove-RTW_WARN_LM.patch +++ /dev/null @@ -1,40 +0,0 @@ -From d77e410afa4ee896a00335f268f37b59c6f44ea1 Mon Sep 17 00:00:00 2001 -From: Patrick Yavitz -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 ---- - 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 - diff --git a/patch/kernel/archive/spacemit-6.16/002-Max-freq-limitation-1.8GHz.patch b/patch/kernel/archive/spacemit-6.16/002-Max-freq-limitation-1.8GHz.patch deleted file mode 100644 index 109da52bb7..0000000000 --- a/patch/kernel/archive/spacemit-6.16/002-Max-freq-limitation-1.8GHz.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 4698d0e59f66da7282bd8c9e46e353d1ca64a92e Mon Sep 17 00:00:00 2001 -From: Patrick Yavitz -Date: Thu, 9 Jan 2025 10:14:18 -0500 -Subject: [PATCH] Max freq limitation 1.8GHz - -Signed-off-by: Patrick Yavitz ---- - 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 - diff --git a/patch/kernel/archive/spacemit-6.16/003-Add-spacemit-k1x-spi-support.patch b/patch/kernel/archive/spacemit-6.16/003-Add-spacemit-k1x-spi-support.patch deleted file mode 100644 index bb00331d14..0000000000 --- a/patch/kernel/archive/spacemit-6.16/003-Add-spacemit-k1x-spi-support.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 64346ab82c7ff0f4ad5ba7140d205e22f8278960 Mon Sep 17 00:00:00 2001 -From: Patrick Yavitz -Date: Fri, 8 Aug 2025 19:47:21 -0400 -Subject: [PATCH] Add spacemit k1x-spi support - -Signed-off-by: Patrick Yavitz ---- - 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 - diff --git a/patch/kernel/archive/spacemit-6.16/004-SpacemiT-K1-X-Forward-port-6.6.y-DTSI.patch b/patch/kernel/archive/spacemit-6.16/004-SpacemiT-K1-X-Forward-port-6.6.y-DTSI.patch deleted file mode 100644 index 636612e78f..0000000000 --- a/patch/kernel/archive/spacemit-6.16/004-SpacemiT-K1-X-Forward-port-6.6.y-DTSI.patch +++ /dev/null @@ -1,158 +0,0 @@ -From e2ac8e7fddb7ca0a18a7466bf2dc37547ec72d30 Mon Sep 17 00:00:00 2001 -From: Patrick Yavitz -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 ---- - 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 = <ð0>,<ð1>; -+ 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 - diff --git a/patch/kernel/archive/spacemit-6.17/0000.patching_config.yaml b/patch/kernel/archive/spacemit-6.17/0000.patching_config.yaml deleted file mode 100644 index ac1da4ec6c..0000000000 --- a/patch/kernel/archive/spacemit-6.17/0000.patching_config.yaml +++ /dev/null @@ -1,45 +0,0 @@ -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 diff --git a/patch/kernel/archive/spacemit-6.17/001-rtl8852bs-Turn-off-DEBUG-and-remove-RTW_WARN_LM.patch b/patch/kernel/archive/spacemit-6.17/001-rtl8852bs-Turn-off-DEBUG-and-remove-RTW_WARN_LM.patch deleted file mode 100644 index c430d4e8d2..0000000000 --- a/patch/kernel/archive/spacemit-6.17/001-rtl8852bs-Turn-off-DEBUG-and-remove-RTW_WARN_LM.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 5e370980eaf7c4f6aa64bb27e755e57b9220212d Mon Sep 17 00:00:00 2001 -From: Patrick Yavitz -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 ---- - 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 - diff --git a/patch/kernel/archive/spacemit-6.17/002-Max-freq-limitation-1.8GHz.patch b/patch/kernel/archive/spacemit-6.17/002-Max-freq-limitation-1.8GHz.patch deleted file mode 100644 index ed85b07c56..0000000000 --- a/patch/kernel/archive/spacemit-6.17/002-Max-freq-limitation-1.8GHz.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 1abbdfc943e3bf7f1827c8bb092410342a5940ad Mon Sep 17 00:00:00 2001 -From: Patrick Yavitz -Date: Mon, 20 Oct 2025 08:08:50 -0400 -Subject: [PATCH] Max freq limitation 1.8GHz - -Signed-off-by: Patrick Yavitz ---- - 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 - diff --git a/patch/kernel/archive/spacemit-6.17/003-Add-spacemit-k1x-spi-support.patch b/patch/kernel/archive/spacemit-6.17/003-Add-spacemit-k1x-spi-support.patch deleted file mode 100644 index 1eec543d8c..0000000000 --- a/patch/kernel/archive/spacemit-6.17/003-Add-spacemit-k1x-spi-support.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 7ab21f462be1275af4552df2bd3e87607fab1957 Mon Sep 17 00:00:00 2001 -From: Patrick Yavitz -Date: Mon, 20 Oct 2025 08:09:31 -0400 -Subject: [PATCH] Add spacemit k1x-spi support - -Signed-off-by: Patrick Yavitz ---- - 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 - diff --git a/patch/kernel/archive/spacemit-6.17/004-SpacemiT-K1-X-Forward-port-6.6.y-DTSI.patch b/patch/kernel/archive/spacemit-6.17/004-SpacemiT-K1-X-Forward-port-6.6.y-DTSI.patch deleted file mode 100644 index 636612e78f..0000000000 --- a/patch/kernel/archive/spacemit-6.17/004-SpacemiT-K1-X-Forward-port-6.6.y-DTSI.patch +++ /dev/null @@ -1,158 +0,0 @@ -From e2ac8e7fddb7ca0a18a7466bf2dc37547ec72d30 Mon Sep 17 00:00:00 2001 -From: Patrick Yavitz -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 ---- - 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 = <ð0>,<ð1>; -+ 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 - diff --git a/patch/kernel/archive/spacemit-6.18/0000.patching_config.yaml b/patch/kernel/archive/spacemit-6.18/0000.patching_config.yaml index 71899e5c47..ba1ea016bf 100644 --- a/patch/kernel/archive/spacemit-6.18/0000.patching_config.yaml +++ b/patch/kernel/archive/spacemit-6.18/0000.patching_config.yaml @@ -15,7 +15,7 @@ config: # This is file 'patch/kernel/spacemit-legacy-6.1/0000.patching_config.ya name: spacemit-6.18 kind: kernel type: vendor # or: edge - branch: linux-6.16.y + branch: linux-6.18.y last-known-good-tag: v6.18 maintainers: - { github: none, name: none, email: none, armbian-forum: none } diff --git a/patch/kernel/archive/spacemit-6.18/006-general-add-overlay-compilation-support.patch b/patch/kernel/archive/spacemit-6.18/006-general-add-overlay-compilation-support.patch new file mode 100644 index 0000000000..75b5b3dd70 --- /dev/null +++ b/patch/kernel/archive/spacemit-6.18/006-general-add-overlay-compilation-support.patch @@ -0,0 +1,66 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Paolo Sabatino +Date: Wed, 2 Oct 2024 19:30:34 +0300 +Subject: compile .scr and install overlays in right path + +--- + scripts/Makefile.dtbinst | 13 +++++++++- + scripts/Makefile.dtbs | 8 +++++- + 2 files changed, 19 insertions(+), 2 deletions(-) + +diff --git a/scripts/Makefile.dtbinst b/scripts/Makefile.dtbinst +index 111111111111..222222222222 100644 +--- a/scripts/Makefile.dtbinst ++++ b/scripts/Makefile.dtbinst +@@ -33,7 +33,18 @@ endef + + $(foreach d, $(sort $(dir $(dtbs))), $(eval $(call gen_install_rules,$(d)))) + +-dtbs := $(notdir $(dtbs)) ++# Very convoluted way to flatten all the device tree ++# directories, but keep the "/overlay/" directory ++ ++# topmost directory (ie: from rockchip/overlay/rk322x-emmc.dtbo extracts rockchip) ++topmost_dir = $(firstword $(subst /, ,$(dtbs))) ++# collect dtbs entries which starts with "$topmost_dir/overlay/", then remove "$topmost_dir" ++dtbs_overlays = $(subst $(topmost_dir)/,,$(filter $(topmost_dir)/overlay/%, $(dtbs))) ++# collect the non-overlay dtbs ++dtbs_regular = $(filter-out $(topmost_dir)/overlay/%, $(dtbs)) ++# compose the dtbs variable flattening all the non-overlays entries ++# and appending the overlays entries ++dtbs := $(notdir $(dtbs_regular)) $(dtbs_overlays) + + endif # CONFIG_ARCH_WANT_FLAT_DTB_INSTALL + +diff --git a/scripts/Makefile.dtbs b/scripts/Makefile.dtbs +index 111111111111..222222222222 100644 +--- a/scripts/Makefile.dtbs ++++ b/scripts/Makefile.dtbs +@@ -123,17 +123,23 @@ dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp) + quiet_cmd_dtc = DTC $(quiet_dtb_check_tag) $@ + cmd_dtc = \ + $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \ +- $(DTC) -o $@ -b 0 $(addprefix -i,$(dir $<) $(DTC_INCLUDE)) \ ++ $(DTC) -@ -o $@ -b 0 $(addprefix -i,$(dir $<) $(DTC_INCLUDE)) \ + $(DTC_FLAGS) -d $(depfile).dtc.tmp $(dtc-tmp) ; \ + cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile) \ + $(cmd_dtb_check) + ++quiet_cmd_scr = MKIMAGE $@ ++cmd_scr = mkimage -C none -A $(ARCH) -T script -d $< $@ ++ + $(obj)/%.dtb: $(obj)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE + $(call if_changed_dep,dtc) + + $(obj)/%.dtbo: $(src)/%.dtso $(DTC) FORCE + $(call if_changed_dep,dtc) + ++$(obj)/%.scr: $(src)/%.scr-cmd FORCE ++ $(call if_changed,scr) ++ + # targets + # --------------------------------------------------------------------------- + +-- +Armbian + diff --git a/patch/kernel/archive/spacemit-6.18/007-general-spacemit-overlays.patch b/patch/kernel/archive/spacemit-6.18/007-general-spacemit-overlays.patch new file mode 100644 index 0000000000..3446de5ad9 --- /dev/null +++ b/patch/kernel/archive/spacemit-6.18/007-general-spacemit-overlays.patch @@ -0,0 +1,27 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Zhang Ning <832666+zhangn1985@users.noreply.github.com> +Date: Sat, 30 Aug 2025 10:33:14 +0800 +Subject: general: spacemit overlays + +Signed-off-by: retro98boy +--- + scripts/Makefile.build | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/scripts/Makefile.build b/scripts/Makefile.build +index 111111111111..222222222222 100644 +--- a/scripts/Makefile.build ++++ b/scripts/Makefile.build +@@ -107,6 +107,9 @@ always-y += $(hostprogs-always-y) $(hostprogs-always-m) + userprogs += $(userprogs-always-y) $(userprogs-always-m) + always-y += $(userprogs-always-y) $(userprogs-always-m) + ++# Overlay targets ++extra-y += $(dtbo-y) $(scr-y) $(dtbotxt-y) ++ + # Add subdir path + + ifneq ($(obj),.) +-- +Armbian + diff --git a/patch/kernel/archive/spacemit-6.18/dt/Makefile b/patch/kernel/archive/spacemit-6.18/dt/Makefile new file mode 100644 index 0000000000..9a509f4736 --- /dev/null +++ b/patch/kernel/archive/spacemit-6.18/dt/Makefile @@ -0,0 +1,17 @@ +dtb-$(CONFIG_SOC_SPACEMIT_K1PRO) += k1-pro_sim.dtb k1-pro_fpga.dtb k1-pro_fpga_1x4.dtb \ + k1-pro_fpga_2x2.dtb k1-pro_qemu.dtb k1-pro_verify.dtb +dtb-$(CONFIG_SOC_SPACEMIT_K1X) += k1-x_fpga.dtb k1-x_fpga_1x4.dtb k1-x_fpga_2x2.dtb k1-x_evb.dtb \ + k1-x_deb2.dtb k1-x_deb1.dtb k1-x_hs450.dtb k1-x_kx312.dtb \ + k1-x_MINI-PC.dtb k1-x_MUSE-N1.dtb k1-x_mingo.dtb \ + k1-x_MUSE-Pi.dtb k1-x_milkv-jupiter.dtb m1-x_milkv-jupiter.dtb \ + k1-x_MUSE-Book.dtb k1-x_lpi3a.dtb k1-x_MUSE-Card.dtb \ + k1-x_MUSE-Paper.dtb k1-x_MUSE-Paper-mini-4g.dtb \ + k1-x_baton-camera.dtb k1-x_FusionOne.dtb k1-x_orangepi-rv2.dtb \ + k1-x_ZT001H.dtb k1-x_uav.dtb k1-x_bit-brick.dtb + +obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y)) + +dtb-$(CONFIG_SOC_SPACEMIT_K1X) += k1-bananapi-f3.dtb +dtb-$(CONFIG_SOC_SPACEMIT_K1X) += k1-musepi-pro.dtb + +subdir-y += overlay diff --git a/patch/kernel/archive/spacemit-6.17/dt/k1-bananapi-f3.dts b/patch/kernel/archive/spacemit-6.18/dt/k1-musepi-pro.dts similarity index 86% rename from patch/kernel/archive/spacemit-6.17/dt/k1-bananapi-f3.dts rename to patch/kernel/archive/spacemit-6.18/dt/k1-musepi-pro.dts index cdd22e1013..71f740b147 100644 --- a/patch/kernel/archive/spacemit-6.17/dt/k1-bananapi-f3.dts +++ b/patch/kernel/archive/spacemit-6.18/dt/k1-musepi-pro.dts @@ -1,11 +1,12 @@ // SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* Copyright (c) 2023 Spacemit, Inc */ /dts-v1/; #include "k1-x.dtsi" #include "k1-x-efuse.dtsi" #include "k1-x_pinctrl.dtsi" -#include "lcd/lcd_gx09inx101_mipi.dtsi" +#include "lcd_tc358762xbg_dpi_800x480.dtsi" #include "k1-x-hdmi.dtsi" #include "k1-x-lcd.dtsi" #include "k1-x-camera-sdk.dtsi" @@ -13,7 +14,8 @@ #include "k1-x_thermal_cooling.dtsi" / { - model = "BananaPi BPI-F3"; + model = "SpacemiT MusePi Pro"; + modules_usrload = "8852bs"; chosen { bootargs = "earlycon=sbi console=ttyS0,115200n8 swiotlb=65536 rdinit=/init"; @@ -91,14 +93,6 @@ regulator-max-microvolt = <12000000>; }; - fan: pwm-fan { - compatible = "pwm-fan"; - pwms = <&rpwm2 10000>; - #cooling-cells = <2>; - cooling-levels = <0 64 128 192 255>; - status = "okay"; - }; - leds { compatible = "gpio-leds"; @@ -128,8 +122,8 @@ linux,cma { compatible = "shared-dma-pool"; - /* alloc memory from 0x40000000~0x80000000 */ - alloc-ranges = <0 0x40000000 0 0x40000000>; + /* alloc memory from 0x40000000~0x70000000 */ + alloc-ranges = <0 0x40000000 0 0x30000000>; /* size of cma buffer is 384MByte */ size = <0 0x18000000>; /* start address is 1Mbyte aligned */ @@ -182,22 +176,32 @@ }; }; -/* ov16a10 */ +/* MIPI CSI1, clk lane1 */ &backsensor { + pwdn-gpios = <&gpio 113 0>; + dvdd-powen-gpios = <&gpio 115 0>; + + mclk-disable; + + status = "okay"; +}; + +/* MIPI CSI3 data line2,3 clk lane2 */ +&backsensor_aux { af_2v8-supply = <&ldo_3>; avdd_2v8-supply = <&ldo_2>; dovdd_1v8-supply = <&ldo_7>; dvdd_1v2-supply = <&ldo_6>; - pwdn-gpios = <&gpio 113 0>; - reset-gpios = <&gpio 111 0>; + pwdn-gpios = <&gpio 124 0>; + reset-gpios = <&gpio 97 0>; - status = "okay"; -}; - -&backsensor_aux { - avdd_2v8-supply = <&ldo_2>; - dovdd_1v8-supply = <&ldo_7>; + pinmulti-enable; + twsi-index = <0>; + clocks = <&ccu CLK_CAMM0>; + clock-names = "cam_mclk0"; + pinctrl-names = "mclk_multi"; + pinctrl-0 = <&pinctrl_camera0>; status = "disabled"; }; @@ -220,12 +224,16 @@ status = "okay"; }; -&csiphy0 { - +&combphy { status = "okay"; }; -&combphy { +&cpp { + power-domains = <&power K1X_PMU_ISP_PWR_DOMAIN>; +}; + +&csiphy0 { + status = "okay"; }; @@ -236,54 +244,169 @@ &csiphy2 { spacemit,bifmode-enable; - status = "okay"; }; -&cpp { - power-domains = <&power K1X_PMU_ISP_PWR_DOMAIN>; -}; - &dpu_online2_dsi { memory-region = <&dpu_resv>; - spacemit-dpu-bitclk = <1000000000>; + spacemit-dpu-bitclk = <700000000>; + spacemit-dpu-escclk = <76800000>; dsi_1v2-supply = <&ldo_5>; vin-supply-names = "dsi_1v2"; status = "disabled"; }; +&dsi2 { + status = "disabled"; + force-attached = "lcd_tc358762xbg_dpi_800x480"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + + dsi1_output: endpoint@1 { + reg = <1>; + remote-endpoint = <&panel_in>; + }; + }; + }; + + dpi_panel: panel@0 { + status = "ok"; + compatible = "raspberrypi,dpi-panel"; + }; +}; + &dpu_online2_hdmi { memory-region = <&dpu_resv>; status = "okay"; }; -&dsi2 { +&ehci { + spacemit,reset-on-resume; + spacemit,udc-mode = ; status = "disabled"; +}; - panel2: panel2@0 { - status = "ok"; - compatible = "spacemit,mipi-panel2"; - reg = <0>; +&ehci1 { + spacemit,udc-mode = ; + spacemit,reset-on-resume; + status = "okay"; +}; - gpios-reset = <81>; - gpios-dc = <82 83>; - id = <2>; - delay-after-reset = <10>; - force-attached = "lcd_gx09inx101_mipi"; +ð0 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_gmac0>; + + emac,reset-gpio = <&gpio 110 0>; + emac,reset-active-low; + emac,reset-delays-us = <0 10000 100000>; + + /* store forward mode */ + tx-threshold = <1518>; + rx-threshold = <12>; + tx-ring-num = <1024>; + rx-ring-num = <1024>; + dma-burst-len = <5>; + + ref-clock-from-phy; + + clk-tuning-enable; + clk-tuning-by-delayline; + tx-phase = <60>; + rx-phase = <73>; + + nvmem-cells = <&mac_address0>; + nvmem-cell-names = "mac-address"; + + phy-handle = <&rgmii0>; + + status = "okay"; + + mdio-bus { + #address-cells = <0x1>; + #size-cells = <0x0>; + rgmii0: phy@0 { + compatible = "ethernet-phy-id001c.c916"; + device_type = "ethernet-phy"; + reg = <0x1>; + phy-mode = "rgmii"; + + leds { + #address-cells = <1>; + #size-cells = <0>; + + lan0-led1@1 { + reg = <1>; + linux,default-trigger = "netdev"; + }; + + lan0-led2@2 { + reg = <2>; + linux,default-trigger = "netdev"; + }; + }; + }; }; }; -&hdmiaudio { +/* MIPI CSI3 data line0,1 clk lane3 */ +&frontsensor { + pwdn-gpios = <&gpio 114 0>; + dvdd-powen-gpios = <&gpio 115 0>; + + twsi-index = <1>; + + //mclk can disable + mclk-disable; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_camera1>; + status = "okay"; }; +&gpio{ + gpio-ranges = < + &pinctrl 49 GPIO_49 2 + &pinctrl 58 GPIO_58 1 + &pinctrl 63 GPIO_63 1 + &pinctrl 65 GPIO_65 1 + &pinctrl 67 GPIO_67 1 + &pinctrl 70 PRI_TDI 4 + &pinctrl 74 GPIO_74 1 + &pinctrl 79 GPIO_79 1 + &pinctrl 80 GPIO_80 4 + &pinctrl 90 GPIO_90 3 + &pinctrl 96 DVL0 2 + &pinctrl 110 GPIO_110 1 + &pinctrl 111 GPIO_111 1 + &pinctrl 113 GPIO_113 1 + &pinctrl 114 GPIO_114 3 + &pinctrl 118 GPIO_118 1 + &pinctrl 123 GPIO_123 5 + >; +}; + &hdmi{ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_hdmi_0>; status = "okay"; }; +&hdmiaudio { + status = "okay"; +}; + +&lcds { + status = "disabled"; +}; + &i2c0 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c0>; @@ -291,6 +414,13 @@ status = "okay"; }; +&i2c1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c1>; + spacemit,i2c-fast-mode; + status = "okay"; +}; + &i2c2 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c2_0>; @@ -321,7 +451,6 @@ #sound-dai-cells = <0>; interrupt-parent = <&gpio>; interrupts = <126 1>; - spk-ctl-gpio = <&gpio 127 0>; everest,mic1-src = [44]; everest,mic2-src = [66]; status = "okay"; @@ -330,14 +459,39 @@ &i2c3 { pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_i2c3_2>; - status = "disabled"; + pinctrl-0 = <&pinctrl_i2c3_0>; + status = "okay"; }; &i2c4 { pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_i2c4_2>; + pinctrl-0 = <&pinctrl_i2c4_0>; + status = "okay"; +}; + +&i2c5 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c5_0>; status = "disabled"; + + raspits-panel@45 { + status = "okay"; + compatible = "raspberrypi,7inch-touchscreen-panel"; + reg = <0x45>; + enable-gpio = <&gpio 83 0>; + + port { + panel_in: endpoint { + remote-endpoint = <&dsi1_output>; + }; + }; + }; + + raspits-touch-ft5426@38 { + status = "okay"; + compatible = "raspits_ft5426"; + reg = <0x38>; + }; }; &i2c6 { @@ -425,6 +579,7 @@ regulator-max-microvolt = <3300000>; regulator-ramp-delay = <5000>; regulator-always-on; + regulator-state-mem { regulator-off-in-suspend; regulator-suspend-microvolt = <3300000>; @@ -453,6 +608,8 @@ regulator-min-microvolt = <500000>; regulator-max-microvolt = <3400000>; regulator-boot-on; + + /* set the min voltage means will disable this vol in suspend for ldo */ regulator-state-mem { regulator-off-in-suspend; regulator-suspend-microvolt = <500000>; @@ -463,6 +620,7 @@ regulator-name = "ldo2"; regulator-min-microvolt = <500000>; regulator-max-microvolt = <3400000>; + regulator-state-mem { regulator-off-in-suspend; regulator-suspend-microvolt = <500000>; @@ -473,6 +631,7 @@ regulator-name = "ldo3"; regulator-min-microvolt = <500000>; regulator-max-microvolt = <3400000>; + regulator-state-mem { regulator-off-in-suspend; regulator-suspend-microvolt = <500000>; @@ -483,6 +642,7 @@ regulator-name = "ldo4"; regulator-min-microvolt = <500000>; regulator-max-microvolt = <3400000>; + regulator-state-mem { regulator-off-in-suspend; regulator-suspend-microvolt = <500000>; @@ -495,6 +655,7 @@ regulator-min-microvolt = <500000>; regulator-max-microvolt = <3400000>; regulator-boot-on; + regulator-state-mem { regulator-off-in-suspend; regulator-suspend-microvolt = <500000>; @@ -505,6 +666,7 @@ regulator-name = "ldo6"; regulator-min-microvolt = <500000>; regulator-max-microvolt = <3400000>; + regulator-state-mem { regulator-off-in-suspend; regulator-suspend-microvolt = <500000>; @@ -515,6 +677,7 @@ regulator-name = "ldo7"; regulator-min-microvolt = <500000>; regulator-max-microvolt = <3400000>; + regulator-state-mem { regulator-off-in-suspend; regulator-suspend-microvolt = <500000>; @@ -581,152 +744,30 @@ }; }; -&i2s0 { +&pcie1_rc { pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_sspa0_0>; + pinctrl-0 = <&pinctrl_pcie1_3>; status = "okay"; }; -&ehci { - spacemit,reset-on-resume; - spacemit,udc-mode = ; - status = "disabled"; -}; - -&ehci1 { - /*spacemit,udc-mode = ;*/ - spacemit,reset-on-resume; - status = "okay"; -}; - -ð0 { +&pcie2_rc { pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_gmac0>; - - emac,reset-gpio = <&gpio 110 0>; - emac,reset-active-low; - emac,reset-delays-us = <0 10000 100000>; - - /* store forward mode */ - tx-threshold = <1518>; - rx-threshold = <12>; - tx-ring-num = <1024>; - rx-ring-num = <1024>; - dma-burst-len = <5>; - - ref-clock-from-phy; - - clk-tuning-enable; - clk-tuning-by-delayline; - tx-phase = <60>; - rx-phase = <73>; - - nvmem-cells = <&mac_address0>; - nvmem-cell-names = "mac-address"; - - phy-handle = <&rgmii0>; - + pinctrl-0 = <&pinctrl_pcie2_5>; status = "okay"; - - mdio-bus { - #address-cells = <0x1>; - #size-cells = <0x0>; - rgmii0: phy@0 { - compatible = "ethernet-phy-id001c.c916"; - device_type = "ethernet-phy"; - reg = <0x1>; - phy-mode = "rgmii"; - }; - }; -}; - -ð1 { - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_gmac1>; - - emac,reset-gpio = <&gpio 115 0>; - emac,reset-active-low; - emac,reset-delays-us = <0 10000 100000>; - - /* store forward mode */ - tx-threshold = <1518>; - rx-threshold = <12>; - tx-ring-num = <1024>; - rx-ring-num = <1024>; - dma-burst-len = <5>; - - ref-clock-from-phy; - - clk-tuning-enable; - clk-tuning-by-delayline; - tx-phase = <90>; - rx-phase = <73>; - nvmem-cells = <&mac_address1>; - nvmem-cell-names = "mac-address"; - - phy-handle = <&rgmii1>; - - status = "okay"; - - mdio-bus { - #address-cells = <0x1>; - #size-cells = <0x0>; - rgmii1: phy@1 { - compatible = "ethernet-phy-id001c.c916"; - device_type = "ethernet-phy"; - reg = <0x1>; - phy-mode = "rgmii"; - }; - }; -}; - -&frontsensor { - af_2v8-supply = <&ldo_3>; - avdd_2v8-supply = <&ldo_2>; - dovdd_1v8-supply = <&ldo_7>; - dvdd_1v2-supply = <&ldo_6>; - - clocks = <&ccu CLK_CAMM1>; - clock-names = "cam_mclk1"; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_camera1>; - - pwdn-gpios = <&gpio 114 0>; - reset-gpios = <&gpio 112 0>; - - status = "disabled"; -}; - -&gpio{ - gpio-ranges = < - &pinctrl 49 GPIO_49 2 - &pinctrl 58 GPIO_58 1 - &pinctrl 63 GPIO_63 3 - &pinctrl 67 GPIO_67 1 - &pinctrl 70 PRI_TDI 4 - &pinctrl 74 GPIO_74 1 - &pinctrl 80 GPIO_80 4 - &pinctrl 90 GPIO_90 3 - &pinctrl 96 DVL0 2 - &pinctrl 110 GPIO_110 1 - &pinctrl 111 GPIO_111 1 - &pinctrl 113 GPIO_113 1 - &pinctrl 114 GPIO_114 3 - &pinctrl 118 GPIO_118 1 - &pinctrl 123 GPIO_123 5 - >; }; &imggpu { status = "okay"; }; -&isp { - power-domains = <&power K1X_PMU_ISP_PWR_DOMAIN>; +&i2s0 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_sspa0_2>; + status = "okay"; }; -&lcds { - status = "disabled"; +&isp { + power-domains = <&power K1X_PMU_ISP_PWR_DOMAIN>; }; &otg { @@ -747,31 +788,19 @@ status = "disabled"; }; -&pcie1_rc { - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_pcie1_3>; - status = "okay"; -}; - -&pcie2_rc { - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_pcie2_4>; - num-lanes = <1>; - status = "okay"; -}; - &pinctrl { pinctrl-single,gpio-range = < &range GPIO_49 2 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_3V_DS4) &range GPIO_58 1 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) - &range GPIO_63 2 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) - &range GPIO_64 1 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) + &range GPIO_63 1 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) + &range GPIO_64 1 (MUX_MODE1 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) &range GPIO_65 1 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) &range GPIO_67 1 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_3V_DS4) &range PRI_TDI 2 (MUX_MODE1 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) &range PRI_TCK 1 (MUX_MODE1 | EDGE_NONE | PULL_DOWN | PAD_1V8_DS2) &range PRI_TDO 1 (MUX_MODE1 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) &range GPIO_74 1 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) + &range GPIO_79 1 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) &range GPIO_80 1 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_3V_DS4) &range GPIO_81 3 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) &range GPIO_90 1 (MUX_MODE0 | EDGE_NONE | PULL_DOWN | PAD_1V8_DS2) @@ -797,6 +826,12 @@ >; }; + pinctrl_rpwm7_0: rpwm7_0_grp { + pinctrl-single,pins = < + K1X_PADCONF(GPIO_52, MUX_MODE3, (EDGE_NONE | PULL_UP | PAD_3V_DS4)) /* rcpu_pwm7 */ + >; + }; + pinctrl_gmac0: gmac0_grp { pinctrl-single,pins =< K1X_PADCONF(GPIO_00, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac0_rxdv */ @@ -844,18 +879,24 @@ K1X_PADCONF(GPIO_66, MUX_MODE0, (EDGE_FALL | PULL_DOWN | PAD_3V_DS2)) /* wifi edge detect */ >; }; -}; -&pwm7 { - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_pwm7_0>; - status = "disabled"; -}; + pinctrl_sspa0_2: sspa0_2_grp { + pinctrl-single,pins =< + K1X_PADCONF(GPIO_111, MUX_MODE2, (EDGE_NONE | PULL_UP | PAD_1V8_DS0)) /* sspa0_clk */ + K1X_PADCONF(GPIO_112, MUX_MODE2, (EDGE_NONE | PULL_UP | PAD_1V8_DS0)) /* sspa0_frm */ + K1X_PADCONF(GPIO_120, MUX_MODE3, (EDGE_NONE | PULL_UP | PAD_1V8_DS0)) /* sspa0_txd */ + K1X_PADCONF(GPIO_121, MUX_MODE3, (EDGE_NONE | PULL_UP | PAD_1V8_DS0)) /* sspa0_rxd */ + K1X_PADCONF(GPIO_122, MUX_MODE3, (EDGE_NONE | PULL_UP | PAD_1V8_DS0)) /* sspa0_sysclk */ + >; + }; -&pwm14 { - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_pwm14_1>; - status = "okay"; + pinctrl_pcie2_5: pcie2_5_grp { + pinctrl-single,pins =< + K1X_PADCONF(GPIO_62, MUX_MODE4, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* PCIe2_perstn */ + K1X_PADCONF(GPIO_36, MUX_MODE4, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* PCIe2_waken */ + K1X_PADCONF(GPIO_117, MUX_MODE4, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* PCIe2_clkreqn */ + >; + }; }; &pwm_bl { @@ -883,6 +924,18 @@ status = "okay"; }; +&pwm4 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_pwm4_1>; + status = "okay"; +}; + +&pwm14 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_pwm14_1>; + status = "disabled"; +}; + &qspi { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_qspi>; @@ -907,12 +960,17 @@ status = "okay"; }; -&rpwm2 { +&rpwm7 { pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_rpwm2_0>; + pinctrl-0 = <&pinctrl_rpwm7_0>; status = "okay"; }; +/* &r_uart0 { + status = "okay"; +}; +*/ + /* SD */ &sdhci0 { pinctrl-names = "default","fast"; @@ -920,7 +978,6 @@ pinctrl-1 = <&pinctrl_mmc1_fast>; bus-width = <4>; cd-gpios = <&gpio 80 0>; - cd-inverted; vmmc-supply = <&dcdc_4>; vqmmc-supply = <&ldo_1>; no-mmc; @@ -944,7 +1001,7 @@ spacemit,apbc_assar_reg = <0xD4015054>; spacemit,rx_dline_reg = <0x0>; spacemit,tx_dline_reg = <0x0>; - spacemit,tx_delaycode = <0x5f>; + spacemit,tx_delaycode = <0x9f>; spacemit,rx_tuning_limit = <50>; spacemit,sdh-freq = <204800000>; status = "okay"; @@ -975,7 +1032,7 @@ SDHCI_QUIRK2_BROKEN_PHY_MODULE )>; spacemit,rx_dline_reg = <0x0>; - spacemit,tx_delaycode = <0x8f>; + spacemit,tx_delaycode = <0xa8 0x78>; spacemit,rx_tuning_limit = <50>; spacemit,sdh-freq = <375000000>; status = "okay"; @@ -1019,87 +1076,9 @@ &spi3 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ssp3_0>; - status = "disabled"; - - spidev@0{ - compatible = "spacemit,k1x-spi"; - reg = <0>; - }; -}; - -&thermal { - sensor_range = <0x1 0x4>; -}; - -&thermal_zones { - top_thermal { - polling-delay = <0>; - polling-delay-passive = <0>; - thermal-sensors = <&thermal 1>; - - trips { - top_trip0: top-trip0 { - temperature = <40000>; - hysteresis = <5000>; - type = "passive"; - }; - - top_trip1: top-trip1 { - temperature = <55000>; - hysteresis = <5000>; - type = "passive"; - }; - - top_trip2: top-trip2 { - temperature = <70000>; - hysteresis = <5000>; - type = "passive"; - }; - - top_trip3: top-trip3 { - temperature = <85000>; - hysteresis = <5000>; - type = "passive"; - }; - }; - - cooling-maps { - map0 { - trip = <&top_trip0>; - cooling-device = <&fan 0 1>; - }; - - map1 { - trip = <&top_trip1>; - cooling-device = <&fan 1 2>; - }; - - map2 { - trip = <&top_trip2>; - cooling-device = <&fan 2 3>; - }; - - map3 { - trip = <&top_trip3>; - cooling-device = <&fan 3 4>; - }; - }; - }; - - gpu_thermal { - polling-delay = <0>; - polling-delay-passive = <0>; - thermal-sensors = <&thermal 2>; - - /* Just a placeholder */ - trips { - gpu_trip0: gpu-trip0 { - temperature = <40000>; - hysteresis = <5000>; - type = "passive"; - }; - }; - }; + k1x,ssp-disable-dma; + status = "okay"; + k1x,ssp-clock-rate = <25600000>; }; &uart0 { @@ -1123,17 +1102,28 @@ }; &udc { - /*spacemit,udc-mode = ;*/ spacemit,udc-mode = ; status = "okay"; }; &udc1 { - /*spacemit,udc-mode = ;*/ spacemit,udc-mode = ; status = "disabled"; }; +&usb2phy { + status = "okay"; +}; + +&usb3hub { + hub-gpios = < + &gpio 127 0 /* usb3 hub en */ + &gpio 123 0>; /* usb3 hub rst*/ + vbus-gpios = <&gpio 79 0>; /* usb3 hub output vbus */ + vbus_delay_ms = <200>; + status = "okay"; +}; + &usbdrd3 { status = "okay"; reset-on-resume; @@ -1150,14 +1140,6 @@ }; }; -&usb3hub { - hub-gpios = < - &gpio 123 0 /* usb3 hub en */ - &gpio 124 0>; /* usb3 hub rst*/ - vbus-gpios = <&gpio 97 0>; /* gpio_97 for usb3 hub output vbus */ - status = "okay"; -}; - &usbphy { status = "okay"; }; @@ -1166,10 +1148,6 @@ status = "okay"; }; -&usb2phy { - status = "okay"; -}; - &vi { power-domains = <&power K1X_PMU_ISP_PWR_DOMAIN>; }; diff --git a/patch/kernel/archive/spacemit-6.18/dt/lcd_tc358762xbg_dpi_800x480.dtsi b/patch/kernel/archive/spacemit-6.18/dt/lcd_tc358762xbg_dpi_800x480.dtsi new file mode 100644 index 0000000000..d00e83a542 --- /dev/null +++ b/patch/kernel/archive/spacemit-6.18/dt/lcd_tc358762xbg_dpi_800x480.dtsi @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-2.0 + +/ { lcds: lcds { + lcd_tc358762xbg_dpi_800x480: lcd_tc358762xbg_dpi_800x480 { + dsi-work-mode = <1>; /* video burst mode*/ + dsi-lane-number = <1>; + dsi-color-format = "rgb888"; + width-mm = <95>; + height-mm = <53>; + use-dcs-write; + + /*mipi info*/ + height = <480>; + width = <800>; + hfp = <1>; + hbp = <46>; + hsync = <2>; + vfp = <7>; + vbp = <21>; + vsync = <2>; + fps = <55>; + work-mode = <0>; + rgb-mode = <3>; + lane-number = <1>; + phy-bit-clock = <700000000>; + split-enable = <0>; + eotp-enable = <0>; + burst-mode = <2>; + esd-check-enable = <0>; + + /* DSI_CMD, DSI_MODE, timeout, len, cmd */ + initial-command = [ + 39 01 F0 01 11 + 39 01 28 01 29 + ]; + sleep-in-command = [ + 39 01 78 01 28 + 39 01 78 01 10 + ]; + sleep-out-command = [ + 39 01 96 01 11 + 39 01 32 01 29 + ]; + + display-timings { + timing0 { + clock-frequency = <25000000>; + hactive = <800>; + hfront-porch = <1>; + hback-porch = <46>; + hsync-len = <2>; + vactive = <480>; + vfront-porch = <7>; + vback-porch = <21>; + vsync-len = <2>; + vsync-active = <1>; + hsync-active = <1>; + }; + }; + }; +};}; \ No newline at end of file diff --git a/patch/kernel/archive/spacemit-6.18/overlay/Makefile b/patch/kernel/archive/spacemit-6.18/overlay/Makefile new file mode 100644 index 0000000000..4988b7122e --- /dev/null +++ b/patch/kernel/archive/spacemit-6.18/overlay/Makefile @@ -0,0 +1,11 @@ +# SPDX-License-Identifier: GPL-2.0 +dtbo-$(CONFIG_SOC_SPACEMIT_K1X) += \ + k1-spacemit-disable-qspi.dtbo \ + k1-spacemit-i2c4-pwm7-spi3-uart5.dtbo + +scr-$(CONFIG_SOC_SPACEMIT_K1X) += \ + spacemit-fixup.scr + +dtb-y += $(dtbo-y) $(scr-y) $(dtbotxt-y) + +clean-files := *.dtbo *.scr diff --git a/patch/kernel/archive/spacemit-6.18/overlay/k1-spacemit-disable-qspi.dts b/patch/kernel/archive/spacemit-6.18/overlay/k1-spacemit-disable-qspi.dts new file mode 100644 index 0000000000..df23c4a4f8 --- /dev/null +++ b/patch/kernel/archive/spacemit-6.18/overlay/k1-spacemit-disable-qspi.dts @@ -0,0 +1,13 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "spacemit,k1-x"; + + fragment@0 { + target = <&qspi>; + __overlay__ { + status = "disabled"; + }; + }; +}; diff --git a/patch/kernel/archive/spacemit-6.18/overlay/k1-spacemit-i2c4-pwm7-spi3-uart5.dts b/patch/kernel/archive/spacemit-6.18/overlay/k1-spacemit-i2c4-pwm7-spi3-uart5.dts new file mode 100644 index 0000000000..01e487b207 --- /dev/null +++ b/patch/kernel/archive/spacemit-6.18/overlay/k1-spacemit-i2c4-pwm7-spi3-uart5.dts @@ -0,0 +1,37 @@ +/dts-v1/; +/plugin/; + +// Enable 26pin I2C4, PWM7, SPI3 and UART5 +// https://forum.banana-pi.org/t/bananapif3-gpio-wiringpi-gpiod-python3-periphery-adafruit-blinka-and-luma-examples/18948 + +/ { + compatible = "spacemit,k1-x"; + + fragment@0 { + target = <&i2c4>; + __overlay__ { + status = "okay"; + }; + }; + + fragment@1 { + target = <&pwm7>; + __overlay__ { + status = "okay"; + }; + }; + + fragment@2 { + target = <&spi3>; + __overlay__ { + status = "okay"; + }; + }; + + fragment@3 { + target = <&uart5>; + __overlay__ { + status = "okay"; + }; + }; +}; diff --git a/patch/kernel/archive/spacemit-6.18/overlay/spacemit-fixup.scr-cmd b/patch/kernel/archive/spacemit-6.18/overlay/spacemit-fixup.scr-cmd new file mode 100644 index 0000000000..d4c39e20a3 --- /dev/null +++ b/patch/kernel/archive/spacemit-6.18/overlay/spacemit-fixup.scr-cmd @@ -0,0 +1,4 @@ +# overlays fixup script +# implements (or rather substitutes) overlay arguments functionality +# using u-boot scripting, environment variables and "fdt" command + diff --git a/patch/kernel/archive/spacemit-6.16/0000.patching_config.yaml b/patch/kernel/archive/spacemit-6.6/0000.patching_config.yaml similarity index 96% rename from patch/kernel/archive/spacemit-6.16/0000.patching_config.yaml rename to patch/kernel/archive/spacemit-6.6/0000.patching_config.yaml index ac1da4ec6c..09108a4d9a 100644 --- a/patch/kernel/archive/spacemit-6.16/0000.patching_config.yaml +++ b/patch/kernel/archive/spacemit-6.6/0000.patching_config.yaml @@ -12,11 +12,11 @@ config: # This is file 'patch/kernel/spacemit-legacy-6.1/0000.patching_config.ya # 5** for board specific patches # Just some info stuff; not used by the patching scripts - name: spacemit-6.16 + name: spacemit-6.6 kind: kernel type: vendor # or: edge - branch: linux-6.16.y - last-known-good-tag: v6.16 + branch: linux-6.6.y + last-known-good-tag: v6.6 maintainers: - { github: none, name: none, email: none, armbian-forum: none } diff --git a/patch/kernel/archive/spacemit-6.6/001-Add-board-BananaPi-BPI-F3.patch b/patch/kernel/archive/spacemit-6.6/001-Add-board-BananaPi-BPI-F3.patch deleted file mode 100644 index 1424b2a92a..0000000000 --- a/patch/kernel/archive/spacemit-6.6/001-Add-board-BananaPi-BPI-F3.patch +++ /dev/null @@ -1,1206 +0,0 @@ -From fc0e2955c4564266e632fbe6a800b13357db4c8f Mon Sep 17 00:00:00 2001 -From: Patrick Yavitz -Date: Sun, 23 Feb 2025 10:30:04 -0500 -Subject: [PATCH] Add board BananaPi BPI-F3 - -Signed-off-by: Patrick Yavitz ---- - arch/riscv/boot/dts/spacemit/Makefile | 2 + - .../boot/dts/spacemit/k1-bananapi-f3.dts | 1175 +++++++++++++++++ - 2 files changed, 1177 insertions(+) - create mode 100644 arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts - -diff --git a/arch/riscv/boot/dts/spacemit/Makefile b/arch/riscv/boot/dts/spacemit/Makefile -index fbc35eb25dd1..069722c63e3e 100644 ---- a/arch/riscv/boot/dts/spacemit/Makefile -+++ b/arch/riscv/boot/dts/spacemit/Makefile -@@ -10,3 +10,5 @@ dtb-$(CONFIG_SOC_SPACEMIT_K1X) += k1-x_fpga.dtb k1-x_fpga_1x4.dtb k1-x_fpga_2x2. - k1-x_ZT001H.dtb k1-x_uav.dtb k1-x_MUSE-Paper2.dtb \ - k1-x_bit-brick.dtb - obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y)) -+ -+dtb-$(CONFIG_SOC_SPACEMIT_K1X) += k1-bananapi-f3.dtb -diff --git a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts -new file mode 100644 -index 000000000000..1ea4527fffa8 ---- /dev/null -+++ b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts -@@ -0,0 +1,1175 @@ -+// SPDX-License-Identifier: (GPL-2.0 OR MIT) -+ -+/dts-v1/; -+ -+#include "k1-x.dtsi" -+#include "k1-x-efuse.dtsi" -+#include "k1-x_pinctrl.dtsi" -+#include "lcd/lcd_gx09inx101_mipi.dtsi" -+#include "k1-x-hdmi.dtsi" -+#include "k1-x-lcd.dtsi" -+#include "k1-x-camera-sdk.dtsi" -+#include "k1-x_opp_table.dtsi" -+#include "k1-x_thermal_cooling.dtsi" -+ -+/ { -+ model = "BananaPi BPI-F3"; -+ -+ chosen { -+ bootargs = "earlycon=sbi console=ttyS0,115200n8 loglevel=6 swiotlb=65536 rdinit=/init"; -+ stdout-path = "serial0:115200n8"; -+ }; -+ -+ cpus: cpus { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ timebase-frequency = <24000000>; -+ -+ cpu_0: cpu@0 { -+ cpu-ai = "true"; -+ }; -+ -+ cpu_1: cpu@1 { -+ cpu-ai = "true"; -+ }; -+ -+ cpu_2: cpu@2 { -+ reg = <2>; -+ cpu-ai = "true"; -+ }; -+ -+ cpu_3: cpu@3 { -+ reg = <3>; -+ cpu-ai = "true"; -+ }; -+ -+ cpu-map { -+ cluster0 { -+ core0 { -+ cpu = <&cpu_0>; -+ }; -+ -+ core1 { -+ cpu = <&cpu_1>; -+ }; -+ -+ core2 { -+ cpu = <&cpu_2>; -+ }; -+ -+ core3 { -+ cpu = <&cpu_3>; -+ }; -+ }; -+ -+ cluster1 { -+ core0 { -+ cpu = <&cpu_4>; -+ }; -+ -+ core1 { -+ cpu = <&cpu_5>; -+ }; -+ -+ core2 { -+ cpu = <&cpu_6>; -+ }; -+ -+ core3 { -+ cpu = <&cpu_7>; -+ }; -+ }; -+ }; -+ }; -+ -+ dc_12v: dc-12v { -+ compatible = "regulator-fixed"; -+ regulator-name = "dc_12v"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <12000000>; -+ regulator-max-microvolt = <12000000>; -+ }; -+ -+ fan: pwm-fan { -+ compatible = "pwm-fan"; -+ pwms = <&rpwm2 10000>; -+ #cooling-cells = <2>; -+ cooling-levels = <0 64 128 192 255>; -+ status = "okay"; -+ }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ -+ led1 { -+ label = "sys-led"; -+ gpios = <&gpio 96 0>; -+ linux,default-trigger = "heartbeat"; -+ default-state = "on"; -+ status = "okay"; -+ }; -+ }; -+ -+ memory@0 { -+ device_type = "memory"; -+ reg = <0x0 0x00000000 0x0 0x80000000>; -+ }; -+ -+ memory@100000000 { -+ device_type = "memory"; -+ reg = <0x1 0x00000000 0x0 0x80000000>; -+ }; -+ -+ reserved-memory { -+ #address-cells = <2>; -+ #size-cells = <2>; -+ ranges; -+ -+ linux,cma { -+ compatible = "shared-dma-pool"; -+ /* alloc memory from 0x40000000~0x80000000 */ -+ alloc-ranges = <0 0x40000000 0 0x40000000>; -+ /* size of cma buffer is 384MByte */ -+ size = <0 0x18000000>; -+ /* start address is 1Mbyte aligned */ -+ alignment = <0x0 0x100000>; -+ linux,cma-default; -+ /* besides hardware, dma for ex. buffer can be used by memory management */ -+ reusable; -+ }; -+ -+ /* reserved 384K for dpu, including mmu table(256K) and cmdlist(128K) */ -+ dpu_resv: dpu_reserved@2ff40000 { -+ compatible = "shared-dma-pool"; -+ reg = <0x0 0x2ff40000 0x0 0x000C0000>; -+ no-map; -+ }; -+ }; -+ -+ rf_pwrseq: rf-pwrseq { -+ compatible = "spacemit,rf-pwrseq"; -+ //vdd-supply = <&ldo_7>; -+ //vdd_voltage = <3300000>; -+ io-supply = <&dcdc_3>; -+ io_voltage = <1800000>; -+ pwr-gpios = <&gpio 67 0>; -+ status = "okay"; -+ -+ wlan_pwrseq: wlan-pwrseq { -+ compatible = "spacemit,wlan-pwrseq"; -+ regon-gpios = <&gpio 116 0>; -+ interrupt-parent = <&pinctrl>; -+ interrupts = <268>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_wlan_wakeup>; -+ }; -+ -+ bt_pwrseq: bt-pwrseq { -+ compatible = "spacemit,bt-pwrseq"; -+ reset-gpios = <&gpio 63 0>; -+ }; -+ }; -+ -+ vcc4v0_baseboard: vcc4v0-baseboard { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc4v0_baseboard"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <4000000>; -+ regulator-max-microvolt = <4000000>; -+ vin-supply = <&dc_12v>; -+ }; -+}; -+ -+/* ov16a10 */ -+&backsensor { -+ af_2v8-supply = <&ldo_3>; -+ avdd_2v8-supply = <&ldo_2>; -+ dovdd_1v8-supply = <&ldo_7>; -+ dvdd_1v2-supply = <&ldo_6>; -+ -+ pwdn-gpios = <&gpio 113 0>; -+ reset-gpios = <&gpio 111 0>; -+ -+ status = "okay"; -+}; -+ -+&backsensor_aux { -+ avdd_2v8-supply = <&ldo_2>; -+ dovdd_1v8-supply = <&ldo_7>; -+ -+ status = "disabled"; -+}; -+ -+&ccic0 { -+ power-domains = <&power K1X_PMU_ISP_PWR_DOMAIN>; -+ -+ status = "okay"; -+}; -+ -+&ccic1 { -+ power-domains = <&power K1X_PMU_ISP_PWR_DOMAIN>; -+ -+ status = "okay"; -+}; -+ -+&ccic2 { -+ power-domains = <&power K1X_PMU_ISP_PWR_DOMAIN>; -+ -+ status = "okay"; -+}; -+ -+&csiphy0 { -+ -+ status = "okay"; -+}; -+ -+&combphy { -+ status = "okay"; -+}; -+ -+&csiphy1 { -+ -+ status = "disabled"; -+}; -+ -+&csiphy2 { -+ spacemit,bifmode-enable; -+ -+ status = "okay"; -+}; -+ -+&cpp { -+ power-domains = <&power K1X_PMU_ISP_PWR_DOMAIN>; -+}; -+ -+&dpu_online2_dsi { -+ memory-region = <&dpu_resv>; -+ spacemit-dpu-bitclk = <1000000000>; -+ spacemit-dpu-escclk = <76800000>; -+ dsi_1v2-supply = <&ldo_5>; -+ vin-supply-names = "dsi_1v2"; -+ status = "disabled"; -+}; -+ -+&dpu_online2_hdmi { -+ memory-region = <&dpu_resv>; -+ status = "okay"; -+}; -+ -+&dsi2 { -+ status = "disabled"; -+ -+ panel2: panel2@0 { -+ status = "ok"; -+ compatible = "spacemit,mipi-panel2"; -+ reg = <0>; -+ -+ gpios-reset = <81>; -+ gpios-dc = <82 83>; -+ id = <2>; -+ delay-after-reset = <10>; -+ force-attached = "lcd_gx09inx101_mipi"; -+ }; -+}; -+ -+&hdmiaudio { -+ status = "okay"; -+}; -+ -+&hdmi{ -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_hdmi_0>; -+ status = "okay"; -+}; -+ -+&i2c0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_i2c0>; -+ spacemit,i2c-fast-mode; -+ status = "okay"; -+}; -+ -+&i2c2 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_i2c2_0>; -+ spacemit,i2c-fast-mode; -+ status = "okay"; -+ -+ eeprom@50{ -+ compatible = "atmel,24c02"; -+ reg = <0x50>; -+ #address-cells = <1>; -+ #size-cells = <1>; -+ -+ power-domains = <&power K1X_PMU_DUMMY_PWR_DOMAIN>; -+ status = "disabled"; -+ -+ mac_address0: mac_address0@0 { -+ reg = <0x0 6>; -+ }; -+ -+ mac_address1: mac_address1@6 { -+ reg = <0x6 6>; -+ }; -+ }; -+ -+ es8326: es8326@19{ -+ compatible = "everest,es8326"; -+ reg = <0x19>; -+ #sound-dai-cells = <0>; -+ interrupt-parent = <&gpio>; -+ interrupts = <126 1>; -+ spk-ctl-gpio = <&gpio 127 0>; -+ everest,mic1-src = [44]; -+ everest,mic2-src = [66]; -+ status = "okay"; -+ }; -+}; -+ -+&i2c3 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_i2c3_2>; -+ status = "disabled"; -+}; -+ -+&i2c4 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_i2c4_2>; -+ status = "disabled"; -+}; -+ -+&i2c6 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_i2c6_2>; -+ status = "disabled"; -+ -+ gt9xx@5d { -+ compatible = "goodix,gt9xx"; -+ reg = <0x5d>; -+ -+ reset-gpios = <&gpio 114 GPIO_ACTIVE_HIGH>; -+ irq-gpios = <&gpio 58 GPIO_ACTIVE_HIGH>; -+ irq-flags = <2>; -+ -+ touchscreen-max-id = <11>; -+ touchscreen-size-x = <1200>; -+ touchscreen-size-y = <1920>; -+ touchscreen-max-w = <512>; -+ touchscreen-max-p = <512>; -+ -+ goodix,int-sync = <1>; -+ status = "disabled"; -+ }; -+ -+}; -+ -+&i2c7 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_i2c7>; -+ status = "disabled"; -+}; -+ -+&i2c8 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_i2c8>; -+ status = "okay"; -+ -+ spm8821@41 { -+ compatible = "spacemit,spm8821"; -+ reg = <0x41>; -+ interrupt-parent = <&intc>; -+ interrupts = <64>; -+ status = "okay"; -+ -+ vcc_sys-supply = <&vcc4v0_baseboard>; -+ dcdc5-supply = <&dcdc_5>; -+ -+ regulators { -+ compatible = "pmic,regulator,spm8821"; -+ -+ /* buck */ -+ dcdc_1: DCDC_REG1 { -+ regulator-name = "dcdc1"; -+ regulator-min-microvolt = <500000>; -+ regulator-max-microvolt = <3450000>; -+ regulator-ramp-delay = <5000>; -+ regulator-always-on; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ regulator-suspend-microvolt = <650000>; -+ }; -+ }; -+ -+ dcdc_2: DCDC_REG2 { -+ regulator-name = "dcdc2"; -+ regulator-min-microvolt = <500000>; -+ regulator-max-microvolt = <3450000>; -+ regulator-ramp-delay = <5000>; -+ regulator-always-on; -+ }; -+ -+ dcdc_3: DCDC_REG3 { -+ regulator-name = "dcdc3"; -+ regulator-min-microvolt = <500000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-ramp-delay = <5000>; -+ regulator-always-on; -+ }; -+ -+ dcdc_4: DCDC_REG4 { -+ regulator-name = "dcdc4"; -+ regulator-min-microvolt = <500000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-ramp-delay = <5000>; -+ regulator-always-on; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ regulator-suspend-microvolt = <3300000>; -+ }; -+ }; -+ -+ dcdc_5: DCDC_REG5 { -+ regulator-name = "dcdc5"; -+ regulator-min-microvolt = <500000>; -+ regulator-max-microvolt = <3450000>; -+ regulator-ramp-delay = <5000>; -+ regulator-always-on; -+ }; -+ -+ dcdc_6: DCDC_REG6 { -+ regulator-name = "dcdc6"; -+ regulator-min-microvolt = <500000>; -+ regulator-max-microvolt = <3450000>; -+ regulator-ramp-delay = <5000>; -+ regulator-always-on; -+ }; -+ -+ /* aldo */ -+ ldo_1: LDO_REG1 { -+ regulator-name = "ldo1"; -+ regulator-min-microvolt = <500000>; -+ regulator-max-microvolt = <3400000>; -+ regulator-boot-on; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ regulator-suspend-microvolt = <500000>; -+ }; -+ }; -+ -+ ldo_2: LDO_REG2 { -+ regulator-name = "ldo2"; -+ regulator-min-microvolt = <500000>; -+ regulator-max-microvolt = <3400000>; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ regulator-suspend-microvolt = <500000>; -+ }; -+ }; -+ -+ ldo_3: LDO_REG3 { -+ regulator-name = "ldo3"; -+ regulator-min-microvolt = <500000>; -+ regulator-max-microvolt = <3400000>; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ regulator-suspend-microvolt = <500000>; -+ }; -+ }; -+ -+ ldo_4: LDO_REG4 { -+ regulator-name = "ldo4"; -+ regulator-min-microvolt = <500000>; -+ regulator-max-microvolt = <3400000>; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ regulator-suspend-microvolt = <500000>; -+ }; -+ }; -+ -+ /* dldo */ -+ ldo_5: LDO_REG5 { -+ regulator-name = "ldo5"; -+ regulator-min-microvolt = <500000>; -+ regulator-max-microvolt = <3400000>; -+ regulator-boot-on; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ regulator-suspend-microvolt = <500000>; -+ }; -+ }; -+ -+ ldo_6: LDO_REG6 { -+ regulator-name = "ldo6"; -+ regulator-min-microvolt = <500000>; -+ regulator-max-microvolt = <3400000>; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ regulator-suspend-microvolt = <500000>; -+ }; -+ }; -+ -+ ldo_7: LDO_REG7 { -+ regulator-name = "ldo7"; -+ regulator-min-microvolt = <500000>; -+ regulator-max-microvolt = <3400000>; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ regulator-suspend-microvolt = <500000>; -+ }; -+ }; -+ -+ ldo_8: LDO_REG8 { -+ regulator-name = "ldo8"; -+ regulator-min-microvolt = <500000>; -+ regulator-max-microvolt = <3400000>; -+ regulator-always-on; -+ }; -+ -+ ldo_9: LDO_REG9 { -+ regulator-name = "ldo9"; -+ regulator-min-microvolt = <500000>; -+ regulator-max-microvolt = <3400000>; -+ }; -+ -+ ldo_10: LDO_REG10 { -+ regulator-name = "ldo10"; -+ regulator-min-microvolt = <500000>; -+ regulator-max-microvolt = <3400000>; -+ regulator-always-on; -+ }; -+ -+ ldo_11: LDO_REG11 { -+ regulator-name = "ldo11"; -+ regulator-min-microvolt = <500000>; -+ regulator-max-microvolt = <3400000>; -+ }; -+ -+ sw_1: SWITCH_REG1 { -+ regulator-name = "switch1"; -+ }; -+ }; -+ -+ pmic_pinctrl: pinctrl { -+ compatible = "pmic,pinctrl,spm8821"; -+ gpio-controller; -+ #gpio-cells = <2>; -+ spacemit,npins = <6>; -+/** -+ * led_pins: led-pins { -+ * pins = "PIN3"; -+ * function = "sleep"; -+ * bias-disable = <0>; -+ * drive-open-drain = <0x1>; -+ * }; -+ */ -+ }; -+ -+ pwr_key: key { -+ compatible = "pmic,pwrkey,spm8821"; -+ }; -+ -+ ext_rtc: rtc { -+ compatible = "pmic,rtc,spm8821"; -+ }; -+ -+ ext_adc: adc { -+ compatible = "pmic,adc,spm8821"; -+ }; -+ }; -+}; -+ -+&i2s0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_sspa0_0>; -+ status = "okay"; -+}; -+ -+&ehci { -+ spacemit,reset-on-resume; -+ spacemit,udc-mode = ; -+ status = "disabled"; -+}; -+ -+&ehci1 { -+ /*spacemit,udc-mode = ;*/ -+ spacemit,reset-on-resume; -+ status = "okay"; -+}; -+ -+ð0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_gmac0>; -+ -+ emac,reset-gpio = <&gpio 110 0>; -+ emac,reset-active-low; -+ emac,reset-delays-us = <0 10000 100000>; -+ -+ /* store forward mode */ -+ tx-threshold = <1518>; -+ rx-threshold = <12>; -+ tx-ring-num = <1024>; -+ rx-ring-num = <1024>; -+ dma-burst-len = <5>; -+ -+ ref-clock-from-phy; -+ -+ clk-tuning-enable; -+ clk-tuning-by-delayline; -+ tx-phase = <60>; -+ rx-phase = <73>; -+ -+ nvmem-cells = <&mac_address0>; -+ nvmem-cell-names = "mac-address"; -+ -+ phy-handle = <&rgmii0>; -+ -+ status = "okay"; -+ -+ mdio-bus { -+ #address-cells = <0x1>; -+ #size-cells = <0x0>; -+ rgmii0: phy@0 { -+ compatible = "ethernet-phy-id001c.c916"; -+ device_type = "ethernet-phy"; -+ reg = <0x1>; -+ phy-mode = "rgmii"; -+ }; -+ }; -+}; -+ -+ð1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_gmac1>; -+ -+ emac,reset-gpio = <&gpio 115 0>; -+ emac,reset-active-low; -+ emac,reset-delays-us = <0 10000 100000>; -+ -+ /* store forward mode */ -+ tx-threshold = <1518>; -+ rx-threshold = <12>; -+ tx-ring-num = <1024>; -+ rx-ring-num = <1024>; -+ dma-burst-len = <5>; -+ -+ ref-clock-from-phy; -+ -+ clk-tuning-enable; -+ clk-tuning-by-delayline; -+ tx-phase = <90>; -+ rx-phase = <73>; -+ nvmem-cells = <&mac_address1>; -+ nvmem-cell-names = "mac-address"; -+ -+ phy-handle = <&rgmii1>; -+ -+ status = "okay"; -+ -+ mdio-bus { -+ #address-cells = <0x1>; -+ #size-cells = <0x0>; -+ rgmii1: phy@1 { -+ compatible = "ethernet-phy-id001c.c916"; -+ device_type = "ethernet-phy"; -+ reg = <0x1>; -+ phy-mode = "rgmii"; -+ }; -+ }; -+}; -+ -+&frontsensor { -+ af_2v8-supply = <&ldo_3>; -+ avdd_2v8-supply = <&ldo_2>; -+ dovdd_1v8-supply = <&ldo_7>; -+ dvdd_1v2-supply = <&ldo_6>; -+ -+ clocks = <&ccu CLK_CAMM1>; -+ clock-names = "cam_mclk1"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_camera1>; -+ -+ pwdn-gpios = <&gpio 114 0>; -+ reset-gpios = <&gpio 112 0>; -+ -+ status = "disabled"; -+}; -+ -+&gpio{ -+ gpio-ranges = < -+ &pinctrl 49 GPIO_49 2 -+ &pinctrl 58 GPIO_58 1 -+ &pinctrl 63 GPIO_63 3 -+ &pinctrl 67 GPIO_67 1 -+ &pinctrl 70 PRI_TDI 4 -+ &pinctrl 74 GPIO_74 1 -+ &pinctrl 80 GPIO_80 4 -+ &pinctrl 90 GPIO_90 3 -+ &pinctrl 96 DVL0 2 -+ &pinctrl 110 GPIO_110 1 -+ &pinctrl 111 GPIO_111 1 -+ &pinctrl 113 GPIO_113 1 -+ &pinctrl 114 GPIO_114 3 -+ &pinctrl 118 GPIO_118 1 -+ &pinctrl 123 GPIO_123 5 -+ >; -+}; -+ -+&imggpu { -+ status = "okay"; -+}; -+ -+&isp { -+ power-domains = <&power K1X_PMU_ISP_PWR_DOMAIN>; -+}; -+ -+&lcds { -+ status = "disabled"; -+}; -+ -+&otg { -+ usb-role-switch; -+ role-switch-user-control; -+ spacemit,reset-on-resume; -+ role-switch-default-mode = "peripheral"; -+ vbus-gpios = <&gpio 123 0>; -+ status = "disabled"; -+}; -+ -+&otg1 { -+ usb-role-switch; -+ role-switch-user-control; -+ spacemit,reset-on-resume; -+ role-switch-default-mode = "host"; -+ vbus-gpios = <&gpio 123 0>; -+ status = "disabled"; -+}; -+ -+&pcie1_rc { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_pcie1_3>; -+ status = "okay"; -+}; -+ -+&pcie2_rc { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_pcie2_4>; -+ num-lanes = <1>; -+ status = "okay"; -+}; -+ -+&pinctrl { -+ pinctrl-single,gpio-range = < -+ &range GPIO_49 2 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_3V_DS4) -+ &range GPIO_58 1 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) -+ &range GPIO_63 2 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) -+ &range GPIO_64 1 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) -+ &range GPIO_65 1 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) -+ &range GPIO_67 1 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_3V_DS4) -+ &range PRI_TDI 2 (MUX_MODE1 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) -+ &range PRI_TCK 1 (MUX_MODE1 | EDGE_NONE | PULL_DOWN | PAD_1V8_DS2) -+ &range PRI_TDO 1 (MUX_MODE1 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) -+ &range GPIO_74 1 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) -+ &range GPIO_80 1 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_3V_DS4) -+ &range GPIO_81 3 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) -+ &range GPIO_90 1 (MUX_MODE0 | EDGE_NONE | PULL_DOWN | PAD_1V8_DS2) -+ &range GPIO_91 2 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) -+ &range DVL0 1 (MUX_MODE1 | EDGE_NONE | PULL_DOWN | PAD_1V8_DS2) -+ &range DVL1 1 (MUX_MODE1 | EDGE_NONE | PULL_DOWN | PAD_1V8_DS0) -+ &range GPIO_110 1 (MUX_MODE0 | EDGE_NONE | PULL_DOWN | PAD_1V8_DS2) -+ &range GPIO_111 1 (MUX_MODE0 | EDGE_NONE | PULL_DOWN | PAD_1V8_DS2) -+ &range GPIO_113 1 (MUX_MODE0 | EDGE_NONE | PULL_DOWN | PAD_1V8_DS2) -+ &range GPIO_114 1 (MUX_MODE0 | EDGE_NONE | PULL_DOWN | PAD_1V8_DS2) -+ &range GPIO_115 1 (MUX_MODE0 | EDGE_NONE | PULL_DOWN | PAD_1V8_DS2) -+ &range GPIO_116 1 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) -+ &range GPIO_118 1 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) -+ &range GPIO_123 1 (MUX_MODE0 | EDGE_NONE | PULL_DOWN | PAD_1V8_DS0) -+ &range GPIO_124 1 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) -+ &range GPIO_125 3 (MUX_MODE0 | EDGE_NONE | PULL_DOWN | PAD_1V8_DS2) -+ >; -+ -+ pinctrl_rcpu: pinctrl_rcpu_grp { -+ pinctrl-single,pins = < -+ K1X_PADCONF(GPIO_47, MUX_MODE1, (EDGE_NONE | PULL_UP | PAD_3V_DS4)) /* r_uart0_tx */ -+ K1X_PADCONF(GPIO_48, MUX_MODE1, (EDGE_NONE | PULL_UP | PAD_3V_DS4)) /* r_uart0_rx */ -+ >; -+ }; -+ -+ pinctrl_gmac0: gmac0_grp { -+ pinctrl-single,pins =< -+ K1X_PADCONF(GPIO_00, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac0_rxdv */ -+ K1X_PADCONF(GPIO_01, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac0_rx_d0 */ -+ K1X_PADCONF(GPIO_02, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac0_rx_d1 */ -+ K1X_PADCONF(GPIO_03, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac0_rx_clk */ -+ K1X_PADCONF(GPIO_04, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac0_rx_d2 */ -+ K1X_PADCONF(GPIO_05, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac0_rx_d3 */ -+ K1X_PADCONF(GPIO_06, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac0_tx_d0 */ -+ K1X_PADCONF(GPIO_07, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac0_tx_d1 */ -+ K1X_PADCONF(GPIO_08, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac0_tx */ -+ K1X_PADCONF(GPIO_09, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac0_tx_d2 */ -+ K1X_PADCONF(GPIO_10, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac0_tx_d3 */ -+ K1X_PADCONF(GPIO_11, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac0_tx_en */ -+ K1X_PADCONF(GPIO_12, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS0)) /* gmac0_mdc */ -+ K1X_PADCONF(GPIO_13, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS0)) /* gmac0_mdio */ -+ K1X_PADCONF(GPIO_14, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac0_int_n */ -+ K1X_PADCONF(GPIO_45, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac0_clk_ref */ -+ >; -+ }; -+ -+ pinctrl_gmac1: gmac1_grp { -+ pinctrl-single,pins =< -+ K1X_PADCONF(GPIO_29, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac1_rxdv */ -+ K1X_PADCONF(GPIO_30, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac1_rx_d0 */ -+ K1X_PADCONF(GPIO_31, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac1_rx_d1 */ -+ K1X_PADCONF(GPIO_32, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac1_rx_clk */ -+ K1X_PADCONF(GPIO_33, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac1_rx_d2 */ -+ K1X_PADCONF(GPIO_34, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac1_rx_d3 */ -+ K1X_PADCONF(GPIO_35, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS0)) /* gmac1_tx_d0 */ -+ K1X_PADCONF(GPIO_36, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS0)) /* gmac1_tx_d1 */ -+ K1X_PADCONF(GPIO_37, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac1_tx */ -+ K1X_PADCONF(GPIO_38, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS0)) /* gmac1_tx_d2 */ -+ K1X_PADCONF(GPIO_39, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS0)) /* gmac1_tx_d3 */ -+ K1X_PADCONF(GPIO_40, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS0)) /* gmac1_tx_en */ -+ K1X_PADCONF(GPIO_41, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS0)) /* gmac1_mdc */ -+ K1X_PADCONF(GPIO_42, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS0)) /* gmac1_mdio */ -+ K1X_PADCONF(GPIO_43, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac1_int_n */ -+ K1X_PADCONF(GPIO_46, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac1_clk_ref */ -+ >; -+ }; -+ -+ pinctrl_wlan_wakeup: wlan_wakeup_grp { -+ pinctrl-single,pins =< -+ K1X_PADCONF(GPIO_66, MUX_MODE0, (EDGE_FALL | PULL_DOWN | PAD_3V_DS2)) /* wifi edge detect */ -+ >; -+ }; -+}; -+ -+&pwm7 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_pwm7_0>; -+ status = "disabled"; -+}; -+ -+&pwm14 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_pwm14_1>; -+ status = "okay"; -+}; -+ -+&pwm_bl { -+ pwms = <&pwm14 2000>; -+ brightness-levels = < -+ 0 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 -+ 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 -+ 40 40 40 40 40 40 40 40 40 41 42 43 44 45 46 47 -+ 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 -+ 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 -+ 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 -+ 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 -+ 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 -+ 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 -+ 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 -+ 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 -+ 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 -+ 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 -+ 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 -+ 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 -+ 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 -+ >; -+ default-brightness-level = <100>; -+ -+ status = "okay"; -+}; -+ -+&qspi { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_qspi>; -+ status = "okay"; -+ -+ flash@0 { -+ compatible = "jedec,spi-nor"; -+ reg = <0>; -+ spi-max-frequency = <26500000>; -+ m25p,fast-read; -+ broken-flash-reset; -+ status = "okay"; -+ }; -+}; -+ -+&rcpu { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_rcpu>; -+ mboxes = <&mailbox 0>, <&mailbox 1>; -+ mbox-names = "vq0", "vq1"; -+ memory-region = <&rcpu_mem_0>, <&rcpu_mem_heap>, <&vdev0vring0>, <&vdev0vring1>, <&vdev0buffer>, <&rsc_table>, <&rcpu_mem_snapshots>; -+ status = "okay"; -+}; -+ -+&rpwm2 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_rpwm2_0>; -+ status = "okay"; -+}; -+ -+/* SD */ -+&sdhci0 { -+ pinctrl-names = "default","fast"; -+ pinctrl-0 = <&pinctrl_mmc1>; -+ pinctrl-1 = <&pinctrl_mmc1_fast>; -+ bus-width = <4>; -+ cd-gpios = <&gpio 80 0>; -+ cd-inverted; -+ vmmc-supply = <&dcdc_4>; -+ vqmmc-supply = <&ldo_1>; -+ no-mmc; -+ no-sdio; -+ spacemit,sdh-host-caps-disable = <( -+ MMC_CAP_UHS_SDR12 | -+ MMC_CAP_UHS_SDR25 -+ )>; -+ spacemit,sdh-quirks = <( -+ SDHCI_QUIRK_BROKEN_CARD_DETECTION | -+ SDHCI_QUIRK_INVERTED_WRITE_PROTECT | -+ SDHCI_QUIRK_BROKEN_TIMEOUT_VAL -+ )>; -+ spacemit,sdh-quirks2 = <( -+ SDHCI_QUIRK2_PRESET_VALUE_BROKEN | -+ SDHCI_QUIRK2_BROKEN_PHY_MODULE | -+ SDHCI_QUIRK2_SET_AIB_MMC -+ )>; -+ spacemit,aib_mmc1_io_reg = <0xD401E81C>; -+ spacemit,apbc_asfar_reg = <0xD4015050>; -+ spacemit,apbc_assar_reg = <0xD4015054>; -+ spacemit,rx_dline_reg = <0x0>; -+ spacemit,tx_dline_reg = <0x0>; -+ spacemit,tx_delaycode = <0x5f>; -+ spacemit,rx_tuning_limit = <50>; -+ spacemit,sdh-freq = <204800000>; -+ status = "okay"; -+}; -+ -+/* SDIO */ -+&sdhci1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_mmc2>; -+ bus-width = <4>; -+ non-removable; -+ vqmmc-supply = <&dcdc_3>; -+ no-mmc; -+ no-sd; -+ keep-power-in-suspend; -+ /* bcmdhd use private oob solution rather than dat1/standard wakeup */ -+ /delete-property/ enable-sdio-wakeup; -+ spacemit,sdh-host-caps-disable = <( -+ MMC_CAP_UHS_DDR50 | -+ MMC_CAP_NEEDS_POLL -+ )>; -+ spacemit,sdh-quirks = <( -+ SDHCI_QUIRK_BROKEN_CARD_DETECTION | -+ SDHCI_QUIRK_BROKEN_TIMEOUT_VAL -+ )>; -+ spacemit,sdh-quirks2 = <( -+ SDHCI_QUIRK2_PRESET_VALUE_BROKEN | -+ SDHCI_QUIRK2_BROKEN_PHY_MODULE -+ )>; -+ spacemit,rx_dline_reg = <0x0>; -+ spacemit,tx_delaycode = <0x8f>; -+ spacemit,rx_tuning_limit = <50>; -+ spacemit,sdh-freq = <375000000>; -+ status = "okay"; -+}; -+ -+/* eMMC */ -+&sdhci2 { -+ bus-width = <8>; -+ non-removable; -+ mmc-hs400-1_8v; -+ mmc-hs400-enhanced-strobe; -+ no-sd; -+ no-sdio; -+ spacemit,sdh-quirks = <( -+ SDHCI_QUIRK_BROKEN_CARD_DETECTION | -+ SDHCI_QUIRK_BROKEN_TIMEOUT_VAL -+ )>; -+ spacemit,sdh-quirks2 = <( -+ SDHCI_QUIRK2_PRESET_VALUE_BROKEN -+ )>; -+ spacemit,sdh-freq = <375000000>; -+ status = "okay"; -+}; -+ -+&sound_hdmi { -+ status = "okay"; -+ simple-audio-card,cpu { -+ sound-dai = <&hdmiaudio>; -+ }; -+}; -+ -+&sound_codec { -+ status = "okay"; -+ simple-audio-card,name = "snd-es8326"; -+ spacemit,mclk-fs = <64>; -+ simple-audio-card,codec { -+ sound-dai = <&es8326>; -+ }; -+}; -+ -+&spi3 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_ssp3_0>; -+ status = "disabled"; -+ -+ spidev@0{ -+ compatible = "spacemit,k1x-spi"; -+ reg = <0>; -+ }; -+}; -+ -+&thermal { -+ sensor_range = <0x1 0x4>; -+}; -+ -+&thermal_zones { -+ top_thermal { -+ polling-delay = <0>; -+ polling-delay-passive = <0>; -+ thermal-sensors = <&thermal 1>; -+ -+ trips { -+ top_trip0: top-trip0 { -+ temperature = <40000>; -+ hysteresis = <5000>; -+ type = "passive"; -+ }; -+ -+ top_trip1: top-trip1 { -+ temperature = <55000>; -+ hysteresis = <5000>; -+ type = "passive"; -+ }; -+ -+ top_trip2: top-trip2 { -+ temperature = <70000>; -+ hysteresis = <5000>; -+ type = "passive"; -+ }; -+ -+ top_trip3: top-trip3 { -+ temperature = <85000>; -+ hysteresis = <5000>; -+ type = "passive"; -+ }; -+ }; -+ -+ cooling-maps { -+ map0 { -+ trip = <&top_trip0>; -+ cooling-device = <&fan 0 1>; -+ }; -+ -+ map1 { -+ trip = <&top_trip1>; -+ cooling-device = <&fan 1 2>; -+ }; -+ -+ map2 { -+ trip = <&top_trip2>; -+ cooling-device = <&fan 2 3>; -+ }; -+ -+ map3 { -+ trip = <&top_trip3>; -+ cooling-device = <&fan 3 4>; -+ }; -+ }; -+ }; -+ -+ gpu_thermal { -+ polling-delay = <0>; -+ polling-delay-passive = <0>; -+ thermal-sensors = <&thermal 2>; -+ -+ /* Just a placeholder */ -+ trips { -+ gpu_trip0: gpu-trip0 { -+ temperature = <40000>; -+ hysteresis = <5000>; -+ type = "passive"; -+ }; -+ }; -+ }; -+}; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_uart0_2>; -+ status = "okay"; -+}; -+ -+/* Bluetooth */ -+&uart2 { -+ status = "okay"; -+ pinctrl-0 = <&pinctrl_uart2>; -+ pinctrl-names = "default"; -+ uart-has-rtscts; -+ -+ bluetooth { -+ compatible = "realtek,rtl8723ds-bt"; -+ device-wake-gpios = <&gpio 64 GPIO_ACTIVE_HIGH>; -+ host-wake-gpios = <&gpio 65 GPIO_ACTIVE_HIGH>; -+ }; -+}; -+ -+&udc { -+ /*spacemit,udc-mode = ;*/ -+ spacemit,udc-mode = ; -+ status = "okay"; -+}; -+ -+&udc1 { -+ /*spacemit,udc-mode = ;*/ -+ spacemit,udc-mode = ; -+ status = "disabled"; -+}; -+ -+&usbdrd3 { -+ status = "okay"; -+ reset-on-resume; -+ dwc3@c0a00000 { -+ dr_mode = "host"; -+ phy_type = "utmi"; -+ snps,hsphy_interface = "utmi"; -+ snps,dis_enblslpm_quirk; -+ snps,dis_u2_susphy_quirk; -+ snps,dis_u3_susphy_quirk; -+ snps,dis-del-phy-power-chg-quirk; -+ snps,dis-tx-ipgap-linecheck-quirk; -+ snps,parkmode-disable-ss-quirk; -+ }; -+}; -+ -+&usb3hub { -+ hub-gpios = < -+ &gpio 123 0 /* usb3 hub en */ -+ &gpio 124 0>; /* usb3 hub rst*/ -+ vbus-gpios = <&gpio 97 0>; /* gpio_97 for usb3 hub output vbus */ -+ status = "okay"; -+}; -+ -+&usbphy { -+ status = "okay"; -+}; -+ -+&usbphy1 { -+ status = "okay"; -+}; -+ -+&usb2phy { -+ status = "okay"; -+}; -+ -+&vi { -+ power-domains = <&power K1X_PMU_ISP_PWR_DOMAIN>; -+}; --- -2.39.5 - diff --git a/patch/kernel/archive/spacemit-6.6/007-Add-k1-bananapi-f3-overlays.patch b/patch/kernel/archive/spacemit-6.6/007-Add-k1-bananapi-f3-overlays.patch deleted file mode 100644 index 04d96c5177..0000000000 --- a/patch/kernel/archive/spacemit-6.6/007-Add-k1-bananapi-f3-overlays.patch +++ /dev/null @@ -1,107 +0,0 @@ -From 1fd78e3e85d2f753909e3c9a9434c14d55762c1f Mon Sep 17 00:00:00 2001 -From: Patrick Yavitz -Date: Sat, 15 Feb 2025 16:58:11 -0500 -Subject: [PATCH] Add k1-bananapi-f3 overlays - -Signed-off-by: Patrick Yavitz ---- - arch/riscv/boot/dts/spacemit/Makefile | 2 + - arch/riscv/boot/dts/spacemit/overlay/Makefile | 10 +++++ - .../overlay/k1-bananapi-f3-disable-qspi.dts | 13 +++++++ - .../k1-bananapi-f3-i2c4-pwm7-spi3-uart5.dts | 37 +++++++++++++++++++ - 4 files changed, 62 insertions(+) - create mode 100644 arch/riscv/boot/dts/spacemit/overlay/Makefile - create mode 100644 arch/riscv/boot/dts/spacemit/overlay/k1-bananapi-f3-disable-qspi.dts - create mode 100644 arch/riscv/boot/dts/spacemit/overlay/k1-bananapi-f3-i2c4-pwm7-spi3-uart5.dts - -diff --git a/arch/riscv/boot/dts/spacemit/Makefile b/arch/riscv/boot/dts/spacemit/Makefile -index 069722c63e3e..c342c1129922 100644 ---- a/arch/riscv/boot/dts/spacemit/Makefile -+++ b/arch/riscv/boot/dts/spacemit/Makefile -@@ -12,3 +12,5 @@ dtb-$(CONFIG_SOC_SPACEMIT_K1X) += k1-x_fpga.dtb k1-x_fpga_1x4.dtb k1-x_fpga_2x2. - obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y)) - - dtb-$(CONFIG_SOC_SPACEMIT_K1X) += k1-bananapi-f3.dtb -+ -+subdir-y += overlay -diff --git a/arch/riscv/boot/dts/spacemit/overlay/Makefile b/arch/riscv/boot/dts/spacemit/overlay/Makefile -new file mode 100644 -index 000000000000..5b6e0e38931f ---- /dev/null -+++ b/arch/riscv/boot/dts/spacemit/overlay/Makefile -@@ -0,0 +1,10 @@ -+# SPDX-License-Identifier: GPL-2.0 -+dtbo-$(CONFIG_ARCH_RV64I) += \ -+ k1-bananapi-f3-disable-qspi.dtbo \ -+ k1-bananapi-f3-i2c4-pwm7-spi3-uart5.dtbo -+ -+targets += dtbs dtbs_install -+targets += $(dtbo-y) -+ -+always-y := $(dtbo-y) -+clean-files := *.dtbo -diff --git a/arch/riscv/boot/dts/spacemit/overlay/k1-bananapi-f3-disable-qspi.dts b/arch/riscv/boot/dts/spacemit/overlay/k1-bananapi-f3-disable-qspi.dts -new file mode 100644 -index 000000000000..df23c4a4f80e ---- /dev/null -+++ b/arch/riscv/boot/dts/spacemit/overlay/k1-bananapi-f3-disable-qspi.dts -@@ -0,0 +1,13 @@ -+/dts-v1/; -+/plugin/; -+ -+/ { -+ compatible = "spacemit,k1-x"; -+ -+ fragment@0 { -+ target = <&qspi>; -+ __overlay__ { -+ status = "disabled"; -+ }; -+ }; -+}; -diff --git a/arch/riscv/boot/dts/spacemit/overlay/k1-bananapi-f3-i2c4-pwm7-spi3-uart5.dts b/arch/riscv/boot/dts/spacemit/overlay/k1-bananapi-f3-i2c4-pwm7-spi3-uart5.dts -new file mode 100644 -index 000000000000..01e487b207d6 ---- /dev/null -+++ b/arch/riscv/boot/dts/spacemit/overlay/k1-bananapi-f3-i2c4-pwm7-spi3-uart5.dts -@@ -0,0 +1,37 @@ -+/dts-v1/; -+/plugin/; -+ -+// Enable 26pin I2C4, PWM7, SPI3 and UART5 -+// https://forum.banana-pi.org/t/bananapif3-gpio-wiringpi-gpiod-python3-periphery-adafruit-blinka-and-luma-examples/18948 -+ -+/ { -+ compatible = "spacemit,k1-x"; -+ -+ fragment@0 { -+ target = <&i2c4>; -+ __overlay__ { -+ status = "okay"; -+ }; -+ }; -+ -+ fragment@1 { -+ target = <&pwm7>; -+ __overlay__ { -+ status = "okay"; -+ }; -+ }; -+ -+ fragment@2 { -+ target = <&spi3>; -+ __overlay__ { -+ status = "okay"; -+ }; -+ }; -+ -+ fragment@3 { -+ target = <&uart5>; -+ __overlay__ { -+ status = "okay"; -+ }; -+ }; -+}; --- -2.39.5 - diff --git a/patch/kernel/archive/spacemit-6.6/dt/Makefile b/patch/kernel/archive/spacemit-6.6/dt/Makefile new file mode 100644 index 0000000000..9b60c58f5f --- /dev/null +++ b/patch/kernel/archive/spacemit-6.6/dt/Makefile @@ -0,0 +1,17 @@ +dtb-$(CONFIG_SOC_SPACEMIT_K1PRO) += k1-pro_sim.dtb k1-pro_fpga.dtb k1-pro_fpga_1x4.dtb \ + k1-pro_fpga_2x2.dtb k1-pro_qemu.dtb k1-pro_verify.dtb +dtb-$(CONFIG_SOC_SPACEMIT_K1X) += k1-x_fpga.dtb k1-x_fpga_1x4.dtb k1-x_fpga_2x2.dtb k1-x_evb.dtb \ + k1-x_deb2.dtb k1-x_deb1.dtb k1-x_hs450.dtb k1-x_kx312.dtb \ + k1-x_MINI-PC.dtb k1-x_MUSE-N1.dtb k1-x_mingo.dtb \ + k1-x_MUSE-Pi.dtb k1-x_milkv-jupiter.dtb m1-x_milkv-jupiter.dtb \ + k1-x_MUSE-Book.dtb k1-x_lpi3a.dtb k1-x_MUSE-Card.dtb \ + k1-x_MUSE-Paper.dtb k1-x_MUSE-Paper-mini-4g.dtb \ + k1-x_baton-camera.dtb k1-x_FusionOne.dtb k1-x_orangepi-rv2.dtb \ + k1-x_ZT001H.dtb k1-x_uav.dtb k1-x_MUSE-Paper2.dtb \ + k1-x_bit-brick.dtb +obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y)) + +dtb-$(CONFIG_SOC_SPACEMIT_K1X) += k1-bananapi-f3.dtb +dtb-$(CONFIG_SOC_SPACEMIT_K1X) += k1-musepi-pro.dtb + +subdir-y += overlay diff --git a/patch/kernel/archive/spacemit-6.16/dt/k1-bananapi-f3.dts b/patch/kernel/archive/spacemit-6.6/dt/k1-bananapi-f3.dts similarity index 100% rename from patch/kernel/archive/spacemit-6.16/dt/k1-bananapi-f3.dts rename to patch/kernel/archive/spacemit-6.6/dt/k1-bananapi-f3.dts diff --git a/patch/kernel/archive/spacemit-6.6/dt/k1-musepi-pro.dts b/patch/kernel/archive/spacemit-6.6/dt/k1-musepi-pro.dts new file mode 100644 index 0000000000..71f740b147 --- /dev/null +++ b/patch/kernel/archive/spacemit-6.6/dt/k1-musepi-pro.dts @@ -0,0 +1,1153 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* Copyright (c) 2023 Spacemit, Inc */ + +/dts-v1/; + +#include "k1-x.dtsi" +#include "k1-x-efuse.dtsi" +#include "k1-x_pinctrl.dtsi" +#include "lcd_tc358762xbg_dpi_800x480.dtsi" +#include "k1-x-hdmi.dtsi" +#include "k1-x-lcd.dtsi" +#include "k1-x-camera-sdk.dtsi" +#include "k1-x_opp_table.dtsi" +#include "k1-x_thermal_cooling.dtsi" + +/ { + model = "SpacemiT MusePi Pro"; + modules_usrload = "8852bs"; + + chosen { + bootargs = "earlycon=sbi console=ttyS0,115200n8 swiotlb=65536 rdinit=/init"; + stdout-path = "serial0:115200n8"; + }; + + cpus: cpus { + #address-cells = <1>; + #size-cells = <0>; + timebase-frequency = <24000000>; + + cpu_0: cpu@0 { + cpu-ai = "true"; + }; + + cpu_1: cpu@1 { + cpu-ai = "true"; + }; + + cpu_2: cpu@2 { + reg = <2>; + cpu-ai = "true"; + }; + + cpu_3: cpu@3 { + reg = <3>; + cpu-ai = "true"; + }; + + cpu-map { + cluster0 { + core0 { + cpu = <&cpu_0>; + }; + + core1 { + cpu = <&cpu_1>; + }; + + core2 { + cpu = <&cpu_2>; + }; + + core3 { + cpu = <&cpu_3>; + }; + }; + + cluster1 { + core0 { + cpu = <&cpu_4>; + }; + + core1 { + cpu = <&cpu_5>; + }; + + core2 { + cpu = <&cpu_6>; + }; + + core3 { + cpu = <&cpu_7>; + }; + }; + }; + }; + + dc_12v: dc-12v { + compatible = "regulator-fixed"; + regulator-name = "dc_12v"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <12000000>; + regulator-max-microvolt = <12000000>; + }; + + leds { + compatible = "gpio-leds"; + + led1 { + label = "sys-led"; + gpios = <&gpio 96 0>; + linux,default-trigger = "heartbeat"; + default-state = "on"; + status = "okay"; + }; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x00000000 0x0 0x80000000>; + }; + + memory@100000000 { + device_type = "memory"; + reg = <0x1 0x00000000 0x0 0x80000000>; + }; + + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + linux,cma { + compatible = "shared-dma-pool"; + /* alloc memory from 0x40000000~0x70000000 */ + alloc-ranges = <0 0x40000000 0 0x30000000>; + /* size of cma buffer is 384MByte */ + size = <0 0x18000000>; + /* start address is 1Mbyte aligned */ + alignment = <0x0 0x100000>; + linux,cma-default; + /* besides hardware, dma for ex. buffer can be used by memory management */ + reusable; + }; + + /* reserved 384K for dpu, including mmu table(256K) and cmdlist(128K) */ + dpu_resv: dpu_reserved@2ff40000 { + compatible = "shared-dma-pool"; + reg = <0x0 0x2ff40000 0x0 0x000C0000>; + no-map; + }; + }; + + rf_pwrseq: rf-pwrseq { + compatible = "spacemit,rf-pwrseq"; + //vdd-supply = <&ldo_7>; + //vdd_voltage = <3300000>; + io-supply = <&dcdc_3>; + io_voltage = <1800000>; + pwr-gpios = <&gpio 67 0>; + status = "okay"; + + wlan_pwrseq: wlan-pwrseq { + compatible = "spacemit,wlan-pwrseq"; + regon-gpios = <&gpio 116 0>; + interrupt-parent = <&pinctrl>; + interrupts = <268>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_wlan_wakeup>; + }; + + bt_pwrseq: bt-pwrseq { + compatible = "spacemit,bt-pwrseq"; + reset-gpios = <&gpio 63 GPIO_ACTIVE_HIGH>; + }; + }; + + vcc4v0_baseboard: vcc4v0-baseboard { + compatible = "regulator-fixed"; + regulator-name = "vcc4v0_baseboard"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <4000000>; + regulator-max-microvolt = <4000000>; + vin-supply = <&dc_12v>; + }; +}; + +/* MIPI CSI1, clk lane1 */ +&backsensor { + pwdn-gpios = <&gpio 113 0>; + dvdd-powen-gpios = <&gpio 115 0>; + + mclk-disable; + + status = "okay"; +}; + +/* MIPI CSI3 data line2,3 clk lane2 */ +&backsensor_aux { + af_2v8-supply = <&ldo_3>; + avdd_2v8-supply = <&ldo_2>; + dovdd_1v8-supply = <&ldo_7>; + dvdd_1v2-supply = <&ldo_6>; + + pwdn-gpios = <&gpio 124 0>; + reset-gpios = <&gpio 97 0>; + + pinmulti-enable; + twsi-index = <0>; + clocks = <&ccu CLK_CAMM0>; + clock-names = "cam_mclk0"; + pinctrl-names = "mclk_multi"; + pinctrl-0 = <&pinctrl_camera0>; + + status = "disabled"; +}; + +&ccic0 { + power-domains = <&power K1X_PMU_ISP_PWR_DOMAIN>; + + status = "okay"; +}; + +&ccic1 { + power-domains = <&power K1X_PMU_ISP_PWR_DOMAIN>; + + status = "okay"; +}; + +&ccic2 { + power-domains = <&power K1X_PMU_ISP_PWR_DOMAIN>; + + status = "okay"; +}; + +&combphy { + status = "okay"; +}; + +&cpp { + power-domains = <&power K1X_PMU_ISP_PWR_DOMAIN>; +}; + +&csiphy0 { + + status = "okay"; +}; + +&csiphy1 { + + status = "disabled"; +}; + +&csiphy2 { + spacemit,bifmode-enable; + status = "okay"; +}; + +&dpu_online2_dsi { + memory-region = <&dpu_resv>; + spacemit-dpu-bitclk = <700000000>; + + spacemit-dpu-escclk = <76800000>; + dsi_1v2-supply = <&ldo_5>; + vin-supply-names = "dsi_1v2"; + status = "disabled"; +}; + +&dsi2 { + status = "disabled"; + force-attached = "lcd_tc358762xbg_dpi_800x480"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + + dsi1_output: endpoint@1 { + reg = <1>; + remote-endpoint = <&panel_in>; + }; + }; + }; + + dpi_panel: panel@0 { + status = "ok"; + compatible = "raspberrypi,dpi-panel"; + }; +}; + +&dpu_online2_hdmi { + memory-region = <&dpu_resv>; + status = "okay"; +}; + +&ehci { + spacemit,reset-on-resume; + spacemit,udc-mode = ; + status = "disabled"; +}; + +&ehci1 { + spacemit,udc-mode = ; + spacemit,reset-on-resume; + status = "okay"; +}; + +ð0 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_gmac0>; + + emac,reset-gpio = <&gpio 110 0>; + emac,reset-active-low; + emac,reset-delays-us = <0 10000 100000>; + + /* store forward mode */ + tx-threshold = <1518>; + rx-threshold = <12>; + tx-ring-num = <1024>; + rx-ring-num = <1024>; + dma-burst-len = <5>; + + ref-clock-from-phy; + + clk-tuning-enable; + clk-tuning-by-delayline; + tx-phase = <60>; + rx-phase = <73>; + + nvmem-cells = <&mac_address0>; + nvmem-cell-names = "mac-address"; + + phy-handle = <&rgmii0>; + + status = "okay"; + + mdio-bus { + #address-cells = <0x1>; + #size-cells = <0x0>; + rgmii0: phy@0 { + compatible = "ethernet-phy-id001c.c916"; + device_type = "ethernet-phy"; + reg = <0x1>; + phy-mode = "rgmii"; + + leds { + #address-cells = <1>; + #size-cells = <0>; + + lan0-led1@1 { + reg = <1>; + linux,default-trigger = "netdev"; + }; + + lan0-led2@2 { + reg = <2>; + linux,default-trigger = "netdev"; + }; + }; + }; + }; +}; + +/* MIPI CSI3 data line0,1 clk lane3 */ +&frontsensor { + pwdn-gpios = <&gpio 114 0>; + dvdd-powen-gpios = <&gpio 115 0>; + + twsi-index = <1>; + + //mclk can disable + mclk-disable; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_camera1>; + + status = "okay"; +}; + +&gpio{ + gpio-ranges = < + &pinctrl 49 GPIO_49 2 + &pinctrl 58 GPIO_58 1 + &pinctrl 63 GPIO_63 1 + &pinctrl 65 GPIO_65 1 + &pinctrl 67 GPIO_67 1 + &pinctrl 70 PRI_TDI 4 + &pinctrl 74 GPIO_74 1 + &pinctrl 79 GPIO_79 1 + &pinctrl 80 GPIO_80 4 + &pinctrl 90 GPIO_90 3 + &pinctrl 96 DVL0 2 + &pinctrl 110 GPIO_110 1 + &pinctrl 111 GPIO_111 1 + &pinctrl 113 GPIO_113 1 + &pinctrl 114 GPIO_114 3 + &pinctrl 118 GPIO_118 1 + &pinctrl 123 GPIO_123 5 + >; +}; + +&hdmi{ + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_hdmi_0>; + status = "okay"; +}; + +&hdmiaudio { + status = "okay"; +}; + +&lcds { + status = "disabled"; +}; + +&i2c0 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c0>; + spacemit,i2c-fast-mode; + status = "okay"; +}; + +&i2c1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c1>; + spacemit,i2c-fast-mode; + status = "okay"; +}; + +&i2c2 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c2_0>; + spacemit,i2c-fast-mode; + status = "okay"; + + eeprom@50{ + compatible = "atmel,24c02"; + reg = <0x50>; + #address-cells = <1>; + #size-cells = <1>; + + power-domains = <&power K1X_PMU_DUMMY_PWR_DOMAIN>; + status = "disabled"; + + mac_address0: mac_address0@0 { + reg = <0x0 6>; + }; + + mac_address1: mac_address1@6 { + reg = <0x6 6>; + }; + }; + + es8326: es8326@19{ + compatible = "everest,es8326"; + reg = <0x19>; + #sound-dai-cells = <0>; + interrupt-parent = <&gpio>; + interrupts = <126 1>; + everest,mic1-src = [44]; + everest,mic2-src = [66]; + status = "okay"; + }; +}; + +&i2c3 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c3_0>; + status = "okay"; +}; + +&i2c4 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c4_0>; + status = "okay"; +}; + +&i2c5 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c5_0>; + status = "disabled"; + + raspits-panel@45 { + status = "okay"; + compatible = "raspberrypi,7inch-touchscreen-panel"; + reg = <0x45>; + enable-gpio = <&gpio 83 0>; + + port { + panel_in: endpoint { + remote-endpoint = <&dsi1_output>; + }; + }; + }; + + raspits-touch-ft5426@38 { + status = "okay"; + compatible = "raspits_ft5426"; + reg = <0x38>; + }; +}; + +&i2c6 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c6_2>; + status = "disabled"; + + gt9xx@5d { + compatible = "goodix,gt9xx"; + reg = <0x5d>; + + reset-gpios = <&gpio 114 GPIO_ACTIVE_HIGH>; + irq-gpios = <&gpio 58 GPIO_ACTIVE_HIGH>; + irq-flags = <2>; + + touchscreen-max-id = <11>; + touchscreen-size-x = <1200>; + touchscreen-size-y = <1920>; + touchscreen-max-w = <512>; + touchscreen-max-p = <512>; + + goodix,int-sync = <1>; + status = "disabled"; + }; + +}; + +&i2c7 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c7>; + status = "disabled"; +}; + +&i2c8 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c8>; + status = "okay"; + + spm8821@41 { + compatible = "spacemit,spm8821"; + reg = <0x41>; + interrupt-parent = <&intc>; + interrupts = <64>; + status = "okay"; + + vcc_sys-supply = <&vcc4v0_baseboard>; + dcdc5-supply = <&dcdc_5>; + + regulators { + compatible = "pmic,regulator,spm8821"; + + /* buck */ + dcdc_1: DCDC_REG1 { + regulator-name = "dcdc1"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <3450000>; + regulator-ramp-delay = <5000>; + regulator-always-on; + + regulator-state-mem { + regulator-off-in-suspend; + regulator-suspend-microvolt = <650000>; + }; + }; + + dcdc_2: DCDC_REG2 { + regulator-name = "dcdc2"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <3450000>; + regulator-ramp-delay = <5000>; + regulator-always-on; + }; + + dcdc_3: DCDC_REG3 { + regulator-name = "dcdc3"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <1800000>; + regulator-ramp-delay = <5000>; + regulator-always-on; + }; + + dcdc_4: DCDC_REG4 { + regulator-name = "dcdc4"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <3300000>; + regulator-ramp-delay = <5000>; + regulator-always-on; + + regulator-state-mem { + regulator-off-in-suspend; + regulator-suspend-microvolt = <3300000>; + }; + }; + + dcdc_5: DCDC_REG5 { + regulator-name = "dcdc5"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <3450000>; + regulator-ramp-delay = <5000>; + regulator-always-on; + }; + + dcdc_6: DCDC_REG6 { + regulator-name = "dcdc6"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <3450000>; + regulator-ramp-delay = <5000>; + regulator-always-on; + }; + + /* aldo */ + ldo_1: LDO_REG1 { + regulator-name = "ldo1"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <3400000>; + regulator-boot-on; + + /* set the min voltage means will disable this vol in suspend for ldo */ + regulator-state-mem { + regulator-off-in-suspend; + regulator-suspend-microvolt = <500000>; + }; + }; + + ldo_2: LDO_REG2 { + regulator-name = "ldo2"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <3400000>; + + regulator-state-mem { + regulator-off-in-suspend; + regulator-suspend-microvolt = <500000>; + }; + }; + + ldo_3: LDO_REG3 { + regulator-name = "ldo3"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <3400000>; + + regulator-state-mem { + regulator-off-in-suspend; + regulator-suspend-microvolt = <500000>; + }; + }; + + ldo_4: LDO_REG4 { + regulator-name = "ldo4"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <3400000>; + + regulator-state-mem { + regulator-off-in-suspend; + regulator-suspend-microvolt = <500000>; + }; + }; + + /* dldo */ + ldo_5: LDO_REG5 { + regulator-name = "ldo5"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <3400000>; + regulator-boot-on; + + regulator-state-mem { + regulator-off-in-suspend; + regulator-suspend-microvolt = <500000>; + }; + }; + + ldo_6: LDO_REG6 { + regulator-name = "ldo6"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <3400000>; + + regulator-state-mem { + regulator-off-in-suspend; + regulator-suspend-microvolt = <500000>; + }; + }; + + ldo_7: LDO_REG7 { + regulator-name = "ldo7"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <3400000>; + + regulator-state-mem { + regulator-off-in-suspend; + regulator-suspend-microvolt = <500000>; + }; + }; + + ldo_8: LDO_REG8 { + regulator-name = "ldo8"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <3400000>; + regulator-always-on; + }; + + ldo_9: LDO_REG9 { + regulator-name = "ldo9"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <3400000>; + }; + + ldo_10: LDO_REG10 { + regulator-name = "ldo10"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <3400000>; + regulator-always-on; + }; + + ldo_11: LDO_REG11 { + regulator-name = "ldo11"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <3400000>; + }; + + sw_1: SWITCH_REG1 { + regulator-name = "switch1"; + }; + }; + + pmic_pinctrl: pinctrl { + compatible = "pmic,pinctrl,spm8821"; + gpio-controller; + #gpio-cells = <2>; + spacemit,npins = <6>; +/** + * led_pins: led-pins { + * pins = "PIN3"; + * function = "sleep"; + * bias-disable = <0>; + * drive-open-drain = <0x1>; + * }; + */ + }; + + pwr_key: key { + compatible = "pmic,pwrkey,spm8821"; + }; + + ext_rtc: rtc { + compatible = "pmic,rtc,spm8821"; + }; + + ext_adc: adc { + compatible = "pmic,adc,spm8821"; + }; + }; +}; + +&pcie1_rc { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_pcie1_3>; + status = "okay"; +}; + +&pcie2_rc { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_pcie2_5>; + status = "okay"; +}; + +&imggpu { + status = "okay"; +}; + +&i2s0 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_sspa0_2>; + status = "okay"; +}; + +&isp { + power-domains = <&power K1X_PMU_ISP_PWR_DOMAIN>; +}; + +&otg { + usb-role-switch; + role-switch-user-control; + spacemit,reset-on-resume; + role-switch-default-mode = "peripheral"; + vbus-gpios = <&gpio 123 0>; + status = "disabled"; +}; + +&otg1 { + usb-role-switch; + role-switch-user-control; + spacemit,reset-on-resume; + role-switch-default-mode = "host"; + vbus-gpios = <&gpio 123 0>; + status = "disabled"; +}; + +&pinctrl { + pinctrl-single,gpio-range = < + &range GPIO_49 2 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_3V_DS4) + &range GPIO_58 1 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) + &range GPIO_63 1 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) + &range GPIO_64 1 (MUX_MODE1 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) + &range GPIO_65 1 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) + &range GPIO_67 1 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_3V_DS4) + &range PRI_TDI 2 (MUX_MODE1 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) + &range PRI_TCK 1 (MUX_MODE1 | EDGE_NONE | PULL_DOWN | PAD_1V8_DS2) + &range PRI_TDO 1 (MUX_MODE1 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) + &range GPIO_74 1 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) + &range GPIO_79 1 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) + &range GPIO_80 1 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_3V_DS4) + &range GPIO_81 3 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) + &range GPIO_90 1 (MUX_MODE0 | EDGE_NONE | PULL_DOWN | PAD_1V8_DS2) + &range GPIO_91 2 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) + &range DVL0 1 (MUX_MODE1 | EDGE_NONE | PULL_DOWN | PAD_1V8_DS2) + &range DVL1 1 (MUX_MODE1 | EDGE_NONE | PULL_DOWN | PAD_1V8_DS0) + &range GPIO_110 1 (MUX_MODE0 | EDGE_NONE | PULL_DOWN | PAD_1V8_DS2) + &range GPIO_111 1 (MUX_MODE0 | EDGE_NONE | PULL_DOWN | PAD_1V8_DS2) + &range GPIO_113 1 (MUX_MODE0 | EDGE_NONE | PULL_DOWN | PAD_1V8_DS2) + &range GPIO_114 1 (MUX_MODE0 | EDGE_NONE | PULL_DOWN | PAD_1V8_DS2) + &range GPIO_115 1 (MUX_MODE0 | EDGE_NONE | PULL_DOWN | PAD_1V8_DS2) + &range GPIO_116 1 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) + &range GPIO_118 1 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) + &range GPIO_123 1 (MUX_MODE0 | EDGE_NONE | PULL_DOWN | PAD_1V8_DS0) + &range GPIO_124 1 (MUX_MODE0 | EDGE_NONE | PULL_UP | PAD_1V8_DS2) + &range GPIO_125 3 (MUX_MODE0 | EDGE_NONE | PULL_DOWN | PAD_1V8_DS2) + >; + + pinctrl_rcpu: pinctrl_rcpu_grp { + pinctrl-single,pins = < + K1X_PADCONF(GPIO_47, MUX_MODE1, (EDGE_NONE | PULL_UP | PAD_3V_DS4)) /* r_uart0_tx */ + K1X_PADCONF(GPIO_48, MUX_MODE1, (EDGE_NONE | PULL_UP | PAD_3V_DS4)) /* r_uart0_rx */ + >; + }; + + pinctrl_rpwm7_0: rpwm7_0_grp { + pinctrl-single,pins = < + K1X_PADCONF(GPIO_52, MUX_MODE3, (EDGE_NONE | PULL_UP | PAD_3V_DS4)) /* rcpu_pwm7 */ + >; + }; + + pinctrl_gmac0: gmac0_grp { + pinctrl-single,pins =< + K1X_PADCONF(GPIO_00, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac0_rxdv */ + K1X_PADCONF(GPIO_01, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac0_rx_d0 */ + K1X_PADCONF(GPIO_02, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac0_rx_d1 */ + K1X_PADCONF(GPIO_03, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac0_rx_clk */ + K1X_PADCONF(GPIO_04, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac0_rx_d2 */ + K1X_PADCONF(GPIO_05, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac0_rx_d3 */ + K1X_PADCONF(GPIO_06, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac0_tx_d0 */ + K1X_PADCONF(GPIO_07, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac0_tx_d1 */ + K1X_PADCONF(GPIO_08, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac0_tx */ + K1X_PADCONF(GPIO_09, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac0_tx_d2 */ + K1X_PADCONF(GPIO_10, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac0_tx_d3 */ + K1X_PADCONF(GPIO_11, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac0_tx_en */ + K1X_PADCONF(GPIO_12, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS0)) /* gmac0_mdc */ + K1X_PADCONF(GPIO_13, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS0)) /* gmac0_mdio */ + K1X_PADCONF(GPIO_14, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac0_int_n */ + K1X_PADCONF(GPIO_45, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac0_clk_ref */ + >; + }; + + pinctrl_gmac1: gmac1_grp { + pinctrl-single,pins =< + K1X_PADCONF(GPIO_29, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac1_rxdv */ + K1X_PADCONF(GPIO_30, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac1_rx_d0 */ + K1X_PADCONF(GPIO_31, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac1_rx_d1 */ + K1X_PADCONF(GPIO_32, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac1_rx_clk */ + K1X_PADCONF(GPIO_33, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac1_rx_d2 */ + K1X_PADCONF(GPIO_34, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac1_rx_d3 */ + K1X_PADCONF(GPIO_35, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS0)) /* gmac1_tx_d0 */ + K1X_PADCONF(GPIO_36, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS0)) /* gmac1_tx_d1 */ + K1X_PADCONF(GPIO_37, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac1_tx */ + K1X_PADCONF(GPIO_38, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS0)) /* gmac1_tx_d2 */ + K1X_PADCONF(GPIO_39, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS0)) /* gmac1_tx_d3 */ + K1X_PADCONF(GPIO_40, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS0)) /* gmac1_tx_en */ + K1X_PADCONF(GPIO_41, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS0)) /* gmac1_mdc */ + K1X_PADCONF(GPIO_42, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS0)) /* gmac1_mdio */ + K1X_PADCONF(GPIO_43, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac1_int_n */ + K1X_PADCONF(GPIO_46, MUX_MODE1, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* gmac1_clk_ref */ + >; + }; + + pinctrl_wlan_wakeup: wlan_wakeup_grp { + pinctrl-single,pins =< + K1X_PADCONF(GPIO_66, MUX_MODE0, (EDGE_FALL | PULL_DOWN | PAD_3V_DS2)) /* wifi edge detect */ + >; + }; + + pinctrl_sspa0_2: sspa0_2_grp { + pinctrl-single,pins =< + K1X_PADCONF(GPIO_111, MUX_MODE2, (EDGE_NONE | PULL_UP | PAD_1V8_DS0)) /* sspa0_clk */ + K1X_PADCONF(GPIO_112, MUX_MODE2, (EDGE_NONE | PULL_UP | PAD_1V8_DS0)) /* sspa0_frm */ + K1X_PADCONF(GPIO_120, MUX_MODE3, (EDGE_NONE | PULL_UP | PAD_1V8_DS0)) /* sspa0_txd */ + K1X_PADCONF(GPIO_121, MUX_MODE3, (EDGE_NONE | PULL_UP | PAD_1V8_DS0)) /* sspa0_rxd */ + K1X_PADCONF(GPIO_122, MUX_MODE3, (EDGE_NONE | PULL_UP | PAD_1V8_DS0)) /* sspa0_sysclk */ + >; + }; + + pinctrl_pcie2_5: pcie2_5_grp { + pinctrl-single,pins =< + K1X_PADCONF(GPIO_62, MUX_MODE4, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* PCIe2_perstn */ + K1X_PADCONF(GPIO_36, MUX_MODE4, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* PCIe2_waken */ + K1X_PADCONF(GPIO_117, MUX_MODE4, (EDGE_NONE | PULL_DIS | PAD_1V8_DS2)) /* PCIe2_clkreqn */ + >; + }; +}; + +&pwm_bl { + pwms = <&pwm14 2000>; + brightness-levels = < + 0 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 + 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 + 40 40 40 40 40 40 40 40 40 41 42 43 44 45 46 47 + 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 + 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 + 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 + 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 + 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 + 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 + 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 + 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 + 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 + 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 + 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 + 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 + 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 + >; + default-brightness-level = <100>; + + status = "okay"; +}; + +&pwm4 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_pwm4_1>; + status = "okay"; +}; + +&pwm14 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_pwm14_1>; + status = "disabled"; +}; + +&qspi { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_qspi>; + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <26500000>; + m25p,fast-read; + broken-flash-reset; + status = "okay"; + }; +}; + +&rcpu { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_rcpu>; + mboxes = <&mailbox 0>, <&mailbox 1>; + mbox-names = "vq0", "vq1"; + memory-region = <&rcpu_mem_0>, <&rcpu_mem_heap>, <&vdev0vring0>, <&vdev0vring1>, <&vdev0buffer>, <&rsc_table>, <&rcpu_mem_snapshots>; + status = "okay"; +}; + +&rpwm7 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_rpwm7_0>; + status = "okay"; +}; + +/* &r_uart0 { + status = "okay"; +}; +*/ + +/* SD */ +&sdhci0 { + pinctrl-names = "default","fast"; + pinctrl-0 = <&pinctrl_mmc1>; + pinctrl-1 = <&pinctrl_mmc1_fast>; + bus-width = <4>; + cd-gpios = <&gpio 80 0>; + vmmc-supply = <&dcdc_4>; + vqmmc-supply = <&ldo_1>; + no-mmc; + no-sdio; + spacemit,sdh-host-caps-disable = <( + MMC_CAP_UHS_SDR12 | + MMC_CAP_UHS_SDR25 + )>; + spacemit,sdh-quirks = <( + SDHCI_QUIRK_BROKEN_CARD_DETECTION | + SDHCI_QUIRK_INVERTED_WRITE_PROTECT | + SDHCI_QUIRK_BROKEN_TIMEOUT_VAL + )>; + spacemit,sdh-quirks2 = <( + SDHCI_QUIRK2_PRESET_VALUE_BROKEN | + SDHCI_QUIRK2_BROKEN_PHY_MODULE | + SDHCI_QUIRK2_SET_AIB_MMC + )>; + spacemit,aib_mmc1_io_reg = <0xD401E81C>; + spacemit,apbc_asfar_reg = <0xD4015050>; + spacemit,apbc_assar_reg = <0xD4015054>; + spacemit,rx_dline_reg = <0x0>; + spacemit,tx_dline_reg = <0x0>; + spacemit,tx_delaycode = <0x9f>; + spacemit,rx_tuning_limit = <50>; + spacemit,sdh-freq = <204800000>; + status = "okay"; +}; + +/* SDIO */ +&sdhci1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_mmc2>; + bus-width = <4>; + non-removable; + vqmmc-supply = <&dcdc_3>; + no-mmc; + no-sd; + keep-power-in-suspend; + /* bcmdhd use private oob solution rather than dat1/standard wakeup */ + /delete-property/ enable-sdio-wakeup; + spacemit,sdh-host-caps-disable = <( + MMC_CAP_UHS_DDR50 | + MMC_CAP_NEEDS_POLL + )>; + spacemit,sdh-quirks = <( + SDHCI_QUIRK_BROKEN_CARD_DETECTION | + SDHCI_QUIRK_BROKEN_TIMEOUT_VAL + )>; + spacemit,sdh-quirks2 = <( + SDHCI_QUIRK2_PRESET_VALUE_BROKEN | + SDHCI_QUIRK2_BROKEN_PHY_MODULE + )>; + spacemit,rx_dline_reg = <0x0>; + spacemit,tx_delaycode = <0xa8 0x78>; + spacemit,rx_tuning_limit = <50>; + spacemit,sdh-freq = <375000000>; + status = "okay"; +}; + +/* eMMC */ +&sdhci2 { + bus-width = <8>; + non-removable; + mmc-hs400-1_8v; + mmc-hs400-enhanced-strobe; + no-sd; + no-sdio; + spacemit,sdh-quirks = <( + SDHCI_QUIRK_BROKEN_CARD_DETECTION | + SDHCI_QUIRK_BROKEN_TIMEOUT_VAL + )>; + spacemit,sdh-quirks2 = <( + SDHCI_QUIRK2_PRESET_VALUE_BROKEN + )>; + spacemit,sdh-freq = <375000000>; + status = "okay"; +}; + +&sound_hdmi { + status = "okay"; + simple-audio-card,cpu { + sound-dai = <&hdmiaudio>; + }; +}; + +&sound_codec { + status = "okay"; + simple-audio-card,name = "snd-es8326"; + spacemit,mclk-fs = <64>; + simple-audio-card,codec { + sound-dai = <&es8326>; + }; +}; + +&spi3 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ssp3_0>; + k1x,ssp-disable-dma; + status = "okay"; + k1x,ssp-clock-rate = <25600000>; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_uart0_2>; + status = "okay"; +}; + +/* Bluetooth */ +&uart2 { + status = "okay"; + pinctrl-0 = <&pinctrl_uart2>; + pinctrl-names = "default"; + uart-has-rtscts; + + bluetooth { + compatible = "realtek,rtl8723ds-bt"; + device-wake-gpios = <&gpio 64 GPIO_ACTIVE_HIGH>; + enable-gpios = <&gpio 65 GPIO_ACTIVE_HIGH>; + }; +}; + +&udc { + spacemit,udc-mode = ; + status = "okay"; +}; + +&udc1 { + spacemit,udc-mode = ; + status = "disabled"; +}; + +&usb2phy { + status = "okay"; +}; + +&usb3hub { + hub-gpios = < + &gpio 127 0 /* usb3 hub en */ + &gpio 123 0>; /* usb3 hub rst*/ + vbus-gpios = <&gpio 79 0>; /* usb3 hub output vbus */ + vbus_delay_ms = <200>; + status = "okay"; +}; + +&usbdrd3 { + status = "okay"; + reset-on-resume; + dwc3@c0a00000 { + dr_mode = "host"; + phy_type = "utmi"; + snps,hsphy_interface = "utmi"; + snps,dis_enblslpm_quirk; + snps,dis_u2_susphy_quirk; + snps,dis_u3_susphy_quirk; + snps,dis-del-phy-power-chg-quirk; + snps,dis-tx-ipgap-linecheck-quirk; + snps,parkmode-disable-ss-quirk; + }; +}; + +&usbphy { + status = "okay"; +}; + +&usbphy1 { + status = "okay"; +}; + +&vi { + power-domains = <&power K1X_PMU_ISP_PWR_DOMAIN>; +}; diff --git a/patch/kernel/archive/spacemit-6.6/dt/lcd_tc358762xbg_dpi_800x480.dtsi b/patch/kernel/archive/spacemit-6.6/dt/lcd_tc358762xbg_dpi_800x480.dtsi new file mode 100644 index 0000000000..d00e83a542 --- /dev/null +++ b/patch/kernel/archive/spacemit-6.6/dt/lcd_tc358762xbg_dpi_800x480.dtsi @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-2.0 + +/ { lcds: lcds { + lcd_tc358762xbg_dpi_800x480: lcd_tc358762xbg_dpi_800x480 { + dsi-work-mode = <1>; /* video burst mode*/ + dsi-lane-number = <1>; + dsi-color-format = "rgb888"; + width-mm = <95>; + height-mm = <53>; + use-dcs-write; + + /*mipi info*/ + height = <480>; + width = <800>; + hfp = <1>; + hbp = <46>; + hsync = <2>; + vfp = <7>; + vbp = <21>; + vsync = <2>; + fps = <55>; + work-mode = <0>; + rgb-mode = <3>; + lane-number = <1>; + phy-bit-clock = <700000000>; + split-enable = <0>; + eotp-enable = <0>; + burst-mode = <2>; + esd-check-enable = <0>; + + /* DSI_CMD, DSI_MODE, timeout, len, cmd */ + initial-command = [ + 39 01 F0 01 11 + 39 01 28 01 29 + ]; + sleep-in-command = [ + 39 01 78 01 28 + 39 01 78 01 10 + ]; + sleep-out-command = [ + 39 01 96 01 11 + 39 01 32 01 29 + ]; + + display-timings { + timing0 { + clock-frequency = <25000000>; + hactive = <800>; + hfront-porch = <1>; + hback-porch = <46>; + hsync-len = <2>; + vactive = <480>; + vfront-porch = <7>; + vback-porch = <21>; + vsync-len = <2>; + vsync-active = <1>; + hsync-active = <1>; + }; + }; + }; +};}; \ No newline at end of file diff --git a/patch/kernel/archive/spacemit-6.6/overlay/Makefile b/patch/kernel/archive/spacemit-6.6/overlay/Makefile new file mode 100644 index 0000000000..0bbe8a6b94 --- /dev/null +++ b/patch/kernel/archive/spacemit-6.6/overlay/Makefile @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: GPL-2.0 +dtbo-$(CONFIG_ARCH_RV64I) += \ + k1-spacemit-disable-qspi.dtbo \ + k1-spacemit-i2c4-pwm7-spi3-uart5.dtbo + +targets += dtbs dtbs_install +targets += $(dtbo-y) + +always-y := $(dtbo-y) +clean-files := *.dtbo diff --git a/patch/kernel/archive/spacemit-6.6/overlay/k1-spacemit-disable-qspi.dts b/patch/kernel/archive/spacemit-6.6/overlay/k1-spacemit-disable-qspi.dts new file mode 100644 index 0000000000..df23c4a4f8 --- /dev/null +++ b/patch/kernel/archive/spacemit-6.6/overlay/k1-spacemit-disable-qspi.dts @@ -0,0 +1,13 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "spacemit,k1-x"; + + fragment@0 { + target = <&qspi>; + __overlay__ { + status = "disabled"; + }; + }; +}; diff --git a/patch/kernel/archive/spacemit-6.6/overlay/k1-spacemit-i2c4-pwm7-spi3-uart5.dts b/patch/kernel/archive/spacemit-6.6/overlay/k1-spacemit-i2c4-pwm7-spi3-uart5.dts new file mode 100644 index 0000000000..01e487b207 --- /dev/null +++ b/patch/kernel/archive/spacemit-6.6/overlay/k1-spacemit-i2c4-pwm7-spi3-uart5.dts @@ -0,0 +1,37 @@ +/dts-v1/; +/plugin/; + +// Enable 26pin I2C4, PWM7, SPI3 and UART5 +// https://forum.banana-pi.org/t/bananapif3-gpio-wiringpi-gpiod-python3-periphery-adafruit-blinka-and-luma-examples/18948 + +/ { + compatible = "spacemit,k1-x"; + + fragment@0 { + target = <&i2c4>; + __overlay__ { + status = "okay"; + }; + }; + + fragment@1 { + target = <&pwm7>; + __overlay__ { + status = "okay"; + }; + }; + + fragment@2 { + target = <&spi3>; + __overlay__ { + status = "okay"; + }; + }; + + fragment@3 { + target = <&uart5>; + __overlay__ { + status = "okay"; + }; + }; +};