Skip to contentSkip to conversation

Tegra USB device support updates

PATCH Superseded Jon Hunter 2 participants 10 messages Jan 16, 2023 – Jan 17, 2023

Subsystems (3)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Jon Hunter

author maintainer
#0 lore raw

v4 cover Tegra USB device support updates

This series adds USB device support for Tegra234. 3/5 patches were originally part of the series to add both USB host and device support for Tegra234 [0]. However, the series was getting quite large and so I have split this into a separate series but calling it 'V4' to indicate that this is not completely new either.

I have added two more patches in this version to fix DMA coherency for Tegra194.

[0] https://lore.kernel.org/linux-tegra/[email protected]/

Jon Hunter (3):
dt-bindings: usb: tegra-xudc: Add dma-coherent for Tegra194
arm64: tegra: Add dma-coherent property for Tegra194 XUDC
arm64: tegra: Populate the XUDC node for Tegra234

Sing-Han Chen (1):
usb: gadget: tegra-xudc: Add Tegra234 support

Wayne Chang (1):
dt-bindings: usb: tegra-xudc: Add Tegra234 XUDC support

 .../bindings/usb/nvidia,tegra-xudc.yaml       | 15 ++++++++++++
 arch/arm64/boot/dts/nvidia/tegra194.dtsi      |  1 +
 arch/arm64/boot/dts/nvidia/tegra234.dtsi      | 23 +++++++++++++++++++
 drivers/usb/gadget/udc/tegra-xudc.c           | 17 ++++++++++++++
 4 files changed, 56 insertions(+)
Signature · 1 line
2.25.1
author maintainer
#1 lore raw

PATCH v4 1/5 dt-bindings: usb: tegra-xudc: Add dma-coherent for Tegra194

DMA operations for XUSB device controller are coherent for Tegra194 and so update the device-tree binding to add this property.

Fixes 394b012a422d ("dt-bindings: usb: tegra-xudc: Add Tegra194 XUSB controller support")
---
 .../devicetree/bindings/usb/nvidia,tegra-xudc.yaml   | 12 ++++++++++++
 1 file changed, 12 insertions(+)
Documentation/devicetree/bindings/usb/nvidia,tegra-xudc.yaml +12 -0
index f6cb19efd98b..4ef88d38fa3a 100644
@@ -112,6 +112,8 @@ properties:
   hvdd-usb-supply:
     description: USB controller power supply. Must supply 3.3 V.
 
+  dma-coherent: true
+
 required:
   - compatible
   - reg
@@ -164,6 +166,16 @@ allOf:
         clock-names:
           maxItems: 4
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - nvidia,tegra194-xudc
+    then:
+      required:
+        - dma-coherent
+
 additionalProperties: false
 
 examples:
Signature · 1 line
2.25.1
#2 lore raw

Re: [PATCH V4 1/5] dt-bindings: usb: tegra-xudc: Add dma-coherent for Tegra194

Quoted 5 lines · Jon Hunter

DMA operations for XUSB device controller are coherent for Tegra194 and so update the device-tree binding to add this property.

Fixes 394b012a422d ("dt-bindings: usb: tegra-xudc: Add Tegra194 XUSB controller support")

No blank lines between the tags.

If this is a fix, you need to describe the observed issue or bug. Commit suggests this is just adding some missing piece, so not a fix for a bug.

Quoted 25 lines
---
 .../devicetree/bindings/usb/nvidia,tegra-xudc.yaml   | 12 ++++++++++++
 1 file changed, 12 insertions(+)
Documentation/devicetree/bindings/usb/nvidia,tegra-xudc.yaml +5 -0
index f6cb19efd98b..4ef88d38fa3a 100644
@@ -112,6 +112,8 @@ properties:
   hvdd-usb-supply:
     description: USB controller power supply. Must supply 3.3 V.
 
+  dma-coherent: true
+
 required:
   - compatible
   - reg
@@ -164,6 +166,16 @@ allOf:
         clock-names:
           maxItems: 4
 
+  - if:
+      properties:
+        compatible:

