All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2] riscv: dts: spacemit: k3: add USB3 port A (DRD) nodes
@ 2026-11-05 10:31 ` Chunyan Zhang
  0 siblings, 0 replies; 6+ messages in thread
From: Chunyan Zhang @ 2026-11-05 10:31 UTC (permalink / raw)
  To: Yixun Lan, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti
  Cc: spacemit, devicetree, linux-riscv, Chunyan Zhang, Troy Mitchell,
	linux-kernel

Describe the DWC3 controller and its USB 2.0 PHY for USB3 port A
of the K3 SoC.

Only the U2 lane is described: Port A's SuperSpeed PHY has no driver
yet, so the port runs at high-speed (maximum-speed = "high-speed").

On the K3 Pico-ITX, Port A is a Type-C connector behind a FUSB301 CC
controller, which is not described yet. Nothing configures the
FUSB301, so the port relies on its power-on CC mode. Enable Port A
with dr_mode = "peripheral"; it is device-only until the CC
controller is described.

Signed-off-by: Chunyan Zhang <chunyan.zhang@linux.spacemit.com>
---
Changes in v2:
- Rebase onto v7.4-rc1.
- Move phys/phy-names to the board dts, matching usb3b/c/d.
- Add snps,dis_u3_susphy_quirk and snps,parkmode-disable-ss-quirk.
- Note in the commit message that Port A is a Type-C port behind a
  FUSB301 and is device-only until the CC controller is described.
---
 arch/riscv/boot/dts/spacemit/k3-pico-itx.dts | 12 ++++++++
 arch/riscv/boot/dts/spacemit/k3.dtsi         | 29 ++++++++++++++++++++
 2 files changed, 41 insertions(+)

diff --git a/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts b/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
index dda420900aa2..d0fbed23ccca 100644
--- a/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
+++ b/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
@@ -337,6 +337,18 @@ &usb2_phy {
 	status = "okay";
 };
 
+&usb3a {
+	phys = <&usb3a_u2phy>;
+	phy-names = "usb2-phy";
+	maximum-speed = "high-speed";
+	dr_mode = "peripheral";
+	status = "okay";
+};
+
+&usb3a_u2phy {
+	status = "okay";
+};
+
 &usb3b {
 	phys = <&usb3b_u2phy>;
 	phy-names = "usb2-phy";
diff --git a/arch/riscv/boot/dts/spacemit/k3.dtsi b/arch/riscv/boot/dts/spacemit/k3.dtsi
index e89d2cc5ca8c..2d2569cfe676 100644
--- a/arch/riscv/boot/dts/spacemit/k3.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k3.dtsi
@@ -687,6 +687,35 @@ gmac2_axi_setup: stmmac-axi-config {
 			};
 		};
 
+		usb3a: usb@cad00000 {
+			compatible = "spacemit,k3-dwc3";
+			reg = <0x0 0xcad00000 0x0 0x10000>;
+			interrupts = <118 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-parent = <&saplic>;
+			clocks = <&syscon_apmu CLK_APMU_USB3_PORTA_BUS>;
+			clock-names = "usbdrd30";
+			resets = <&syscon_apmu RESET_APMU_USB3_A_AHB>,
+				 <&syscon_apmu RESET_APMU_USB3_A_VCC>,
+				 <&syscon_apmu RESET_APMU_USB3_A_PHY>;
+			reset-names = "ahb", "vcc", "phy";
+			phy_type = "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;
+			status = "disabled";
+		};
+
+		usb3a_u2phy: phy@cad20000 {
+			compatible = "spacemit,k3-usb2-phy";
+			reg = <0x0 0xcad20000 0x0 0x200>;
+			clocks = <&syscon_apmu CLK_APMU_USB3_PORTA_BUS>;
+			#phy-cells = <0>;
+			status = "disabled";
+		};
+
 		pdma: dma-controller@d4000000 {
 			compatible = "spacemit,k3-pdma";
 			reg = <0x0 0xd4000000 0x0 0x4000>;
-- 
2.34.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH V2] riscv: dts: spacemit: k3: add USB3 port A (DRD) nodes
@ 2026-11-05 10:31 ` Chunyan Zhang
  0 siblings, 0 replies; 6+ messages in thread
