Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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@aspeedtech.com>
Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20250928032407.27764-3-ryan_chen@aspeedtech.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Ryan Chen and committed by
Greg Kroah-Hartman
274f2232 f39e7cdd

+13 -2
+13 -2
drivers/usb/host/ehci-platform.c
··· 27 27 #include <linux/io.h> 28 28 #include <linux/module.h> 29 29 #include <linux/of.h> 30 + #include <linux/of_device.h> 30 31 #include <linux/platform_device.h> 31 32 #include <linux/reset.h> 32 33 #include <linux/sys_soc.h> ··· 240 239 struct usb_hcd *hcd; 241 240 struct resource *res_mem; 242 241 struct usb_ehci_pdata *pdata = dev_get_platdata(&dev->dev); 242 + const struct of_device_id *match; 243 243 struct ehci_platform_priv *priv; 244 244 struct ehci_hcd *ehci; 245 245 int err, irq, clk = 0; 246 + bool dma_mask_64; 246 247 247 248 if (usb_disabled()) 248 249 return -ENODEV; ··· 256 253 if (!pdata) 257 254 pdata = &ehci_platform_defaults; 258 255 256 + dma_mask_64 = pdata->dma_mask_64; 257 + match = of_match_device(dev->dev.driver->of_match_table, &dev->dev); 258 + if (match && match->data) 259 + dma_mask_64 = true; 260 + 259 261 err = dma_coerce_mask_and_coherent(&dev->dev, 260 - pdata->dma_mask_64 ? DMA_BIT_MASK(64) : DMA_BIT_MASK(32)); 262 + dma_mask_64 ? DMA_BIT_MASK(64) : DMA_BIT_MASK(32)); 261 263 if (err) { 262 264 dev_err(&dev->dev, "Error: DMA mask configuration failed\n"); 263 265 return err; ··· 306 298 if (of_device_is_compatible(dev->dev.of_node, 307 299 "aspeed,ast2500-ehci") || 308 300 of_device_is_compatible(dev->dev.of_node, 309 - "aspeed,ast2600-ehci")) 301 + "aspeed,ast2600-ehci") || 302 + of_device_is_compatible(dev->dev.of_node, 303 + "aspeed,ast2700-ehci")) 310 304 ehci->is_aspeed = 1; 311 305 312 306 if (soc_device_match(quirk_poll_match)) ··· 495 485 { .compatible = "wm,prizm-ehci", }, 496 486 { .compatible = "generic-ehci", }, 497 487 { .compatible = "cavium,octeon-6335-ehci", }, 488 + { .compatible = "aspeed,ast2700-ehci", .data = (void *)1 }, 498 489 {} 499 490 }; 500 491 MODULE_DEVICE_TABLE(of, vt8500_ehci_ids);