devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/2] usb: host: Add ac5 to EHCI Orion
@ 2024-01-14 17:21 Elad Nachman
  2024-01-14 17:21 ` [PATCH v4 1/2] dt-bindings: usb: Add Marvell ac5 Elad Nachman
  2024-01-14 17:21 ` [PATCH v4 2/2] usb: host: Add ac5 to EHCI Orion Elad Nachman
  0 siblings, 2 replies; 5+ messages in thread
From: Elad Nachman @ 2024-01-14 17:21 UTC (permalink / raw)
  To: gregkh, rowland.harvard.edu, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, devicetree, linux-usb, linux-kernel
  Cc: enachman

From: Elad Nachman <enachman@marvell.com>

Add support for ac5 to the EHCI Orion platform driver.
The ac5 SOC has DDR starting at offset 0x2_0000_0000,
Hence it requires a larger than 32-bit DMA mask to operate.
Move the dma mask to be pointed by the OF match data, and
use that match data when initializng the DMA mask.
Add dt bindings compatible string to identify the AC5 SOC,
so the driver will know when to apply this different dma mask.

v4:
   1) Fix kernel test robot error (missing null entry in dt
      compatibility array)

v3:
   1) Combine dt bindings and driver pathces into a single patchset.

v2:
   1) Fix compiler warning

Elad Nachman (2):
  dt-bindings: usb: Add Marvell ac5
  usb: host: Add ac5 to EHCI Orion

 .../devicetree/bindings/usb/generic-ehci.yaml  |  1 +
 drivers/usb/host/ehci-orion.c                  | 18 +++++++++++++++---
 2 files changed, 16 insertions(+), 3 deletions(-)

-- 
2.25.1

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

* [PATCH v4 1/2] dt-bindings: usb: Add Marvell ac5
  2024-01-14 17:21 [PATCH v4 0/2] usb: host: Add ac5 to EHCI Orion Elad Nachman
@ 2024-01-14 17:21 ` Elad Nachman
  2024-01-15  7:25   ` Krzysztof Kozlowski
  2024-01-14 17:21 ` [PATCH v4 2/2] usb: host: Add ac5 to EHCI Orion Elad Nachman
  1 sibling, 1 reply; 5+ messages in thread
From: Elad Nachman @ 2024-01-14 17:21 UTC (permalink / raw)
  To: gregkh, rowland.harvard.edu, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, devicetree, linux-usb, linux-kernel
  Cc: enachman

From: Elad Nachman <enachman@marvell.com>

Add Marvell ac5 device tree bindings to generic EHCI.
This compatible enables the Marvell Orion platform code
to properly configure the DMA mask for the Marvell AC5 SOC.

Signed-off-by: Elad Nachman <enachman@marvell.com>
---
 Documentation/devicetree/bindings/usb/generic-ehci.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/usb/generic-ehci.yaml b/Documentation/devicetree/bindings/usb/generic-ehci.yaml
index 87986c45be88..2ed178f16a78 100644
--- a/Documentation/devicetree/bindings/usb/generic-ehci.yaml
+++ b/Documentation/devicetree/bindings/usb/generic-ehci.yaml
@@ -77,6 +77,7 @@ properties:
           - const: usb-ehci
       - enum:
           - generic-ehci
+          - marvell,ac5-ehci
           - marvell,armada-3700-ehci
           - marvell,orion-ehci
           - nuvoton,npcm750-ehci
-- 
2.25.1


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

* [PATCH v4 2/2] usb: host: Add ac5 to EHCI Orion
  2024-01-14 17:21 [PATCH v4 0/2] usb: host: Add ac5 to EHCI Orion Elad Nachman
  2024-01-14 17:21 ` [PATCH v4 1/2] dt-bindings: usb: Add Marvell ac5 Elad Nachman
@ 2024-01-14 17:21 ` Elad Nachman
  1 sibling, 0 replies; 5+ messages in thread
From: Elad Nachman @ 2024-01-14 17:21 UTC (permalink / raw)
  To: gregkh, rowland.harvard.edu, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, devicetree, linux-usb, linux-kernel
  Cc: enachman

From: Elad Nachman <enachman@marvell.com>

Add support for ac5 to the EHCI Orion platform driver.
The ac5 SOC has DDR starting at offset 0x2_0000_0000,
Hence it requires a larger than 32-bit DMA mask to operate.
Move the dma mask to be pointed by the OF match data, and
use that match data when initializng the DMA mask.

Signed-off-by: Elad Nachman <enachman@marvell.com>
---
 drivers/usb/host/ehci-orion.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c
index 6c47ab0a491d..ad145a54ca74 100644
--- a/drivers/usb/host/ehci-orion.c
+++ b/drivers/usb/host/ehci-orion.c
@@ -65,6 +65,15 @@ struct orion_ehci_hcd {
 
 static struct hc_driver __read_mostly ehci_orion_hc_driver;
 
+/*
+ * Legacy DMA mask is 32 bit.
+ * AC5 has the DDR starting at 8GB, hence it requires
+ * a larger (34-bit) DMA mask, in order for DMA allocations
+ * to succeed:
+ */
+static const u64 dma_mask_orion =	DMA_BIT_MASK(32);
+static const u64 dma_mask_ac5 =		DMA_BIT_MASK(34);
+
 /*
  * Implement Orion USB controller specification guidelines
  */
@@ -211,6 +220,7 @@ static int ehci_orion_drv_probe(struct platform_device *pdev)
 	int irq, err;
 	enum orion_ehci_phy_ver phy_version;
 	struct orion_ehci_hcd *priv;
+	u64 *dma_mask_ptr;
 
 	if (usb_disabled())
 		return -ENODEV;
@@ -228,7 +238,8 @@ static int ehci_orion_drv_probe(struct platform_device *pdev)
 	 * set. Since shared usb code relies on it, set it here for
 	 * now. Once we have dma capability bindings this can go away.
 	 */
-	err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+	dma_mask_ptr = (u64 *)of_device_get_match_data(&pdev->dev);
+	err = dma_coerce_mask_and_coherent(&pdev->dev, *dma_mask_ptr);
 	if (err)
 		goto err;
 
@@ -332,8 +343,9 @@ static void ehci_orion_drv_remove(struct platform_device *pdev)
 }
 
 static const struct of_device_id ehci_orion_dt_ids[] = {
-	{ .compatible = "marvell,orion-ehci", },
-	{ .compatible = "marvell,armada-3700-ehci", },
+	{ .compatible = "marvell,orion-ehci", .data = &dma_mask_orion},
+	{ .compatible = "marvell,armada-3700-ehci", .data = &dma_mask_orion},
+	{ .compatible = "marvell,ac5-ehci", .data = &dma_mask_ac5},
 	{},
 };
 MODULE_DEVICE_TABLE(of, ehci_orion_dt_ids);
-- 
2.25.1


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

* Re: [PATCH v4 1/2] dt-bindings: usb: Add Marvell ac5
  2024-01-14 17:21 ` [PATCH v4 1/2] dt-bindings: usb: Add Marvell ac5 Elad Nachman