From: Chunyan Zhang @ 2026-11-05 10:31 UTC (permalink / raw)
  To: Yixun Lan, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti
  Cc: spacemit, devicetree, linux-riscv, Chunyan Zhang, Troy Mitchell,
	linux-kernel

Describe the DWC3 controller and its USB 2.0 PHY for USB3 port A
of the K3 SoC.

Only the U2 lane is described: Port A's SuperSpeed PHY has no driver
yet, so the port runs at high-speed (maximum-speed = "high-speed").

On the K3 Pico-ITX, Port A is a Type-C connector behind a FUSB301 CC
controller, which is not described yet. Nothing configures the
FUSB301, so the port relies on its power-on CC mode. Enable Port A
with dr_mode = "peripheral"; it is device-only until the CC
controller is described.

Signed-off-by: Chunyan Zhang <chunyan.zhang@linux.spacemit.com>
---
Changes in v2:
- Rebase onto v7.4-rc1.
- Move phys/phy-names to the board dts, matching usb3b/c/d.
- Add snps,dis_u3_susphy_quirk and snps,parkmode-disable-ss-quirk.
- Note in the commit message that Port A is a Type-C port behind a
  FUSB301 and is device-only until the CC controller is described.
---
 arch/riscv/boot/dts/spacemit/k3-pico-itx.dts | 12 ++++++++
 arch/riscv/boot/dts/spacemit/k3.dtsi         | 29 ++++++++++++++++++++
 2 files changed, 41 insertions(+)

diff --git a/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts b/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
index dda420900aa2..d0fbed23ccca 100644
--- a/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
+++ b/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
@@ -337,6 +337,18 @@ &usb2_phy {
 	status = "okay";
 };
 
+&usb3a {
+	phys = <&usb3a_u2phy>;
+	phy-names = "usb2-phy";
+	maximum-speed = "high-speed";
+	dr_mode = "peripheral";
+	status = "okay";
+};
+
+&usb3a_u2phy {
+	status = "okay";
+};
+
 &usb3b {
 	phys = <&usb3b_u2phy>;
 	phy-names = "usb2-phy";
diff --git a/arch/riscv/boot/dts/spacemit/k3.dtsi b/arch/riscv/boot/dts/spacemit/k3.dtsi
index e89d2cc5ca8c..2d2569cfe676 100644
--- a/arch/riscv/boot/dts/spacemit/k3.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k3.dtsi
@@ -687,6 +687,35 @@ gmac2_axi_setup: stmmac-axi-config {
 			};
 		};
 
+		usb3a: usb@cad00000 {
+			compatible = "spacemit,k3-dwc3";
+			reg = <0x0 0xcad00000 0x0 0x10000>;
+			interrupts = <118 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-parent = <&saplic>;
+			clocks = <&syscon_apmu CLK_APMU_USB3_PORTA_BUS>;
+			clock-names = "usbdrd30";
+			resets = <&syscon_apmu RESET_APMU_USB3_A_AHB>,
+				 <&syscon_apmu RESET_APMU_USB3_A_VCC>,
+				 <&syscon_apmu RESET_APMU_USB3_A_PHY>;
+			reset-names = "ahb", "vcc", "phy";
+			phy_type = "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;
+			status = "disabled";
+		};
+
+		usb3a_u2phy: phy@cad20000 {
+			compatible = "spacemit,k3-usb2-phy";
+			reg = <0x0 0xcad20000 0x0 0x200>;
+			clocks = <&syscon_apmu CLK_APMU_USB3_PORTA_BUS>;
+			#phy-cells = <0>;
+			status = "disabled";
+		};
+
 		pdma: dma-controller@d4000000 {
 			compatible = "spacemit,k3-pdma";
 			reg = <0x0 0xd4000000 0x0 0x4000>;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH V2] riscv: dts: spacemit: k3: add USB3 port A (DRD) nodes
  2026-11-05 10:31 ` Chunyan Zhang
@ 2026-11-28 17:14   ` Junhui Liu
  -1 siblings, 0 replies; 6+ messages in thread
