From: Ryan Chen <ryan_chen@aspeedtech.com>
To: ryan_chen <ryan_chen@aspeedtech.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Rob Herring <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
"Alan Stern" <stern@rowland.harvard.edu>,
<linux-usb@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH v2 2/2] usb: ehci: Add Aspeed AST2700 support
Date: Fri, 26 Sep 2025 10:33:08 +0800 [thread overview]
Message-ID: <20250926023308.2890607-3-ryan_chen@aspeedtech.com> (raw)
In-Reply-To: <20250926023308.2890607-1-ryan_chen@aspeedtech.com>
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@aspeedtech.com>
---
drivers/usb/host/ehci-platform.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c
index 6aab45c8525c..18e231d345d0 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>
@@ -239,6 +240,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;
@@ -253,6 +255,10 @@ static int ehci_platform_probe(struct platform_device *dev)
if (!pdata)
pdata = &ehci_platform_defaults;
+ match = of_match_device(dev->dev.driver->of_match_table, &dev->dev);
+ if (match && match->data)
+ pdata->dma_mask_64 = 1;
+
err = dma_coerce_mask_and_coherent(&dev->dev,
pdata->dma_mask_64 ? DMA_BIT_MASK(64) : DMA_BIT_MASK(32));
if (err) {
@@ -298,7 +304,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 +493,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 = (void *)1 },
{}
};
MODULE_DEVICE_TABLE(of, vt8500_ehci_ids);
--
2.34.1
next prev parent reply other threads:[~2025-09-26 2:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-26 2:33 [PATCH v2 0/2] Add Aspeed AST2700 ehci support Ryan Chen
2025-09-26 2:33 ` [PATCH v2 1/2] dt-bindings: usb: ehci: Add Aspeed AST2700 compatible Ryan Chen
2025-09-26 2:33 ` Ryan Chen [this message]
2025-09-26 15:15 ` [PATCH v2 2/2] usb: ehci: Add Aspeed AST2700 support Alan Stern
2025-09-28 2:54 ` Ryan Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250926023308.2890607-3-ryan_chen@aspeedtech.com \
--to=ryan_chen@aspeedtech.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=robh@kernel.org \
--cc=stern@rowland.harvard.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox