diff --git a/config/sources/families/spacemit.conf b/config/sources/families/spacemit.conf index c26472755b60..7f7aee2ae4c7 100644 --- a/config/sources/families/spacemit.conf +++ b/config/sources/families/spacemit.conf @@ -38,9 +38,9 @@ case "${BRANCH}" in ;; edge) declare -g KERNELSOURCE="https://github.com/jmontleon/linux-bianbu.git" - declare -g KERNELBRANCH="branch:linux-6.16.y" + declare -g KERNELBRANCH="branch:linux-6.17.y" declare -g EXTRAWIFI="no" # WiFi drivers are already included in the kernel - declare -g KERNEL_MAJOR_MINOR="6.16" + declare -g KERNEL_MAJOR_MINOR="6.17" declare -g LINUXCONFIG="linux-${LINUXFAMILY}-edge" ;; esac diff --git a/patch/kernel/archive/spacemit-6.17/0000.patching_config.yaml b/patch/kernel/archive/spacemit-6.17/0000.patching_config.yaml new file mode 100644 index 000000000000..ac1da4ec6c6e --- /dev/null +++ b/patch/kernel/archive/spacemit-6.17/0000.patching_config.yaml @@ -0,0 +1,45 @@ +config: # This is file 'patch/kernel/spacemit-legacy-6.1/0000.patching_config.yaml' + + # PATCH NUMBERING INFO + # + # Patches should be ordered in such a way that general kernel patches are applied first, then SoC-related patches and at last board-specific patches + # + # Patch numbers in this folder are sorted by category: + # + # 000* for general patches + # 0** for Bianbu-Linux-related patches + # 1** for other SoC-related patches + # 5** for board specific patches + + # Just some info stuff; not used by the patching scripts + name: spacemit-6.16 + kind: kernel + type: vendor # or: edge + branch: linux-6.16.y + last-known-good-tag: v6.16 + maintainers: + - { github: none, name: none, email: none, armbian-forum: none } + + # .dts files in these directories will be copied as-is to the build tree; later ones overwrite earlier ones. + # This is meant to provide a way to "add a board DTS" without having to null-patch them in. + dts-directories: + - { source: "dt", target: "arch/riscv/boot/dts/spacemit" } + + # Every file in these directories will be copied as-is to the build tree; later ones overwrite earlier ones + # This is meant as a way to have overlays, bare, in a directory, without having to null-patch them in. + # @TODO need a solution to auto-Makefile the overlays as well + overlay-directories: + - { source: "overlay", target: "arch/riscv/boot/dts/spacemit/overlay" } + + # The Makefile in each of these directories will be magically patched to include the dts files copied + # or patched-in; overlay subdir will be included "-y" if it exists. + # No more Makefile patching needed, yay! + #auto-patch-dt-makefile: + # - { directory: "arch/riscv/boot/dts/spacemit", config-var: "CONFIG_SOC_SPACEMIT_K1X" } + + # Configuration for when applying patches to git / auto-rewriting patches (development cycle helpers) + patches-to-git: + do-not-commit-files: + - "MAINTAINERS" # constant churn, drop them. sorry. + do-not-commit-regexes: # Python-style regexes + - "^arch/([a-zA-Z0-9]+)/boot/dts/([a-zA-Z0-9]+)/Makefile$" # ignore DT Makefile patches, we've an auto-patcher now 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 new file mode 100644 index 000000000000..c430d4e8d290 --- /dev/null +++ b/patch/kernel/archive/spacemit-6.17/001-rtl8852bs-Turn-off-DEBUG-and-remove-RTW_WARN_LM.patch @@ -0,0 +1,40 @@ +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 new file mode 100644 index 000000000000..ed85b07c561d --- /dev/null +++ b/patch/kernel/archive/spacemit-6.17/002-Max-freq-limitation-1.8GHz.patch @@ -0,0 +1,58 @@ +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 new file mode 100644 index 000000000000..1eec543d8ca0 --- /dev/null +++ b/patch/kernel/archive/spacemit-6.17/003-Add-spacemit-k1x-spi-support.patch @@ -0,0 +1,33 @@ +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 new file mode 100644 index 000000000000..636612e78fa9 --- /dev/null +++ b/patch/kernel/archive/spacemit-6.17/004-SpacemiT-K1-X-Forward-port-6.6.y-DTSI.patch @@ -0,0 +1,158 @@ +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/dt/k1-bananapi-f3.dts b/patch/kernel/archive/spacemit-6.17/dt/k1-bananapi-f3.dts new file mode 100644 index 000000000000..cdd22e101335 --- /dev/null +++ b/patch/kernel/archive/spacemit-6.17/dt/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 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 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>; + }; +}; + +/* 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>; + enable-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>; +};