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

usb: uhci: Add Aspeed AST2700 support

Unlike earlier Aspeed SoCs (AST2400/2500/2600) which are limited to
32-bit DMA addressing, the UHCI controller in AST2700 supports 64-bit
DMA. Update the platform UHCI driver to select the appropriate DMA
mask based on the device tree compatible string.

Signed-off-by: Ryan Chen <ryan_chen@aspeedtech.com>
Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20250922052045.2421480-5-ryan_chen@aspeedtech.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Ryan Chen and committed by
Greg Kroah-Hartman
18a9ec88 8b25c96a

+12 -2
+12 -2
drivers/usb/host/uhci-platform.c
··· 65 65 .hub_control = uhci_hub_control, 66 66 }; 67 67 68 + static const u64 dma_mask_32 = DMA_BIT_MASK(32); 69 + static const u64 dma_mask_64 = DMA_BIT_MASK(64); 70 + 68 71 static int uhci_hcd_platform_probe(struct platform_device *pdev) 69 72 { 70 73 struct device_node *np = pdev->dev.of_node; 74 + const u64 *dma_mask_ptr; 71 75 struct usb_hcd *hcd; 72 76 struct uhci_hcd *uhci; 73 77 struct resource *res; ··· 85 81 * Since shared usb code relies on it, set it here for now. 86 82 * Once we have dma capability bindings this can go away. 87 83 */ 88 - ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); 84 + dma_mask_ptr = (u64 *)of_device_get_match_data(&pdev->dev); 85 + if (!dma_mask_ptr) 86 + dma_mask_ptr = &dma_mask_32; 87 + 88 + ret = dma_coerce_mask_and_coherent(&pdev->dev, *dma_mask_ptr); 89 89 if (ret) 90 90 return ret; 91 91 ··· 122 114 } 123 115 if (of_device_is_compatible(np, "aspeed,ast2400-uhci") || 124 116 of_device_is_compatible(np, "aspeed,ast2500-uhci") || 125 - of_device_is_compatible(np, "aspeed,ast2600-uhci")) { 117 + of_device_is_compatible(np, "aspeed,ast2600-uhci") || 118 + of_device_is_compatible(np, "aspeed,ast2700-uhci")) { 126 119 uhci->is_aspeed = 1; 127 120 dev_info(&pdev->dev, 128 121 "Enabled Aspeed implementation workarounds\n"); ··· 200 191 static const struct of_device_id platform_uhci_ids[] = { 201 192 { .compatible = "generic-uhci", }, 202 193 { .compatible = "platform-uhci", }, 194 + { .compatible = "aspeed,ast2700-uhci", .data = &dma_mask_64}, 203 195 {} 204 196 }; 205 197 MODULE_DEVICE_TABLE(of, platform_uhci_ids);