Documentation/devicetree/bindings/usb/nvidia,tegra-xudc.yaml allOf: · line 181

Quoted 10 lines
Documentation/devicetree/bindings/usb/nvidia,tegra-xudc.yaml +7 -0
+          contains:
+            enum:
+              - nvidia,tegra194-xudc
+    then:
+      required:
+        - dma-coherent
+
 additionalProperties: false
 
 examples:

Best regards,
Krzysztof

author maintainer
#3 lore raw

Re: [PATCH V4 1/5] dt-bindings: usb: tegra-xudc: Add dma-coherent for Tegra194

Quoted 11 lines · Krzysztof Kozlowski
Quoted 5 lines · Jon Hunter

DMA operations for XUSB device controller are coherent for Tegra194 and so update the device-tree binding to add this property.

Fixes 394b012a422d ("dt-bindings: usb: tegra-xudc: Add Tegra194 XUSB controller support")

No blank lines between the tags.

If this is a fix, you need to describe the observed issue or bug. Commit suggests this is just adding some missing piece, so not a fix for a bug.

OK. I will drop this fixes tag. I have not observed problems without it, but it should have been present.

Jon

Signature · 1 line
nvpublic
author maintainer
#4 lore raw

PATCH v4 2/5 arm64: tegra: Add dma-coherent property for Tegra194 XUDC

In reply to Jon Hunter

DMA operations for XUSB device controller (XUDC) are coherent for Tegra194 and so add the 'dma-coherent' property for this device.

Fixes bc8788b2f3a0 ("arm64: tegra: Add XUDC node on Tegra194")
---
 arch/arm64/boot/dts/nvidia/tegra194.dtsi | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/nvidia/tegra194.dtsi +1 -0
index 4afcbd60e144..99eeba8de6bd 100644
@@ -1291,6 +1291,7 @@ usb@3550000 {
 					<&bpmp TEGRA194_POWER_DOMAIN_XUSBA>;
 			power-domain-names = "dev", "ss";
 			nvidia,xusb-padctl = <&xusb_padctl>;
+			dma-coherent;
 			status = "disabled";
 		};
 
Signature · 1 line
2.25.1
author maintainer
#5 lore raw

PATCH v4 3/5 dt-bindings: usb: tegra-xudc: Add Tegra234 XUDC support

In reply to Jon Hunter

From: Wayne Chang <[email protected]>

Extend the Tegra XUSB controller device (XUDC) tree binding with Tegra234 support.

---
 Documentation/devicetree/bindings/usb/nvidia,tegra-xudc.yaml | 3 +++
 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/usb/nvidia,tegra-xudc.yaml +3 -0
index 4ef88d38fa3a..e638f77658fc 100644
@@ -22,6 +22,7 @@ properties:
           - nvidia,tegra210-xudc # For Tegra210
           - nvidia,tegra186-xudc # For Tegra186
           - nvidia,tegra194-xudc # For Tegra194
+          - nvidia,tegra234-xudc # For Tegra234
 
   reg:
     minItems: 2
@@ -155,6 +156,7 @@ allOf:
             enum:
               - nvidia,tegra186-xudc
               - nvidia,tegra194-xudc
+              - nvidia,tegra234-xudc
     then:
       properties:
         reg:
@@ -172,6 +174,7 @@ allOf:
           contains:
             enum:
               - nvidia,tegra194-xudc
+              - nvidia,tegra234-xudc
     then:
       required:
         - dma-coherent
Signature · 1 line
2.25.1
author maintainer
#7 lore raw

PATCH v4 4/5 usb: gadget: tegra-xudc: Add Tegra234 support

In reply to Jon Hunter

From: Sing-Han Chen <[email protected]>

This commit adds support for XUSB device mode controller support on Tegra234 SoC. This is very similar to the existing Tegra194 XUDC.

---
 drivers/usb/gadget/udc/tegra-xudc.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
