Skip to contentSkip to conversation

Tegra USB device support updates

PATCH RESEND Superseded Jon Hunter 2 participants 9 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 RESEND 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")

---
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
#2 lore raw

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

Quoted 8 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")

---
V4: This is new in this version

Same comments as before resend.

Best regards,
Krzysztof

author maintainer
#3 lore raw

PATCH RESEND 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")

---
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
#4 lore raw

Re: [RESEND PATCH V4 2/5] arm64: tegra: Add dma-coherent property for Tegra194 XUDC

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

No blank line.

Quoted 3 lines

---
V4: This is new in this version

Best regards,
Krzysztof

author maintainer
#5 lore raw

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

---
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
author maintainer
#7 lore raw

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

---
V1 -> V4: 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
author maintainer
#8 lore raw

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

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

---
V4: This is effectively a new patch that has been added, but based upon
a patch from Wayne Change that added USB host and device support in a single 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