From: Junhui Liu @ 2026-11-28 17:14 UTC (permalink / raw)
  To: Chunyan Zhang, Yixun Lan, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Alexandre Ghiti
  Cc: spacemit, devicetree, linux-riscv, Chunyan Zhang, Troy Mitchell,
	linux-kernel

Hi Chunyan,

Thanks for your work, but I found an issue when testing this patch...

On Thu Nov 5, 2026 at 6:31 PM CST, Chunyan Zhang wrote:
> Describe the DWC3 controller and its USB 2.0 PHY for USB3 port A
> of the K3 SoC.
>
> Only the U2 lane is described: Port A's SuperSpeed PHY has no driver
> yet, so the port runs at high-speed (maximum-speed = "high-speed").
>
> On the K3 Pico-ITX, Port A is a Type-C connector behind a FUSB301 CC
> controller, which is not described yet. Nothing configures the
> FUSB301, so the port relies on its power-on CC mode. Enable Port A
> with dr_mode = "peripheral"; it is device-only until the CC
> controller is described.

In my testing, this patch alone does not make the USB gadget work unless
I manually run the following command after the kernel has booted:

  devmem2 0xcad30040 w 0xA4080401

0xCAD30040 is a register in Port A's USB3 PHY. It seems that even when
using only USB2, the USB3 PHY registers still need to be configured,
so USB3 PHY driver support appears to be needed first for the gadget
to work properly.

>
> Signed-off-by: Chunyan Zhang <chunyan.zhang@linux.spacemit.com>
> ---
> Changes in v2:
> - Rebase onto v7.4-rc1.
> - Move phys/phy-names to the board dts, matching usb3b/c/d.
> - Add snps,dis_u3_susphy_quirk and snps,parkmode-disable-ss-quirk.
> - Note in the commit message that Port A is a Type-C port behind a
>   FUSB301 and is device-only until the CC controller is described.
> ---
>  arch/riscv/boot/dts/spacemit/k3-pico-itx.dts | 12 ++++++++
>  arch/riscv/boot/dts/spacemit/k3.dtsi         | 29 ++++++++++++++++++++
>  2 files changed, 41 insertions(+)
>
> diff --git a/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts b/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
> index dda420900aa2..d0fbed23ccca 100644
> --- a/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
> +++ b/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
> @@ -337,6 +337,18 @@ &usb2_phy {
>  	status = "okay";
>  };
>  
> +&usb3a {
> +	phys = <&usb3a_u2phy>;
> +	phy-names = "usb2-phy";
> +	maximum-speed = "high-speed";
> +	dr_mode = "peripheral";
> +	status = "okay";
> +};
> +
> +&usb3a_u2phy {
> +	status = "okay";
> +};
> +
>  &usb3b {
>  	phys = <&usb3b_u2phy>;
>  	phy-names = "usb2-phy";
> diff --git a/arch/riscv/boot/dts/spacemit/k3.dtsi b/arch/riscv/boot/dts/spacemit/k3.dtsi
> index e89d2cc5ca8c..2d2569cfe676 100644
> --- a/arch/riscv/boot/dts/spacemit/k3.dtsi
> +++ b/arch/riscv/boot/dts/spacemit/k3.dtsi
> @@ -687,6 +687,35 @@ gmac2_axi_setup: stmmac-axi-config {
>  			};
>  		};
>  
> +		usb3a: usb@cad00000 {
> +			compatible = "spacemit,k3-dwc3";
> +			reg = <0x0 0xcad00000 0x0 0x10000>;
> +			interrupts = <118 IRQ_TYPE_LEVEL_HIGH>;
> +			interrupt-parent = <&saplic>;
> +			clocks = <&syscon_apmu CLK_APMU_USB3_PORTA_BUS>;
> +			clock-names = "usbdrd30";
> +			resets = <&syscon_apmu RESET_APMU_USB3_A_AHB>,
> +				 <&syscon_apmu RESET_APMU_USB3_A_VCC>,
> +				 <&syscon_apmu RESET_APMU_USB3_A_PHY>;
> +			reset-names = "ahb", "vcc", "phy";

I also tried booting through the BootROM's USB download mode (fastboot,
with USB worked as a gadget), so that the BootROM would initialize the
PHY registers needed for USB gadget operation. However, I found that
asserting RESET_APMU_USB3_A_AHB during the kernel driver's probe resets
the PHY register state, losing the configuration left by the BootROM.

