* [PATCH 1/3] riscv: dts: spacemit: Add USB2 PHY node for K1
2025-11-01 9:03 [PATCH 0/3] riscv: dts: spacemit: Add USB 3.0 support for K1 Ze Huang
@ 2025-11-01 9:03 ` Ze Huang
2025-11-01 9:03 ` [PATCH 2/3] riscv: dts: spacemit: Add DWC3 USB 3.0 controller " Ze Huang
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Ze Huang @ 2025-11-01 9:03 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan
Cc: devicetree, linux-riscv, spacemit, linux-kernel, Ze Huang
K1's DWC3 USB 3.0 controller requires two separate PHYs to function:
the USB 3.0 combophy (for SuperSpeed) and a USB 2.0 PHY (for High-Speed,
Full-Speed, etc.).
Add node for this second USB 2.0 PHY (usbphy2).
Signed-off-by: Ze Huang <huang.ze@linux.dev>
---
arch/riscv/boot/dts/spacemit/k1.dtsi | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/riscv/boot/dts/spacemit/k1.dtsi b/arch/riscv/boot/dts/spacemit/k1.dtsi
index 214216fdecd3..d4d3c6d88a29 100644
--- a/arch/riscv/boot/dts/spacemit/k1.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k1.dtsi
@@ -359,6 +359,14 @@ syscon_rcpu2: system-controller@c0888000 {
#reset-cells = <1>;
};
+ usbphy2: phy@c0a30000 {
+ compatible = "spacemit,k1-usb2-phy";
+ reg = <0x0 0xc0a30000 0x0 0x200>;
+ clocks = <&syscon_apmu CLK_USB30>;
+ #phy-cells = <0>;
+ status = "disabled";
+ };
+
combo_phy: phy@c0b10000 {
compatible = "spacemit,k1-combo-phy";
reg = <0x0 0xc0b10000 0x0 0x1000>;
--
2.51.2
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 2/3] riscv: dts: spacemit: Add DWC3 USB 3.0 controller node for K1
2025-11-01 9:03 [PATCH 0/3] riscv: dts: spacemit: Add USB 3.0 support for K1 Ze Huang
2025-11-01 9:03 ` [PATCH 1/3] riscv: dts: spacemit: Add USB2 PHY node " Ze Huang
@ 2025-11-01 9:03 ` Ze Huang
2025-11-01 9:03 ` [PATCH 3/3] riscv: dts: spacemit: Enable USB3.0 on BananaPi-F3 Ze Huang
2025-12-29 20:14 ` [PATCH 0/3] riscv: dts: spacemit: Add USB 3.0 support for K1 Aurelien Jarno
3 siblings, 0 replies; 7+ messages in thread
From: Ze Huang @ 2025-11-01 9:03 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan
Cc: devicetree, linux-riscv, spacemit, linux-kernel, Ze Huang
Add node for the Synopsys DWC3 USB 3.0 host controller on the K1 SoC.
The controller resides on the 'storage-bus' and uses its DMA
translations.
Signed-off-by: Ze Huang <huang.ze@linux.dev>
---
arch/riscv/boot/dts/spacemit/k1.dtsi | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/arch/riscv/boot/dts/spacemit/k1.dtsi b/arch/riscv/boot/dts/spacemit/k1.dtsi
index d4d3c6d88a29..1d1c6276e9d0 100644
--- a/arch/riscv/boot/dts/spacemit/k1.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k1.dtsi
@@ -1010,6 +1010,30 @@ storage-bus {
#size-cells = <2>;
dma-ranges = <0x0 0x00000000 0x0 0x00000000 0x0 0x80000000>;
+ usb_dwc3: usb@c0a00000 {
+ compatible = "spacemit,k1-dwc3";
+ reg = <0x0 0xc0a00000 0x0 0x10000>;
+ clocks = <&syscon_apmu CLK_USB30>;
+ clock-names = "usbdrd30";
+ interrupts = <125>;
+ phys = <&usbphy2>, <&combo_phy PHY_TYPE_USB3>;
+ phy-names = "usb2-phy", "usb3-phy";
+ phy_type = "utmi";
+ resets = <&syscon_apmu RESET_USB30_AHB>,
+ <&syscon_apmu RESET_USB30_VCC>,
+ <&syscon_apmu RESET_USB30_PHY>;
+ reset-names = "ahb", "vcc", "phy";
+ reset-delay = <2>;
+ snps,hsphy_interface = "utmi";
+ snps,dis_enblslpm_quirk;
+ snps,dis-u2-freeclk-exists-quirk;
+ snps,dis-del-phy-power-chg-quirk;
+ snps,dis_u2_susphy_quirk;
+ snps,dis_u3_susphy_quirk;
+ snps,dis_rxdet_inp3_quirk;
+ status = "disabled";
+ };
+
emmc: mmc@d4281000 {
compatible = "spacemit,k1-sdhci";
reg = <0x0 0xd4281000 0x0 0x200>;
--
2.51.2
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 3/3] riscv: dts: spacemit: Enable USB3.0 on BananaPi-F3
2025-11-01 9:03 [PATCH 0/3] riscv: dts: spacemit: Add USB 3.0 support for K1 Ze Huang
2025-11-01 9:03 ` [PATCH 1/3] riscv: dts: spacemit: Add USB2 PHY node " Ze Huang
2025-11-01 9:03 ` [PATCH 2/3] riscv: dts: spacemit: Add DWC3 USB 3.0 controller " Ze Huang
@ 2025-11-01 9:03 ` Ze Huang
2025-12-29 20:14 ` [PATCH 0/3] riscv: dts: spacemit: Add USB 3.0 support for K1 Aurelien Jarno
3 siblings, 0 replies; 7+ messages in thread
From: Ze Huang @ 2025-11-01 9:03 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan
Cc: devicetree, linux-riscv, spacemit, linux-kernel, Ze Huang
Enable the DWC3 USB 3.0 controller and its associated usbphy2 on the
Banana Pi F3 board.
The board utilizes a VLI VL817 hub, which requires two separate power
supplies: one VBUS and one for hub itself. Add two GPIO-controlled
fixed-regulators to manage this.
Signed-off-by: Ze Huang <huang.ze@linux.dev>
---
arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts | 47 +++++++++++++++++++++++++
1 file changed, 47 insertions(+)
diff --git a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
index 6d566780aed9..4b67f44c7863 100644
--- a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
+++ b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
@@ -38,6 +38,25 @@ pcie_vcc_3v3: pcie-vcc3v3 {
regulator-max-microvolt = <3300000>;
regulator-always-on;
};
+
+ usb3_vbus: regulator-vbus-5v {
+ compatible = "regulator-fixed";
+ regulator-name = "USB30_VBUS";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-always-on;
+ gpio = <&gpio K1_GPIO(97) GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
+
+ usb3_vhub: regulator-vhub-5v {
+ compatible = "regulator-fixed";
+ regulator-name = "USB30_VHUB";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ gpio = <&gpio K1_GPIO(123) GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
};
&combo_phy {
@@ -135,3 +154,31 @@ &uart0 {
pinctrl-0 = <&uart0_2_cfg>;
status = "okay";
};
+
+&usbphy2 {
+ status = "okay";
+};
+
+&usb_dwc3 {
+ dr_mode = "host";
+ vbus-supply = <&usb3_vbus>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "okay";
+
+ hub_2_0: hub@1 {
+ compatible = "usb2109,2817";
+ reg = <0x1>;
+ vdd-supply = <&usb3_vhub>;
+ peer-hub = <&hub_3_0>;
+ reset-gpios = <&gpio K1_GPIO(124) GPIO_ACTIVE_LOW>;
+ };
+
+ hub_3_0: hub@2 {
+ compatible = "usb2109,817";
+ reg = <0x2>;
+ vdd-supply = <&usb3_vhub>;
+ peer-hub = <&hub_2_0>;
+ reset-gpios = <&gpio K1_GPIO(124) GPIO_ACTIVE_LOW>;
+ };
+};
--
2.51.2
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH 0/3] riscv: dts: spacemit: Add USB 3.0 support for K1
2025-11-01 9:03 [PATCH 0/3] riscv: dts: spacemit: Add USB 3.0 support for K1 Ze Huang
` (2 preceding siblings ...)
2025-11-01 9:03 ` [PATCH 3/3] riscv: dts: spacemit: Enable USB3.0 on BananaPi-F3 Ze Huang
@ 2025-12-29 20:14 ` Aurelien Jarno
2026-01-05 20:49 ` Aurelien Jarno
3 siblings, 1 reply; 7+ messages in thread
From: Aurelien Jarno @ 2025-12-29 20:14 UTC (permalink / raw)
To: Ze Huang
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan, devicetree,
linux-riscv, spacemit, linux-kernel
Hi,
On 2025-11-01 17:03, Ze Huang wrote:
> This patch series enables the DWC3 USB 3.0 host controller on the
> Spacemit K1 SoC, and enables it for the Banana Pi F3 board.
>
> To make USB 3.0 work on the K1, we need patches for the USB2 PHY [1],
> ComboPHY [2], and DWC3 [3] driver, also, ensure enabling the following
Note that the CompoPHY part got merged in the meantime.
> configurations:
>
> CONFIG_PHY_SPACEMIT_K1_USB2=y
> CONFIG_PHY_SPACEMIT_K1_PCIE=y
> CONFIG_USB_DWC3=y
> CONFIG_USB_ONBOARD_DEV=y
>
> The series is based on v6.18-rc1.
>
> Link: https://lore.kernel.org/all/20251017-k1-usb2phy-v6-0-7cf9ea2477a1@linux.dev/ [1]
> Link: https://lore.kernel.org/all/20251017190740.306780-1-elder@riscstar.com/ [2]
> Link: https://github.com/torvalds/linux/commit/e0b6dc00c701 [3]
>
> Thanks,
> Ze Huang
>
> Signed-off-by: Ze Huang <huang.ze@linux.dev>
> ---
> Ze Huang (3):
> riscv: dts: spacemit: Add USB2 PHY node for K1
> riscv: dts: spacemit: Add DWC3 USB 3.0 controller node for K1
> riscv: dts: spacemit: Enable USB3.0 on BananaPi-F3
>
> arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts | 47 +++++++++++++++++++++++++
> arch/riscv/boot/dts/spacemit/k1.dtsi | 32 +++++++++++++++++
> 2 files changed, 79 insertions(+)
The whole series is:
Tested-by: Aurelien Jarno <aurelien@aurel32.net>
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://aurel32.net
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH 0/3] riscv: dts: spacemit: Add USB 3.0 support for K1
2025-12-29 20:14 ` [PATCH 0/3] riscv: dts: spacemit: Add USB 3.0 support for K1 Aurelien Jarno
@ 2026-01-05 20:49 ` Aurelien Jarno
2026-01-06 2:03 ` Ze Huang
0 siblings, 1 reply; 7+ messages in thread
From: Aurelien Jarno @ 2026-01-05 20:49 UTC (permalink / raw)
To: Ze Huang
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan, devicetree,
linux-riscv, spacemit, linux-kernel
Hi,
On 2025-12-29 21:14, Aurelien Jarno wrote:
> Hi,
>
> On 2025-11-01 17:03, Ze Huang wrote:
> > This patch series enables the DWC3 USB 3.0 host controller on the
> > Spacemit K1 SoC, and enables it for the Banana Pi F3 board.
> >
> > To make USB 3.0 work on the K1, we need patches for the USB2 PHY [1],
> > ComboPHY [2], and DWC3 [3] driver, also, ensure enabling the following
>
> Note that the ComboPHY part got merged in the meantime.
The USB2 PHY part also got merged, so you might want to send a rebased
version against https://github.com/spacemit-com/linux k1/for-next
Regards
Aurelien
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://aurel32.net
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/3] riscv: dts: spacemit: Add USB 3.0 support for K1
2026-01-05 20:49 ` Aurelien Jarno
@ 2026-01-06 2:03 ` Ze Huang
0 siblings, 0 replies; 7+ messages in thread
From: Ze Huang @ 2026-01-06 2:03 UTC (permalink / raw)
To: Ze Huang, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
Yixun Lan, devicetree, linux-riscv, spacemit, linux-kernel
On Mon, Jan 05, 2026 at 09:49:47PM +0100, Aurelien Jarno wrote:
> Hi,
>
> On 2025-12-29 21:14, Aurelien Jarno wrote:
> > Hi,
> >
> > On 2025-11-01 17:03, Ze Huang wrote:
> > > This patch series enables the DWC3 USB 3.0 host controller on the
> > > Spacemit K1 SoC, and enables it for the Banana Pi F3 board.
> > >
> > > To make USB 3.0 work on the K1, we need patches for the USB2 PHY [1],
> > > ComboPHY [2], and DWC3 [3] driver, also, ensure enabling the following
> >
> > Note that the ComboPHY part got merged in the meantime.
>
> The USB2 PHY part also got merged, so you might want to send a rebased
> version against https://github.com/spacemit-com/linux k1/for-next
>
> Regards
> Aurelien
Hi Aurelien,
Thanks for the heads-up and for testing the series.
I'll rebase the patches on top of the k1/for-next branch and send out a new
version shortly.
Thanks,
Ze Huang
^ permalink raw reply [flat|nested] 7+ messages in thread