Skip to contentSkip to conversation

dt-bindings: usb: dwc2: add compatible "intel,socfpga-agilex-hsotg"

PATCH In review Dinh Nguyen 4 participants 7 messages Jan 25, 2022 – Mar 18, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 dt-bindings: usb: dwc2: add compatible "intel,socfpga-agilex-hsotg"

Add the compatible "intel,socfpga-agilex-hsotg" to the DWC2 implementation, because the Agilex DWC2 implementation does not support clock gating.

---
 Documentation/devicetree/bindings/usb/dwc2.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/usb/dwc2.yaml +1 -0
index f00867ebc147..481aaa09f3f2 100644
@@ -53,6 +53,7 @@ properties:
           - const: st,stm32mp15-hsotg
           - const: snps,dwc2
       - const: samsung,s3c6400-hsotg
+      - const: intel,socfpga-agilex-hsotg
 
   reg:
     maxItems: 1
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/3 usb: dwc2: Add platform specific data for Intel's Agilex

The DWC2 IP on the Agilex platform does not support clock-gating.

---
 drivers/usb/dwc2/params.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/usb/dwc2/params.c +10 -0
index d300ae3d9274..1306f4ec788d 100644
@@ -82,6 +82,14 @@ static void dwc2_set_s3c6400_params(struct dwc2_hsotg *hsotg)
 	p->phy_utmi_width = 8;
 }
 
+static void dwc2_set_socfpga_agilex_params(struct dwc2_hsotg *hsotg)
+{
+	struct dwc2_core_params *p = &hsotg->params;
+
+	p->power_down = DWC2_POWER_DOWN_PARAM_NONE;
+	p->no_clock_gating = true;
+}
+
 static void dwc2_set_rk_params(struct dwc2_hsotg *hsotg)
 {
 	struct dwc2_core_params *p = &hsotg->params;
@@ -239,6 +247,8 @@ const struct of_device_id dwc2_of_match_table[] = {
 	  .data = dwc2_set_stm32mp15_fsotg_params },
 	{ .compatible = "st,stm32mp15-hsotg",
 	  .data = dwc2_set_stm32mp15_hsotg_params },
+	{ .compatible = "intel,socfpga-agilex-hsotg",
+	  .data = dwc2_set_socfpga_agilex_params },
 	{},
 };
 MODULE_DEVICE_TABLE(of, dwc2_of_match_table);
Signature · 1 line
2.25.1
Acked-by on v1 2/3
#2 lore raw

Re: [PATCH 2/3] usb: dwc2: Add platform specific data for Intel's Agilex

Quoted 3 lines · Dinh Nguyen

The DWC2 IP on the Agilex platform does not support clock-gating.

Quoted 32 lines
---
  drivers/usb/dwc2/params.c | 10 ++++++++++
  1 file changed, 10 insertions(+)
drivers/usb/dwc2/params.c +10 -0
index d300ae3d9274..1306f4ec788d 100644
@@ -82,6 +82,14 @@ static void dwc2_set_s3c6400_params(struct dwc2_hsotg *hsotg)
  	p->phy_utmi_width = 8;
  }
 
+static void dwc2_set_socfpga_agilex_params(struct dwc2_hsotg *hsotg)
+{
+	struct dwc2_core_params *p = &hsotg->params;
+
+	p->power_down = DWC2_POWER_DOWN_PARAM_NONE;
+	p->no_clock_gating = true;
+}
+
  static void dwc2_set_rk_params(struct dwc2_hsotg *hsotg)
  {
  	struct dwc2_core_params *p = &hsotg->params;
@@ -239,6 +247,8 @@ const struct of_device_id dwc2_of_match_table[] = {
  	  .data = dwc2_set_stm32mp15_fsotg_params },
  	{ .compatible = "st,stm32mp15-hsotg",
  	  .data = dwc2_set_stm32mp15_hsotg_params },
+	{ .compatible = "intel,socfpga-agilex-hsotg",
+	  .data = dwc2_set_socfpga_agilex_params },
  	{},
  };
  MODULE_DEVICE_TABLE(of, dwc2_of_match_table);
#3 lore raw

PATCH 3/3 arm64: dts: agilex: use the compatible "intel,socfpga-agilex-hsotg"

In reply to Dinh Nguyen

The DWC2 USB controller on the Agilex platform does not support clock gating, so use the chip specific "intel,socfpga-agilex-hsotg" compatible.

---
 arch/arm64/boot/dts/intel/socfpga_agilex.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/intel/socfpga_agilex.dtsi +2 -2
index 0dd2d2ee765a..f4270cf18996 100644
@@ -502,7 +502,7 @@ uart1: serial@ffc02100 {
 		};
 
 		usb0: usb@ffb00000 {
-			compatible = "snps,dwc2";
+			compatible = "intel,socfpga-agilex-hsotg", "snps,dwc2";
 			reg = <0xffb00000 0x40000>;
 			interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>;
 			phys = <&usbphy0>;
@@ -515,7 +515,7 @@ usb0: usb@ffb00000 {
 		};
 
 		usb1: usb@ffb40000 {
-			compatible = "snps,dwc2";
+			compatible = "intel,socfpga-agilex-hsotg", "snps,dwc2";
 			reg = <0xffb40000 0x40000>;
 			interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>;
 			phys = <&usbphy0>;
Signature · 1 line
2.25.1
#4 lore raw

Re: [PATCH 3/3] arm64: dts: agilex: use the compatible "intel,socfpga-agilex-hsotg"

Quoted 14 lines · Dinh Nguyen

The DWC2 USB controller on the Agilex platform does not support clock gating, so use the chip specific "intel,socfpga-agilex-hsotg" compatible.

---
 arch/arm64/boot/dts/intel/socfpga_agilex.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/intel/socfpga_agilex.dtsi +0 -0
index 0dd2d2ee765a..f4270cf18996 100644

arch/arm64/boot/dts/intel/socfpga_agilex.dtsi uart1: serial@ffc02100 { · line 505

Quoted 5 lines
arch/arm64/boot/dts/intel/socfpga_agilex.dtsi +1 -1
@@ -502,7 +502,7 @@ uart1: serial@ffc02100 {
 		};
 
 		usb0: usb@ffb00000 {
-			compatible = "snps,dwc2";
+			compatible = "intel,socfpga-agilex-hsotg", "snps,dwc2";

In the same patchset you sent a bindings change which is contradictory to this DTS change.

This is wrong here and dtbs_check will complain.

#6 lore raw
In reply to Dinh Nguyen
Quoted 14 lines · Dinh Nguyen

Add the compatible "intel,socfpga-agilex-hsotg" to the DWC2 implementation, because the Agilex DWC2 implementation does not support clock gating.

---
 Documentation/devicetree/bindings/usb/dwc2.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/usb/dwc2.yaml +0 -0
index f00867ebc147..481aaa09f3f2 100644

Documentation/devicetree/bindings/usb/dwc2.yaml properties: · line 56

Quoted 4 lines
Documentation/devicetree/bindings/usb/dwc2.yaml +1 -0
@@ -53,6 +53,7 @@ properties:
           - const: st,stm32mp15-hsotg
           - const: snps,dwc2
       - const: samsung,s3c6400-hsotg
+      - const: intel,socfpga-agilex-hsotg

This is confusing and wrong. Now the intel,socfpga-agilex-hsotg is mentioned twice - with and without snps,dwc2. The DTS change in this patchset added usage with snps,dwc2. The commit msg says it's different, but is the difference incompatible?

Please clarify the AgileX HSOTG - is it compatible with snps,dwc2 or not? Based on this the patch might need to be reverted (or changed).

Best regards,
Krzysztof