Am I missing something? How did you test this?

Best regards,
Junhui Liu

> +			phy_type = "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;
> +			status = "disabled";
> +		};
> +
> +		usb3a_u2phy: phy@cad20000 {
> +			compatible = "spacemit,k3-usb2-phy";
> +			reg = <0x0 0xcad20000 0x0 0x200>;
> +			clocks = <&syscon_apmu CLK_APMU_USB3_PORTA_BUS>;
> +			#phy-cells = <0>;
> +			status = "disabled";
> +		};
> +
>  		pdma: dma-controller@d4000000 {
>  			compatible = "spacemit,k3-pdma";
>  			reg = <0x0 0xd4000000 0x0 0x4000>;


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH V2] riscv: dts: spacemit: k3: add USB3 port A (DRD) nodes
@ 2026-11-28 17:14   ` Junhui Liu
  0 siblings, 0 replies; 6+ messages in thread
From: Junhui Liu @ 2026-11-28 17:14 UTC (permalink / raw)
  To: Chunyan Zhang, Yixun Lan, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Alexandre Ghiti
  Cc: spacemit, devicetree, linux-riscv, Chunyan Zhang, Troy Mitchell,
	linux-kernel

Hi Chunyan,

Thanks for your work, but I found an issue when testing this patch...

On Thu Nov 5, 2026 at 6:31 PM CST, Chunyan Zhang wrote:
> Describe the DWC3 controller and its USB 2.0 PHY for USB3 port A
> of the K3 SoC.
>
> Only the U2 lane is described: Port A's SuperSpeed PHY has no driver
> yet, so the port runs at high-speed (maximum-speed = "high-speed").
>
> On the K3 Pico-ITX, Port A is a Type-C connector behind a FUSB301 CC
> controller, which is not described yet. Nothing configures the
> FUSB301, so the port relies on its power-on CC mode. Enable Port A
> with dr_mode = "peripheral"; it is device-only until the CC
> controller is described.

In my testing, this patch alone does not make the USB gadget work unless
I manually run the following command after the kernel has booted:

  devmem2 0xcad30040 w 0xA4080401

0xCAD30040 is a register in Port A's USB3 PHY. It seems that even when
using only USB2, the USB3 PHY registers still need to be configured,
so USB3 PHY driver support appears to be needed first for the gadget
to work properly.

>
> Signed-off-by: Chunyan Zhang <chunyan.zhang@linux.spacemit.com>
> ---
> Changes in v2:
> - Rebase onto v7.4-rc1.
> - Move phys/phy-names to the board dts, matching usb3b/c/d.
> - Add snps,dis_u3_susphy_quirk and snps,parkmode-disable-ss-quirk.
> - Note in the commit message that Port A is a Type-C port behind a
>   FUSB301 and is device-only until the CC controller is described.
> ---
>  arch/riscv/boot/dts/spacemit/k3-pico-itx.dts | 12 ++++++++
>  arch/riscv/boot/dts/spacemit/k3.dtsi         | 29 ++++++++++++++++++++
>  2 files changed, 41 insertions(+)
>
> diff --git a/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts b/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
> index dda420900aa2..d0fbed23ccca 100644
> --- a/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
> +++ b/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
> @@ -337,6 +337,18 @@ &usb2_phy {
>  	status = "okay";
>  };
>  
> +&usb3a {
> +	phys = <&usb3a_u2phy>;
> +	phy-names = "usb2-phy";
> +	maximum-speed = "high-speed";
> +	dr_mode = "peripheral";
> +	status = "okay";
> +};
> +
> +&usb3a_u2phy {
> +	status = "okay";
> +};
> +
>  &usb3b {
>  	phys = <&usb3b_u2phy>;
>  	phy-names = "usb2-phy";
> diff --git a/arch/riscv/boot/dts/spacemit/k3.dtsi b/arch/riscv/boot/dts/spacemit/k3.dtsi
> index e89d2cc5ca8c..2d2569cfe676 100644
> --- a/arch/riscv/boot/dts/spacemit/k3.dtsi
> +++ b/arch/riscv/boot/dts/spacemit/k3.dtsi
> @@ -687,6 +687,35 @@ gmac2_axi_setup: stmmac-axi-config {
>  			};
>  		};
>  
> +		usb3a: usb@cad00000 {
> +			compatible = "spacemit,k3-dwc3";
> +			reg = <0x0 0xcad00000 0x0 0x10000>;
> +			interrupts = <118 IRQ_TYPE_LEVEL_HIGH>;
> +			interrupt-parent = <&saplic>;
> +			clocks = <&syscon_apmu CLK_APMU_USB3_PORTA_BUS>;
> +			clock-names = "usbdrd30";
> +			resets = <&syscon_apmu RESET_APMU_USB3_A_AHB>,
> +				 <&syscon_apmu RESET_APMU_USB3_A_VCC>,
> +				 <&syscon_apmu RESET_APMU_USB3_A_PHY>;
> +			reset-names = "ahb", "vcc", "phy";

I also tried booting through the BootROM's USB download mode (fastboot,
with USB worked as a gadget), so that the BootROM would initialize the
PHY registers needed for USB gadget operation. However, I found that
asserting RESET_APMU_USB3_A_AHB during the kernel driver's probe resets
the PHY register state, losing the configuration left by the BootROM.

Am I missing something? How did you test this?

Best regards,
Junhui Liu

> +			phy_type = "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;
> +			status = "disabled";
> +		};
> +
> +		usb3a_u2phy: phy@cad20000 {
> +			compatible = "spacemit,k3-usb2-phy";
> +			reg = <0x0 0xcad20000 0x0 0x200>;
> +			clocks = <&syscon_apmu CLK_APMU_USB3_PORTA_BUS>;
> +			#phy-cells = <0>;
> +			status = "disabled";
> +		};
> +
>  		pdma: dma-controller@d4000000 {
>  			compatible = "spacemit,k3-pdma";
>  			reg = <0x0 0xd4000000 0x0 0x4000>;


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH V2] riscv: dts: spacemit: k3: add USB3 port A (DRD) nodes
  2026-11-28 17:14   ` Junhui Liu
