Skip to contentSkip to conversation

Tegra USB device support updates

PATCH Applied Jon Hunter 4 participants 12 messages Jan 19, 2023 – Jan 25, 2023

Subsystems (3)
lore
Share & tools
lore

Jon Hunter

author maintainer
#0 lore raw

v5 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 v5 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.

---
V5: Dropped fixes tag
V4: This is new in this version

 .../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
Acked-by on v5 1/5
#3 lore raw

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

In reply to Jon Hunter
Quoted 10 lines · Jon Hunter

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

---
V5: Dropped fixes tag
V4: This is new in this version

 .../devicetree/bindings/usb/nvidia,tegra-xudc.yaml   | 12 ++++++++++++
 1 file changed, 12 insertions(+)
author maintainer
#4 lore raw

PATCH v5 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.

---
V5: Dropped fixes tag
V4: This is new in this version

 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 v5 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.

---
V4 -> V5: added Krzysztof's ACK
V3 -> V4: added 'dma-coherent' for Tegra234 V2 -> V3: nothing has changed
V1 -> V2: address the issue on phy-names property

 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
Acked-by on v5 3/5
#6 lore raw

Re: [PATCH V5 3/5] dt-bindings: usb: tegra-xudc: Add Tegra234 XUDC support

Quoted 9 lines · Jon Hunter

From: Wayne Chang <[email protected]>

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

Quoted 8 lines

---
V4 -> V5: added Krzysztof's ACK
V3 -> V4: added 'dma-coherent' for Tegra234 V2 -> V3: nothing has changed
V1 -> V2: address the issue on phy-names property

 Documentation/devicetree/bindings/usb/nvidia,tegra-xudc.yaml | 3 +++
 1 file changed, 3 insertions(+)
author maintainer
#7 lore raw

PATCH v5 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.

---
V1 -> V5: nothing has changed

 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
Acked-by on v5 4/5
#8 lore raw

Re: [PATCH V5 4/5] usb: gadget: tegra-xudc: Add Tegra234 support

Quoted 5 lines · 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.

Quoted 8 lines

---
V1 -> V5: nothing has changed

 drivers/usb/gadget/udc/tegra-xudc.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
author maintainer
#9 lore raw

PATCH v5 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.

This is based upon a patch from Wayne Chang <[email protected]>.

---
V5: Nothing has changed
V4: Added a new patch

 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
#10 lore raw
In reply to Jon Hunter
Quoted 19 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]/

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

Quoted 8 lines

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(+)

I've picked up patches 2 and 5 of this series into the Tegra tree. Greg, can you pick up patches 1, 3 and 4?

Thanks,
Thierry

#11 lore raw
Quoted 23 lines · Thierry Reding
Quoted 22 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]/

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

Quoted 8 lines
Quoted 5 lines
 .../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(+)

I've picked up patches 2 and 5 of this series into the Tegra tree. Greg, can you pick up patches 1, 3 and 4?

Yes, I will do that now, thanks!

greg k-h