devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH V4 0/5] Tegra USB device support updates
@ 2023-01-16 15:19 Jon Hunter
  2023-01-16 15:19 ` [RESEND PATCH V4 1/5] dt-bindings: usb: tegra-xudc: Add dma-coherent for Tegra194 Jon Hunter
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Jon Hunter @ 2023-01-16 15:19 UTC (permalink / raw)
  To: Thierry Reding, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski
  Cc: linux-usb, devicetree, linux-tegra, 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/20221114124053.1873316-1-waynec@nvidia.com/

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

-- 
2.25.1


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

* [RESEND PATCH V4 1/5] dt-bindings: usb: tegra-xudc: Add dma-coherent for Tegra194
  2023-01-16 15:19 [RESEND PATCH V4 0/5] Tegra USB device support updates Jon Hunter
@ 2023-01-16 15:19 ` Jon Hunter
  2023-01-17 11:13   ` Krzysztof Kozlowski
  2023-01-16 15:19 ` [RESEND PATCH V4 2/5] arm64: tegra: Add dma-coherent property for Tegra194 XUDC Jon Hunter
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Jon Hunter @ 2023-01-16 15:19 UTC (permalink / raw)
  To: Thierry Reding, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski
  Cc: linux-usb, devicetree, linux-tegra, 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")

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
V4: This is new in this version

 .../devicetree/bindings/usb/nvidia,tegra-xudc.yaml   | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/nvidia,tegra-xudc.yaml b/Documentation/devicetree/bindings/usb/nvidia,tegra-xudc.yaml
index f6cb19efd98b..4ef88d38fa3a 100644
--- a/Documentation/devicetree/bindings/usb/nvidia,tegra-xudc.yaml
+++ b/Documentation/devicetree/bindings/usb/nvidia,tegra-xudc.yaml
@@ -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:
-- 
2.25.1


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

* [RESEND PATCH V4 2/5] arm64: tegra: Add dma-coherent property for Tegra194 XUDC
  2023-01-16 15:19 [RESEND PATCH V4 0/5] Tegra USB device support updates Jon Hunter
  2023-01-16 15:19 ` [RESEND PATCH V4 1/5] dt-bindings: usb: tegra-xudc: Add dma-coherent for Tegra194 Jon Hunter
@ 2023-01-16 15:19 ` Jon Hunter
  2023-01-17 11:14   ` Krzysztof Kozlowski
  2023-01-16 15:19 ` [RESEND PATCH V4 3/5] dt-bindings: usb: tegra-xudc: Add Tegra234 XUDC support Jon Hunter
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Jon Hunter @ 2023-01-16 15:19 UTC (permalink / raw)
  To: Thierry Reding, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski
  Cc: linux-usb, devicetree, linux-tegra, 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")

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
V4: This is new in this version

 arch/arm64/boot/dts/nvidia/tegra194.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/nvidia/tegra194.dtsi b/arch/arm64/boot/dts/nvidia/tegra194.dtsi
index 4afcbd60e144..99eeba8de6bd 100644
--- a/arch/arm64/boot/dts/nvidia/tegra194.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra194.dtsi
@@ -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";
 		};
 
-- 
2.25.1


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

* [RESEND PATCH V4 3/5] dt-bindings: usb: tegra-xudc: Add Tegra234 XUDC support
  2023-01-16 15:19 [RESEND PATCH V4 0/5] Tegra USB device support updates Jon Hunter
  2023-01-16 15:19 ` [RESEND PATCH V4 1/5] dt-bindings: usb: tegra-xudc: Add dma-coherent for Tegra194 Jon Hunter
  2023-01-16 15:19 ` [RESEND PATCH V4 2/5] arm64: tegra: Add dma-coherent property for Tegra194 XUDC Jon Hunter
@ 2023-01-16 15:19 ` Jon Hunter
  2023-01-17 11:14   ` Krzysztof Kozlowski
  2023-01-16 15:19 ` [RESEND PATCH V4 4/5] usb: gadget: tegra-xudc: Add Tegra234 support Jon Hunter
  2023-01-16 15:19 ` [RESEND PATCH V4 5/5] arm64: tegra: Populate the XUDC node for Tegra234 Jon Hunter
  4 siblings, 1 reply; 9+ messages in thread
From: Jon Hunter @ 2023-01-16 15:19 UTC (permalink / raw)
  To: Thierry Reding, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski
  Cc: linux-usb, devicetree, linux-tegra, Wayne Chang, Jon Hunter

From: Wayne Chang <waynec@nvidia.com>

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

Signed-off-by: Wayne Chang <waynec@nvidia.com>
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
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(+)

diff --git a/Documentation/devicetree/bindings/usb/nvidia,tegra-xudc.yaml b/Documentation/devicetree/bindings/usb/nvidia,tegra-xudc.yaml
index 4ef88d38fa3a..e638f77658fc 100644
--- a/Documentation/devicetree/bindings/usb/nvidia,tegra-xudc.yaml
+++ b/Documentation/devicetree/bindings/usb/nvidia,tegra-xudc.yaml
@@ -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
-- 
2.25.1


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

* [RESEND PATCH V4 4/5] usb: gadget: tegra-xudc: Add Tegra234 support
  2023-01-16 15:19 [RESEND PATCH V4 0/5] Tegra USB device support updates Jon Hunter
                   ` (2 preceding siblings ...)
  2023-01-16 15:19 ` [RESEND PATCH V4 3/5] dt-bindings: usb: tegra-xudc: Add Tegra234 XUDC support Jon Hunter
