[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250918064919.224927-3-ryan_chen@aspeedtech.com>
Date: Thu, 18 Sep 2025 14:49:19 +0800
From: Ryan Chen <ryan_chen@...eedtech.com>
To: ryan_chen <ryan_chen@...eedtech.com>, Greg Kroah-Hartman
<gregkh@...uxfoundation.org>, Rob Herring <robh@...nel.org>, "Krzysztof
Kozlowski" <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, "Alan
Stern" <stern@...land.harvard.edu>, <linux-usb@...r.kernel.org>,
<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH 2/2] usb: ehci: Add Aspeed AST2700 support
Unlike earlier Aspeed SoCs (AST2400/2500/2600) which are limited to
32-bit DMA addressing, the EHCI controller in AST2700 supports 64-bit
DMA. Update the EHCI platform driver to make use of this capability by
selecting a 64-bit DMA mask when the "aspeed,ast2700-ehci" compatible
is present in device tree.
Signed-off-by: Ryan Chen <ryan_chen@...eedtech.com>
---
drivers/usb/host/ehci-platform.c | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c
index 6aab45c8525c..edf1fb4033c2 100644
--- a/drivers/usb/host/ehci-platform.c
+++ b/drivers/usb/host/ehci-platform.c
@@ -27,6 +27,7 @@
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of.h>
+#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/reset.h>
#include <linux/sys_soc.h>
@@ -122,10 +123,18 @@ static const struct ehci_driver_overrides platform_overrides __initconst = {
.extra_priv_size = sizeof(struct ehci_platform_priv),
};
+#define EHCI_PDATA_COMMON \
+ .power_on = ehci_platform_power_on, \
+ .power_suspend = ehci_platform_power_off, \
+ .power_off = ehci_platform_power_off
+
static struct usb_ehci_pdata ehci_platform_defaults = {
- .power_on = ehci_platform_power_on,
- .power_suspend = ehci_platform_power_off,
- .power_off = ehci_platform_power_off,
+ EHCI_PDATA_COMMON,
+};
+
+static const struct usb_ehci_pdata ehci_ast2700_platform = {
+ EHCI_PDATA_COMMON,
+ .dma_mask_64 = 1,
};
/**
@@ -239,6 +248,7 @@ static int ehci_platform_probe(struct platform_device *dev)
struct usb_hcd *hcd;
struct resource *res_mem;
struct usb_ehci_pdata *pdata = dev_get_platdata(&dev->dev);
+ const struct of_device_id *match;
struct ehci_platform_priv *priv;
struct ehci_hcd *ehci;
int err, irq, clk = 0;
@@ -250,7 +260,10 @@ static int ehci_platform_probe(struct platform_device *dev)
* Use reasonable defaults so platforms don't have to provide these
* with DT probing on ARM.
*/
- if (!pdata)
+ match = of_match_device(dev->dev.driver->of_match_table, &dev->dev);
+ if (match && match->data)
+ pdata = (struct usb_ehci_pdata *)match->data;
+ else if (!pdata)
pdata = &ehci_platform_defaults;
err = dma_coerce_mask_and_coherent(&dev->dev,
@@ -298,7 +311,9 @@ static int ehci_platform_probe(struct platform_device *dev)
if (of_device_is_compatible(dev->dev.of_node,
"aspeed,ast2500-ehci") ||
of_device_is_compatible(dev->dev.of_node,
- "aspeed,ast2600-ehci"))
+ "aspeed,ast2600-ehci") ||
+ of_device_is_compatible(dev->dev.of_node,
+ "aspeed,ast2700-ehci"))
ehci->is_aspeed = 1;
if (soc_device_match(quirk_poll_match))
@@ -485,6 +500,7 @@ static const struct of_device_id vt8500_ehci_ids[] = {
{ .compatible = "wm,prizm-ehci", },
{ .compatible = "generic-ehci", },
{ .compatible = "cavium,octeon-6335-ehci", },
+ { .compatible = "aspeed,ast2700-ehci", .data = &ehci_ast2700_platform },
{}
};
MODULE_DEVICE_TABLE(of, vt8500_ehci_ids);
--
2.34.1
Powered by blists - more mailing lists