devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V4 0/5] Tegra USB device support updates
@ 2023-01-16 14:54 Jon Hunter
  2023-01-16 14:54 ` [PATCH V4 1/5] dt-bindings: usb: tegra-xudc: Add dma-coherent for Tegra194 Jon Hunter
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Jon Hunter @ 2023-01-16 14:54 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] 10+ messages in thread

* [PATCH V4 1/5] dt-bindings: usb: tegra-xudc: Add dma-coherent for Tegra194
  2023-01-16 14:54 [PATCH V4 0/5] Tegra USB device support updates Jon Hunter
@ 2023-01-16 14:54 ` Jon Hunter
  2023-01-17 11:12   ` Krzysztof Kozlowski
  2023-01-16 14:54 ` [PATCH V4 2/5] arm64: tegra: Add dma-coherent property for Tegra194 XUDC Jon Hunter
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 10+ messages in thread
From: Jon Hunter @ 2023-01-16 14:54 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>
---
 .../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] 10+ messages in thread

* [PATCH V4 2/5] arm64: tegra: Add dma-coherent property for Tegra194 XUDC
  2023-01-16 14:54 [PATCH V4 0/5] Tegra USB device support updates Jon Hunter
  2023-01-16 14:54 ` [PATCH V4 1/5] dt-bindings: usb: tegra-xudc: Add dma-coherent for Tegra194 Jon Hunter
@ 2023-01-16 14:54 ` Jon Hunter
  2023-01-16 14:54 ` [PATCH V4 3/5] dt-bindings: usb: tegra-xudc: Add Tegra234 XUDC support Jon Hunter
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Jon Hunter @ 2023-01-16 14:54 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>
---
 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] 10+ messages in thread

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

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>
---
 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] 10+ messages in thread

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

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>
---
 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] 10+ messages in thread

* [PATCH V4 5/5] arm64: tegra: Populate the XUDC node for Tegra234
  2023-01-16 14:54 [PATCH V4 0/5] Tegra USB device support updates Jon Hunter
                   ` (3 preceding siblings ...)
  2023-01-16 14:54 ` [PATCH V4 4/5] usb: gadget: tegra-xudc: Add Tegra234 support Jon Hunter
@ 2023-01-16 14:54 ` Jon Hunter
  2023-01-16 15:20 ` [PATCH V4 0/5] Tegra USB device support updates Jon Hunter
  5 siblings, 0 replies; 10+ messages in thread
From: Jon Hunter @ 2023-01-16 14:54 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.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
 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] 10+ messages in thread

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


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


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

-- 
nvpublic

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

* Re: [PATCH V4 1/5] dt-bindings: usb: tegra-xudc: Add dma-coherent for Tegra194
  2023-01-16 14:54 ` [PATCH V4 1/5] dt-bindings: usb: tegra-xudc: Add dma-coherent for Tegra194 Jon Hunter
@ 2023-01-17 11:12   ` Krzysztof Kozlowski
  2023-01-17 14:00     ` Jon Hunter
  0 siblings, 1 reply; 10+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-17 11:12 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 15:54, 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")
> 

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.

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

Best regards,
Krzysztof


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

* Re: [PATCH V4 3/5] dt-bindings: usb: tegra-xudc: Add Tegra234 XUDC support
  2023-01-16 14:54 ` [PATCH V4 3/5] dt-bindings: usb: tegra-xudc: Add Tegra234 XUDC support Jon Hunter
@ 2023-01-17 11:13   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 10+ 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, Wayne Chang

On 16/01/2023 15:54, 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] 10+ messages in thread

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


On 17/01/2023 11:12, Krzysztof Kozlowski wrote:
> On 16/01/2023 15:54, 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")
>>
> 
> 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

-- 
nvpublic

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

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

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