riscv: dts: spacemit: Enable USB and PCIe for K3 CoM260
Subsystems (3)
cover riscv: dts: spacemit: Enable USB and PCIe for K3 CoM260
This patchset enables USB 2.0, USB 3.0, PCIe, and rfkill for the K3 CoM260 Dev Kit board. This board has 4x USB 3.0 Type-A ports and three M.2 slots which may be used for two NVMe drives, Wi-Fi, and Bluetooth.
The USB Type-C DRD port is not enabled here because the necessary drivers have not yet been posted.
This is based on spacemit/dt-for-next. The USB patch depends on [1] and the PCIe patch depends on [2], which in turn depends on [3] and [4].
[1] https://lore.kernel.org/spacemit/[email protected]/
[2] https://lore.kernel.org/spacemit/[email protected]/
[3] https://lore.kernel.org/linux-phy/[email protected]/
[4] https://lore.kernel.org/spacemit/[email protected]/
James Morris (1):
riscv: dts: spacemit: k3-com260: keep dldo4 enabled
Jennifer Berringer (3):
riscv: dts: spacemit: k3-com260-ifx: Add USB nodes
riscv: dts: spacemit: k3-com260-ifx: Add PCIe nodes
riscv: dts: spacemit: k3-com260-ifx: Add rfkill nodes
.../riscv/boot/dts/spacemit/k3-com260-ifx.dts | 122 ++++++++++++++++++ arch/riscv/boot/dts/spacemit/k3-com260.dtsi | 1 + arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi | 33 +++++ 3 files changed, 156 insertions(+)
base-commit: 4947ee60bf48caddf5caefc08dbbc84d09fbbc6b
prerequisite-message-id: <[email protected]>
Signature · 1 line
2.55.0
PATCH 1/4 riscv: dts: spacemit: k3-com260: keep dldo4 enabled
From: James Morris <[email protected]>
dldo4 on the P1 PMIC is marked regulator-boot-on, but has no consumer described in the device tree. The regulator core can therefore disable the firmware-enabled rail during unused-regulator cleanup.
Enabling pcie4_rc on a K3 CoM260 Dev Kit without this change while the board's included RTL8852BE module is connected to the M.2 E-key slot results in CPU hard-lock, as seen in kernel log:
[ 32.521536] dldo4: disabling [ 48.125823] watchdog: CPU3: Watchdog detected hard LOCKUP on cpu 4 [ 64.125829] watchdog: BUG: soft lockup - CPU#1 stuck for 26s! [ 64.125926] Hardware name: SpacemiT K3 CoM260 IFX (DT) [ 64.125928] epc : smp_call_function_many_cond+0x158/0x740 [ 64.125938] ra : smp_call_function_many_cond+0x11a/0x740
GitHub Copilot assisted with diagnosis and build and test automation, and changelog drafting.
--- arch/riscv/boot/dts/spacemit/k3-com260.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/riscv/boot/dts/spacemit/k3-com260.dtsi +1 -0
@@ -187,6 +187,7 @@ dldo3: dldo3 { dldo4: dldo4 { regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; + regulator-always-on; regulator-boot-on; };
Signature · 1 line
2.55.0
PATCH 2/4 riscv: dts: spacemit: k3-com260-ifx: Add USB nodes
In reply to Jennifer BerringerK3 CoM260 IFX uses usb3b for a VL817 hub providing 4x USB 3.0 ports and usb2_host for Bluetooth through the M.2 E-Key slot.
--- .../riscv/boot/dts/spacemit/k3-com260-ifx.dts | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+)
arch/riscv/boot/dts/spacemit/k3-com260-ifx.dts +63 -0
@@ -3,6 +3,7 @@ * Copyright (c) 2026 SpacemiT (Hangzhou) Technology Co. Ltd * Copyright (c) 2026 Yixun Lan <[email protected]> */ +#include <dt-bindings/phy/phy.h> #include "k3-com260.dtsi"
@@ -18,6 +19,31 @@ aliases { chosen { stdout-path = "serial0:115200n8"; }; + + reg_hub_5v: regulator-usb3-hub-5v { + compatible = "regulator-fixed"; + regulator-name = "USB30_HUB"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-boot-on; + regulator-always-on; + vin-supply = <®_5v_sys>; + }; + + reg_vbus_5v: regulator-usb3-vbus-5v { + compatible = "regulator-fixed"; + regulator-name = "USB30_VBUS"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <®_5v_sys>; + gpio = <&gpio K3_GPIO(67) GPIO_ACTIVE_HIGH>; + enable-active-high; + }; +}; + +&combophy { + spacemit,apmu = <&syscon_apmu 0x14>; + status = "okay"; }; &i2c1 {
@@ -35,6 +61,43 @@ eeprom@50 { }; }; +&usb2_host { + status = "okay"; +}; + +&usb2_phy { + status = "okay"; +}; + +&usb3b { + phys = <&usb3b_u2phy>, <&combophy 2 PHY_TYPE_USB3>; + phy-names = "usb2-phy", "usb3-phy"; + status = "okay"; + vbus-supply = <®_vbus_5v>; + #address-cells = <1>; + #size-cells = <0>; + + hub_2_0: hub@1 { + compatible = "usb2109,2817"; + reg = <1>; + vdd-supply = <®_hub_5v>; + peer-hub = <&hub_3_0>; + reset-gpios = <&gpio K3_GPIO(53) GPIO_ACTIVE_LOW>; + }; + + hub_3_0: hub@2 { + compatible = "usb2109,817"; + reg = <2>; + vdd-supply = <®_hub_5v>; + peer-hub = <&hub_2_0>; + reset-gpios = <&gpio K3_GPIO(53) GPIO_ACTIVE_LOW>; + }; +}; + +&usb3b_u2phy { + status = "okay"; +}; + &sdhci0 { pinctrl-names = "default","uhs"; pinctrl-0 = <&mmc1_cfg>;
Signature · 1 line
2.55.0
PATCH 3/4 riscv: dts: spacemit: k3-com260-ifx: Add PCIe nodes
In reply to Jennifer BerringerK3 CoM260 Dev Kit uses PCIe for three M.2 slots:
- M.2 M-key 2280: PCIe 3.0 x4 (pcie0_rc)
- M.2 M-key 2230: PCIe 3.0 x1+1 (pcie3_rc)
- M.2 E-key 2230: PCIe 3.0 x1 (pcie4_rc)
The M.2 M-key 2230 slot is connected to two PCIe lanes, with lane 0 on combo phy 4 and lane 1 on combo phy 3. The K3 combo phy cannot be configured to use these as one PCIe 3.0 x2 device; treat this slot as x1 only instead.
The E-key slot has an RTL8852BE WiFi+BT NIC installed from factory.
--- .../riscv/boot/dts/spacemit/k3-com260-ifx.dts | 45 +++++++++++++++++++ arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi | 33 ++++++++++++++ 2 files changed, 78 insertions(+)
arch/riscv/boot/dts/spacemit/k3-com260-ifx.dts +45 -0
@@ -39,6 +39,14 @@ reg_vbus_5v: regulator-usb3-vbus-5v { gpio = <&gpio K3_GPIO(67) GPIO_ACTIVE_HIGH>; enable-active-high; }; + + reg_aux_vcc3v3: regulator-aux-vcc3v3 { + compatible = "regulator-fixed"; + regulator-name = "AUX_VCC3V3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; }; &combophy {
@@ -61,6 +69,43 @@ eeprom@50 { }; }; +&pcie0_rc { + pinctrl-names = "default"; + pinctrl-0 = <&pcie0_1_cfg>; + num-lanes = <4>; + status = "okay"; + + pcie@0 { + vpcie3v3-supply = <®_aux_vcc3v3>; + phys = <&combophy 0 PHY_TYPE_PCIE>, + <&combophy 1 PHY_TYPE_PCIE>; + }; +}; + +&pcie3_rc { + pinctrl-names = "default"; + pinctrl-0 = <&pcie3_0_cfg>; + num-lanes = <1>; + status = "okay"; + + pcie@0 { + vpcie3v3-supply = <®_aux_vcc3v3>; + phys = <&combophy 4 PHY_TYPE_PCIE>; + }; +}; + +&pcie4_rc { + pinctrl-names = "default"; + pinctrl-0 = <&pcie4_1_cfg>; + num-lanes = <1>; + status = "okay"; + + pcie@0 { + vpcie3v3-supply = <®_aux_vcc3v3>; + phys = <&combophy 5 PHY_TYPE_PCIE>; + }; +}; + &usb2_host { status = "okay"; };
arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi +33 -0
@@ -800,6 +800,17 @@ pcie0-0-pins { }; }; + pcie0_1_cfg: pcie0-1-cfg { + pcie0-0-pins { + pinmux = <K3_PADCONF(79, 5)>, /* pcie0 perst */ + <K3_PADCONF(81, 5)>; /* pcie0 clkreq */ + + bias-pull-up = <1>; + drive-strength = <38>; + power-source = <3300>; + }; + }; + pcie2_0_cfg: pcie2-0-cfg { pcie2-0-pins { pinmux = <K3_PADCONF(25, 4)>, /* pcie2 perst */
@@ -810,6 +821,17 @@ pcie2-0-pins { }; }; + pcie3_0_cfg: pcie3-0-cfg { + pcie3-0-pins { + pinmux = <K3_PADCONF(3, 4)>, /* pcie3 perst */ + <K3_PADCONF(5, 4)>; /* pcie3 clkreq */ + + bias-pull-up = <1>; + drive-strength = <38>; + power-source = <3300>; + }; + }; + pcie4_0_cfg: pcie4-0-cfg { pcie4-0-pins { pinmux = <K3_PADCONF(76, 5)>, /* pcie4 perst */
@@ -821,4 +843,15 @@ pcie4-0-pins { power-source = <1800>; }; }; + + pcie4_1_cfg: pcie4-1-cfg { + pcie4-0-pins { + pinmux = <K3_PADCONF(76, 5)>, /* pcie4 perst */ + <K3_PADCONF(78, 5)>; /* pcie4 clkreq */ + + bias-pull-up = <1>; + drive-strength = <38>; + power-source = <3300>; + }; + }; };
Signature · 1 line
2.55.0
PATCH 4/4 riscv: dts: spacemit: k3-com260-ifx: Add rfkill nodes
In reply to Jennifer BerringerK3 CoM260 IFX has an M.2 E-key slot for wireless. Add rfkill nodes for the GPIOs that control the slot's W_DISABLE1# and W_DISABLE2# pins for WLAN and Bluetooth.
--- arch/riscv/boot/dts/spacemit/k3-com260-ifx.dts | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
arch/riscv/boot/dts/spacemit/k3-com260-ifx.dts +14 -0
@@ -47,6 +47,20 @@ reg_aux_vcc3v3: regulator-aux-vcc3v3 { regulator-max-microvolt = <3300000>; regulator-always-on; }; + + rfkill-pcie-wlan { + compatible = "rfkill-gpio"; + label = "rfkill-pcie-wlan"; + radio-type = "wlan"; + shutdown-gpios = <&gpio K3_GPIO(73) GPIO_ACTIVE_LOW>; + }; + + rfkill-usb-bt { + compatible = "rfkill-gpio"; + label = "rfkill-usb-bt"; + radio-type = "bluetooth"; + shutdown-gpios = <&gpio K3_GPIO(57) GPIO_ACTIVE_LOW>; + }; }; &combophy {
Signature · 1 line
2.55.0
Re: [PATCH 4/4] riscv: dts: spacemit: k3-com260-ifx: Add rfkill nodes
Hi,
I don't think doing like this is correct.. We have a dedicated M.2 Ekey binding and should use that:
Best regards,
Shengyu
Quoted 34 lines · Jennifer Berringer
K3 CoM260 IFX has an M.2 E-key slot for wireless. Add rfkill nodes for the GPIOs that control the slot's W_DISABLE1# and W_DISABLE2# pins for WLAN and Bluetooth.
Signed-off-by Jennifer Berringer <[email protected]>--- arch/riscv/boot/dts/spacemit/k3-com260-ifx.dts | 14 ++++++++++++++ 1 file changed, 14 insertions(+)arch/riscv/boot/dts/spacemit/k3-com260-ifx.dts +14
-0@@ -47,6 +47,20 @@ reg_aux_vcc3v3: regulator-aux-vcc3v3 { regulator-max-microvolt = <3300000>; regulator-always-on; }; + + rfkill-pcie-wlan { + compatible = "rfkill-gpio"; + label = "rfkill-pcie-wlan"; + radio-type = "wlan"; + shutdown-gpios = <&gpio K3_GPIO(73) GPIO_ACTIVE_LOW>; + }; + + rfkill-usb-bt { + compatible = "rfkill-gpio"; + label = "rfkill-usb-bt"; + radio-type = "bluetooth"; + shutdown-gpios = <&gpio K3_GPIO(57) GPIO_ACTIVE_LOW>; + }; }; &combophy {
Re: [PATCH 4/4] riscv: dts: spacemit: k3-com260-ifx: Add rfkill nodes
Hi,
Quoted 9 lines · Shengyu Qu
Hi,
I don't think doing like this is correct.. We have a dedicated M.2 Ekey binding and should use that:
Best regards,
Shengyu
To my understanding, the pwrseq-pcie-m2 driver that uses this binding currently only supports systems that use UART for Bluetooth, and is needed for them because UART is a non-discoverable bus. Quoting the cover letter of the series that introduced this binding:
"This series adds support for connectors that expose PCIe interface for WiFi and UART interface for BT. Other interfaces are left for future improvements." [1]
K3 CoM260 Dev Kit ships with its E-key slot populated with an RTL8852BE module, which uses PCIe for WiFi and USB2 for BT. I verified that my patch series does make the rfkill command be able to disconnect and reconnect the WiFi and BT devices with this module. I also tested this patch set with an Intel AX210.
In addition to PCIe and USB2, this board also has its M.2 E-key slot connected to sdio, uart6, and i2s3, but none of those are currently enabled in this dts and the RTL8852BE module does not use them.
Several other existing device trees seem to use rfkill-gpio nodes to control W_DISABLE pins on M.2 E-key slots. Looking at rk3588 boards for
example: OrangePi 5 Plus, ArmSoM W3, and Rock 5B all do so in the current tree.
Unlike those, the rfkill nodes in my patch aren't actually necessary for usable WiFi and BT on this board. The shutdown-gpios here are GPIO_ACTIVE_LOW and this merely allows using rfkill to block both radios via the W_DISABLE pins, so I'm not opposed to dropping this patch if anyone believes it should be dropped.
[1] https://lore.kernel.org/lkml/[email protected]/
Quoted 36 lines · Jennifer Berringer
Quoted 33 lines
K3 CoM260 IFX has an M.2 E-key slot for wireless. Add rfkill nodes for the GPIOs that control the slot's W_DISABLE1# and W_DISABLE2# pins for WLAN and Bluetooth.
Signed-off-by Jennifer Berringer <[email protected]>--- arch/riscv/boot/dts/spacemit/k3-com260-ifx.dts | 14 ++++++++++++++ 1 file changed, 14 insertions(+)arch/riscv/boot/dts/spacemit/k3-com260-ifx.dts +14
-0@@ -47,6 +47,20 @@ reg_aux_vcc3v3: regulator-aux-vcc3v3 { regulator-max-microvolt = <3300000>; regulator-always-on; }; + + rfkill-pcie-wlan { + compatible = "rfkill-gpio"; + label = "rfkill-pcie-wlan"; + radio-type = "wlan"; + shutdown-gpios = <&gpio K3_GPIO(73) GPIO_ACTIVE_LOW>; + }; + + rfkill-usb-bt { + compatible = "rfkill-gpio"; + label = "rfkill-usb-bt"; + radio-type = "bluetooth"; + shutdown-gpios = <&gpio K3_GPIO(57) GPIO_ACTIVE_LOW>; + }; }; &combophy {
Re: [PATCH 4/4] riscv: dts: spacemit: k3-com260-ifx: Add rfkill nodes
Quoted 2 lines · Jennifer Berringer
Hi,
...
Quoted 10 lines
To my understanding, the pwrseq-pcie-m2 driver that uses this binding currently only supports systems that use UART for Bluetooth, and is needed for them because UART is a non-discoverable bus. Quoting the cover letter of the series that introduced this binding:
"This series adds support for connectors that expose PCIe interface for WiFi and UART interface for BT. Other interfaces are left for future improvements." [1]
Quoted 5 lines
K3 CoM260 Dev Kit ships with its E-key slot populated with an RTL8852BE module, which uses PCIe for WiFi and USB2 for BT. I verified that my patch series does make the rfkill command be able to disconnect and reconnect the WiFi and BT devices with this module. I also tested this patch set with an Intel AX210.
There are some M.2 E key cards that can be bought and is using UART BT, for example: Radxa's wireless cards (except A8) are using SDIO+UART interface on E key cards. Also Quectel has some QCNCM865A cards on sale which uses PCIE+UART. To achieve best compatibility we can't just use current implementation.
Quoted 8 lines
In addition to PCIe and USB2, this board also has its M.2 E-key slot connected to sdio, uart6, and i2s3, but none of those are currently enabled in this dts and the RTL8852BE module does not use them.
Several other existing device trees seem to use rfkill-gpio nodes to control
W_DISABLEpins on M.2 E-key slots. Looking at rk3588 boards for
example: OrangePi 5 Plus, ArmSoM W3, and Rock 5B all do so in the current tree.
That's due to the M.2 E key series just landed a few months ago and those boards came much earlier. And that old implementation has created some issues if we try to support UART cards while some users don't have that card:
https://lore.kernel.org/all/[email protected]/
Best regards,
Shengyu
Quoted 7 lines
Unlike those, the rfkill nodes in my patch aren't actually necessary for usable WiFi and BT on this board. The shutdown-gpios here are
GPIO_ACTIVE_LOWand this merely allows using rfkill to block both radios via theW_DISABLEpins, so I'm not opposed to dropping this patch if anyone believes it should be dropped.
...
Yixun Lan
maintainerRe: (subset) [PATCH 0/4] riscv: dts: spacemit: Enable USB and PCIe for K3 CoM260
In reply to Jennifer BerringerQuoted 8 lines · Jennifer Berringer
This patchset enables USB 2.0, USB 3.0, PCIe, and rfkill for the K3 CoM260 Dev Kit board. This board has 4x USB 3.0 Type-A ports and three M.2 slots which may be used for two NVMe drives, Wi-Fi, and Bluetooth.
The USB Type-C DRD port is not enabled here because the necessary drivers have not yet been posted.
[...]
Applied the USB part, while leave PCIe part for now, thanks!
[1/4] riscv: dts: spacemit: k3-com260: keep dldo4 enabled
https://git.kernel.org/pub/scm/linux/kernel/git/spacemit/linux.git/commit/?id=f314c98807c12272a1902aeda9c648d81b39bad2 [2/4] riscv: dts: spacemit: k3-com260-ifx: Add USB nodes https://git.kernel.org/pub/scm/linux/kernel/git/spacemit/linux.git/commit/?id=bd56cb9b84f74ef472c71285fee9e28ee414b10a [4/4] riscv: dts: spacemit: k3-com260-ifx: Add rfkill nodes https://git.kernel.org/pub/scm/linux/kernel/git/spacemit/linux.git/commit/?id=dad085951db1098a0294da7d78aca1594b0f33f7
Best regards,
Signature · 1 line
Yixun Lan <[email protected]>
This series was applied to riscv/linux.git (fixes) by Yixun Lan <[email protected]>:
Hello:
This series was applied to riscv/linux.git (fixes) by Yixun Lan <[email protected]>:
Quoted 8 lines · On Mon, 28 Sep 2026 19:18:03 -0400 you wrote:
This patchset enables USB 2.0, USB 3.0, PCIe, and rfkill for the K3 CoM260 Dev Kit board. This board has 4x USB 3.0 Type-A ports and three M.2 slots which may be used for two NVMe drives, Wi-Fi, and Bluetooth.
The USB Type-C DRD port is not enabled here because the necessary drivers have not yet been posted.
[...]
Here is the summary with links:
- [1/4] riscv: dts: spacemit: k3-com260: keep dldo4 enabled
https://git.kernel.org/riscv/c/f314c98807c1 - [2/4] riscv: dts: spacemit: k3-com260-ifx: Add USB nodes https://git.kernel.org/riscv/c/bd56cb9b84f7 - [3/4] riscv: dts: spacemit: k3-com260-ifx: Add PCIe nodes (no matching commit) - [4/4] riscv: dts: spacemit: k3-com260-ifx: Add rfkill nodes https://git.kernel.org/riscv/c/dad085951db1
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html