@ 2026-12-01 10:53     ` Chunyan Zhang
  -1 siblings, 0 replies; 6+ messages in thread
From: Chunyan Zhang @ 2026-12-01 10:53 UTC (permalink / raw)
  To: Junhui Liu
  Cc: Yixun Lan, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	spacemit, devicetree, linux-riscv, Troy Mitchell, linux-kernel

Hi Junhui,

On Sun, 29 Nov 2026 at 01:15, Junhui Liu <junhui.liu@pigmoral.tech> wrote:
>
> Hi Chunyan,
>
> Thanks for your work, but I found an issue when testing this patch...
>
> On Thu Nov 5, 2026 at 6:31 PM CST, Chunyan Zhang wrote:
> > Describe the DWC3 controller and its USB 2.0 PHY for USB3 port A
> > of the K3 SoC.
> >
> > Only the U2 lane is described: Port A's SuperSpeed PHY has no driver
> > yet, so the port runs at high-speed (maximum-speed = "high-speed").
> >
> > On the K3 Pico-ITX, Port A is a Type-C connector behind a FUSB301 CC
> > controller, which is not described yet. Nothing configures the
> > FUSB301, so the port relies on its power-on CC mode. Enable Port A
> > with dr_mode = "peripheral"; it is device-only until the CC
> > controller is described.
>
> In my testing, this patch alone does not make the USB gadget work unless
> I manually run the following command after the kernel has booted:
>
>   devmem2 0xcad30040 w 0xA4080401
>
> 0xCAD30040 is a register in Port A's USB3 PHY. It seems that even when
> using only USB2, the USB3 PHY registers still need to be configured,
> so USB3 PHY driver support appears to be needed first for the gadget
> to work properly.

I re-ran it from a clean environment and confirm your finding: with
the DT change alone the
gadget does not enumerate, and writing 0xcad30040 bit[10] by hand makes it work.
So the U2-only description is not self-sufficient, and my earlier test
result was misleading -- I was focused on adb usage. Sorry for the noise.

Please ignore this patch for now.

Thanks,
Chunyan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH V2] riscv: dts: spacemit: k3: add USB3 port A (DRD) nodes
@ 2026-12-01 10:53     ` Chunyan Zhang
  0 siblings, 0 replies; 6+ messages in thread