@ 2023-01-16 15:19 ` Jon Hunter
  2023-01-16 15:19 ` [RESEND PATCH V4 5/5] arm64: tegra: Populate the XUDC node for Tegra234 Jon Hunter
  4 siblings, 0 replies; 9+ messages in thread
From: Jon Hunter @ 2023-01-16 15:19 UTC (permalink / raw)
  To: Thierry Reding, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski
  Cc: linux-usb, devicetree, linux-tegra, Sing-Han Chen, Wayne Chang,
	Jon Hunter

From: Sing-Han Chen <singhanc@nvidia.com>

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

Signed-off-by: Sing-Han Chen <singhanc@nvidia.com>
Signed-off-by: Wayne Chang <waynec@nvidia.com>
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
V1 -> V4: nothing has changed

 drivers/usb/gadget/udc/tegra-xudc.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/usb/gadget/udc/tegra-xudc.c b/drivers/usb/gadget/udc/tegra-xudc.c
index 76919d7570d2..ff697190469b 100644
--- a/drivers/usb/gadget/udc/tegra-xudc.c
+++ b/drivers/usb/gadget/udc/tegra-xudc.c
@@ -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);
-- 
2.25.1


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

* [RESEND PATCH V4 5/5] arm64: tegra: Populate the XUDC node for Tegra234
  2023-01-16 15:19 [RESEND PATCH V4 0/5] Tegra USB device support updates Jon Hunter
                   ` (3 preceding siblings ...)
  2023-01-16 15:19 ` [RESEND PATCH V4 4/5] usb: gadget: tegra-xudc: Add Tegra234 support Jon Hunter
@ 2023-01-16 15:19 ` Jon Hunter
  4 siblings, 0 replies; 9+ messages in thread
From: Jon Hunter @ 2023-01-16 15:19 UTC (permalink / raw)
  To: Thierry Reding, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski
  Cc: linux-usb, devicetree, linux-tegra, Jon Hunter

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

This is based upon a patch from Wayne Chang <waynec@nvidia.com>.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
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(+)

diff --git a/arch/arm64/boot/dts/nvidia/tegra234.dtsi b/arch/arm64/boot/dts/nvidia/tegra234.dtsi
index 242bf59711f8..728099116dd0 100644
--- a/arch/arm64/boot/dts/nvidia/tegra234.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra234.dtsi
@@ -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>,
-- 
2.25.1


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

* Re: [RESEND PATCH V4 1/5] dt-bindings: usb: tegra-xudc: Add dma-coherent for Tegra194
  2023-01-16 15:19 ` [RESEND PATCH V4 1/5] dt-bindings: usb: tegra-xudc: Add dma-coherent for Tegra194 Jon Hunter
@ 2023-01-17 11:13   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-17 11:13 UTC (permalink / raw)
  To: Jon Hunter, Thierry Reding, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski
  Cc: linux-usb, devicetree, linux-tegra

On 16/01/2023 16:19, Jon Hunter wrote:
> 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")
> 
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> ---
> V4: This is new in this version

Same comments as before resend.

Best regards,
Krzysztof


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

* Re: [RESEND PATCH V4 2/5] arm64: tegra: Add dma-coherent property for Tegra194 XUDC
  2023-01-16 15:19 ` [RESEND PATCH V4 2/5] arm64: tegra: Add dma-coherent property for Tegra194 XUDC Jon Hunter
@ 2023-01-17 11:14   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-17 11:14 UTC (permalink / raw)
  To: Jon Hunter, Thierry Reding, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski
  Cc: linux-usb, devicetree, linux-tegra

On 16/01/2023 16:19, Jon Hunter wrote:
> 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.

> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> ---
> V4: This is new in this version

Best regards,
Krzysztof


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

* Re: [RESEND PATCH V4 3/5] dt-bindings: usb: tegra-xudc: Add Tegra234 XUDC support
  2023-01-16 15:19 ` [RESEND PATCH V4 3/5] dt-bindings: usb: tegra-xudc: Add Tegra234 XUDC support Jon Hunter
@ 2023-01-17 11:14   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-17 11:14 UTC (permalink / raw)
  To: Jon Hunter, Thierry Reding, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski
  Cc: linux-usb, devicetree, linux-tegra, Wayne Chang

On 16/01/2023 16:19, Jon Hunter wrote:
> From: Wayne Chang <waynec@nvidia.com>
> 
> Extend the Tegra XUSB controller device (XUDC) tree binding with
> Tegra234 support.
> 

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


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

end of thread, other threads:[~2023-01-17 11:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-16 15:19 [RESEND PATCH V4 0/5] Tegra USB device support updates Jon Hunter
2023-01-16 15:19 ` [RESEND PATCH V4 1/5] dt-bindings: usb: tegra-xudc: Add dma-coherent for Tegra194 Jon Hunter
2023-01-17 11:13   ` Krzysztof Kozlowski
2023-01-16 15:19 ` [RESEND PATCH V4 2/5] arm64: tegra: Add dma-coherent property for Tegra194 XUDC Jon Hunter
2023-01-17 11:14   ` Krzysztof Kozlowski
2023-01-16 15:19 ` [RESEND PATCH V4 3/5] dt-bindings: usb: tegra-xudc: Add Tegra234 XUDC support Jon Hunter
2023-01-17 11:14   ` Krzysztof Kozlowski
2023-01-16 15:19 ` [RESEND PATCH V4 4/5] usb: gadget: tegra-xudc: Add Tegra234 support Jon Hunter
2023-01-16 15:19 ` [RESEND PATCH V4 5/5] arm64: tegra: Populate the XUDC node for Tegra234 Jon Hunter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).