drivers/usb/gadget/udc/tegra-xudc.c +17 -0
index 76919d7570d2..ff697190469b 100644
@@ -3660,6 +3660,19 @@ static struct tegra_xudc_soc tegra194_xudc_soc_data = {
 	.has_ipfs = false,
 };
 
+static struct tegra_xudc_soc tegra234_xudc_soc_data = {
+	.clock_names = tegra186_xudc_clock_names,
+	.num_clks = ARRAY_SIZE(tegra186_xudc_clock_names),
+	.num_phys = 4,
+	.u1_enable = true,
+	.u2_enable = true,
+	.lpm_enable = true,
+	.invalid_seq_num = false,
+	.pls_quirk = false,
+	.port_reset_quirk = false,
+	.has_ipfs = false,
+};
+
 static const struct of_device_id tegra_xudc_of_match[] = {
 	{
 		.compatible = "nvidia,tegra210-xudc",
@@ -3673,6 +3686,10 @@ static const struct of_device_id tegra_xudc_of_match[] = {
 		.compatible = "nvidia,tegra194-xudc",
 		.data = &tegra194_xudc_soc_data
 	},
+	{
+		.compatible = "nvidia,tegra234-xudc",
+		.data = &tegra234_xudc_soc_data
+	},
 	{ }
 };
 MODULE_DEVICE_TABLE(of, tegra_xudc_of_match);
Signature · 1 line
2.25.1
author maintainer
#8 lore raw

PATCH v4 5/5 arm64: tegra: Populate the XUDC node for Tegra234

In reply to Jon Hunter

Populate the Tegra XUSB device controller (XUDC) node for Tegra234.

---
 arch/arm64/boot/dts/nvidia/tegra234.dtsi | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
arch/arm64/boot/dts/nvidia/tegra234.dtsi +23 -0
index 242bf59711f8..728099116dd0 100644
@@ -1199,6 +1199,29 @@ usb3-3 {
 			};
 		};
 
+		usb@3550000 {
+			compatible = "nvidia,tegra234-xudc";
+			reg = <0x03550000 0x8000>,
+			      <0x03558000 0x8000>;
+			reg-names = "base", "fpci";
+			interrupts = <GIC_SPI 166 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&bpmp TEGRA234_CLK_XUSB_CORE_DEV>,
+				 <&bpmp TEGRA234_CLK_XUSB_CORE_SS>,
+				 <&bpmp TEGRA234_CLK_XUSB_SS>,
+				 <&bpmp TEGRA234_CLK_XUSB_FS>;
+			clock-names = "dev", "ss", "ss_src", "fs_src";
+			interconnects = <&mc TEGRA234_MEMORY_CLIENT_XUSB_DEVR &emc>,
+					<&mc TEGRA234_MEMORY_CLIENT_XUSB_DEVW &emc>;
+			interconnect-names = "dma-mem", "write";
+			iommus = <&smmu_niso1 TEGRA234_SID_XUSB_DEV>;
+			power-domains = <&bpmp TEGRA234_POWER_DOMAIN_XUSBB>,
+					<&bpmp TEGRA234_POWER_DOMAIN_XUSBA>;
+			power-domain-names = "dev", "ss";
+			nvidia,xusb-padctl = <&xusb_padctl>;
+			dma-coherent;
+			status = "disabled";
+		};
+
 		usb@3610000 {
 			compatible = "nvidia,tegra234-xusb";
 			reg = <0x03610000 0x40000>,
Signature · 1 line
2.25.1
author maintainer
#9 lore raw
In reply to Jon Hunter
Quoted 10 lines · Jon Hunter

This series adds USB device support for Tegra234. 3/5 patches were originally part of the series to add both USB host and device support for Tegra234 [0]. However, the series was getting quite large and so I have split this into a separate series but calling it 'V4' to indicate that this is not completely new either.

I have added two more patches in this version to fix DMA coherency for Tegra194.

[0] https://lore.kernel.org/linux-tegra/[email protected]/

I am re-sending this because ...

1. I am missing my sign-off in a couple patches
2. I forgot to add the version history for some changes.

Jon

Signature · 1 line
nvpublic