From: Chunyan Zhang @ 2026-12-01 10:53 UTC (permalink / raw)
  To: Junhui Liu
  Cc: Yixun Lan, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	spacemit, devicetree, linux-riscv, Troy Mitchell, linux-kernel

Hi Junhui,

On Sun, 29 Nov 2026 at 01:15, Junhui Liu <junhui.liu@pigmoral.tech> wrote:
>
> Hi Chunyan,
>
> Thanks for your work, but I found an issue when testing this patch...
>
> On Thu Nov 5, 2026 at 6:31 PM CST, Chunyan Zhang wrote:
> > Describe the DWC3 controller and its USB 2.0 PHY for USB3 port A
> > of the K3 SoC.
> >
> > Only the U2 lane is described: Port A's SuperSpeed PHY has no driver
> > yet, so the port runs at high-speed (maximum-speed = "high-speed").
> >
> > On the K3 Pico-ITX, Port A is a Type-C connector behind a FUSB301 CC
> > controller, which is not described yet. Nothing configures the
> > FUSB301, so the port relies on its power-on CC mode. Enable Port A
> > with dr_mode = "peripheral"; it is device-only until the CC
> > controller is described.
>
> In my testing, this patch alone does not make the USB gadget work unless
> I manually run the following command after the kernel has booted:
>
>   devmem2 0xcad30040 w 0xA4080401
>
> 0xCAD30040 is a register in Port A's USB3 PHY. It seems that even when
> using only USB2, the USB3 PHY registers still need to be configured,
> so USB3 PHY driver support appears to be needed first for the gadget
> to work properly.

I re-ran it from a clean environment and confirm your finding: with
the DT change alone the
gadget does not enumerate, and writing 0xcad30040 bit[10] by hand makes it work.
So the U2-only description is not self-sufficient, and my earlier test
result was misleading -- I was focused on adb usage. Sorry for the noise.

Please ignore this patch for now.

Thanks,
Chunyan

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-12-01 10:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-05 10:31 [PATCH V2] riscv: dts: spacemit: k3: add USB3 port A (DRD) nodes Chunyan Zhang
2026-11-05 10:31 ` Chunyan Zhang
2026-11-28 17:14 ` Junhui Liu
2026-11-28 17:14   ` Junhui Liu
2026-12-01 10:53   ` Chunyan Zhang
2026-12-01 10:53     ` Chunyan Zhang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.