@ 2024-01-15  7:25   ` Krzysztof Kozlowski
  2024-01-15 16:32     ` Conor Dooley
  0 siblings, 1 reply; 5+ messages in thread
From: Krzysztof Kozlowski @ 2024-01-15  7:25 UTC (permalink / raw)
  To: Elad Nachman, gregkh, rowland.harvard.edu, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, devicetree, linux-usb,
	linux-kernel

On 14/01/2024 18:21, Elad Nachman wrote:
> From: Elad Nachman <enachman@marvell.com>
> 
> Add Marvell ac5 device tree bindings to generic EHCI.
> This compatible enables the Marvell Orion platform code
> to properly configure the DMA mask for the Marvell AC5 SOC.
> 
> Signed-off-by: Elad Nachman <enachman@marvell.com>

This is a friendly reminder during the review process.

It looks like you received a tag and forgot to add it.

If you do not know the process, here is a short explanation:
Please add Acked-by/Reviewed-by/Tested-by tags when posting new
versions, under or above your Signed-off-by tag. Tag is "received", when
provided in a message replied to you on the mailing list. Tools like b4
can help here. However, there's no need to repost patches *only* to add
the tags. The upstream maintainer will do that for tags received on the
version they apply.

https://elixir.bootlin.com/linux/v6.5-rc3/source/Documentation/process/submitting-patches.rst#L577

If a tag was not added on purpose, please state why and what changed.

Best regards,
Krzysztof


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

* Re: [PATCH v4 1/2] dt-bindings: usb: Add Marvell ac5
  2024-01-15  7:25   ` Krzysztof Kozlowski
@ 2024-01-15 16:32     ` Conor Dooley
  0 siblings, 0 replies; 5+ messages in thread
From: Conor Dooley @ 2024-01-15 16:32 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Elad Nachman, gregkh, rowland.harvard.edu, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, devicetree, linux-usb,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1294 bytes --]

On Mon, Jan 15, 2024 at 08:25:08AM +0100, Krzysztof Kozlowski wrote:
> On 14/01/2024 18:21, Elad Nachman wrote:
> > From: Elad Nachman <enachman@marvell.com>
> > 
> > Add Marvell ac5 device tree bindings to generic EHCI.
> > This compatible enables the Marvell Orion platform code
> > to properly configure the DMA mask for the Marvell AC5 SOC.
> > 
> > Signed-off-by: Elad Nachman <enachman@marvell.com>
> 
> This is a friendly reminder during the review process.
> 
> It looks like you received a tag and forgot to add it.

Acked-by: Conor Dooley <conor.dooley@microchip.com>

Cheers,
Conor.

> 
> If you do not know the process, here is a short explanation:
> Please add Acked-by/Reviewed-by/Tested-by tags when posting new
> versions, under or above your Signed-off-by tag. Tag is "received", when
> provided in a message replied to you on the mailing list. Tools like b4
> can help here. However, there's no need to repost patches *only* to add
> the tags. The upstream maintainer will do that for tags received on the
> version they apply.
> 
> https://elixir.bootlin.com/linux/v6.5-rc3/source/Documentation/process/submitting-patches.rst#L577
> 
> If a tag was not added on purpose, please state why and what changed.
> 
> Best regards,
> Krzysztof
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

end of thread, other threads:[~2024-01-15 16:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-14 17:21 [PATCH v4 0/2] usb: host: Add ac5 to EHCI Orion Elad Nachman
2024-01-14 17:21 ` [PATCH v4 1/2] dt-bindings: usb: Add Marvell ac5 Elad Nachman
2024-01-15  7:25   ` Krzysztof Kozlowski
2024-01-15 16:32     ` Conor Dooley
2024-01-14 17:21 ` [PATCH v4 2/2] usb: host: Add ac5 to EHCI Orion Elad Nachman

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