aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Lauss <manuel.lauss@gmail.com>2019-05-15 08:09:48 -0400
committerPaul Burton <paul.burton@mips.com>2019-05-15 17:29:29 -0400
commitb1e479e3dcbc970bfc0b20a56f213e4df08daf75 (patch)
tree9e3ddf8aac1acc8249304adbfab7d50818519de7
parent81fca03ae741d8b1f21cdc5de7a93826cde27959 (diff)
MIPS: Alchemy: add DMA masks for on-chip ethernet
Makes au1000-eth work again, tested on DB1500. Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com> Signed-off-by: Paul Burton <paul.burton@mips.com> Cc: Linux-MIPS <linux-mips@linux-mips.org>
-rw-r--r--arch/mips/alchemy/common/platform.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/arch/mips/alchemy/common/platform.c b/arch/mips/alchemy/common/platform.c
index 1454d9f6ab2d..b8f3397c59c9 100644
--- a/arch/mips/alchemy/common/platform.c
+++ b/arch/mips/alchemy/common/platform.c
@@ -131,9 +131,7 @@ static void __init alchemy_setup_uarts(int ctype)
131} 131}
132 132
133 133
134/* The dmamask must be set for OHCI/EHCI to work */ 134static u64 alchemy_all_dmamask = DMA_BIT_MASK(32);
135static u64 alchemy_ohci_dmamask = DMA_BIT_MASK(32);
136static u64 __maybe_unused alchemy_ehci_dmamask = DMA_BIT_MASK(32);
137 135
138/* Power on callback for the ehci platform driver */ 136/* Power on callback for the ehci platform driver */
139static int alchemy_ehci_power_on(struct platform_device *pdev) 137static int alchemy_ehci_power_on(struct platform_device *pdev)
@@ -231,7 +229,7 @@ static void __init alchemy_setup_usb(int ctype)
231 res[1].flags = IORESOURCE_IRQ; 229 res[1].flags = IORESOURCE_IRQ;
232 pdev->name = "ohci-platform"; 230 pdev->name = "ohci-platform";
233 pdev->id = 0; 231 pdev->id = 0;
234 pdev->dev.dma_mask = &alchemy_ohci_dmamask; 232 pdev->dev.dma_mask = &alchemy_all_dmamask;
235 pdev->dev.platform_data = &alchemy_ohci_pdata; 233 pdev->dev.platform_data = &alchemy_ohci_pdata;
236 234
237 if (platform_device_register(pdev)) 235 if (platform_device_register(pdev))
@@ -251,7 +249,7 @@ static void __init alchemy_setup_usb(int ctype)
251 res[1].flags = IORESOURCE_IRQ; 249 res[1].flags = IORESOURCE_IRQ;
252 pdev->name = "ehci-platform"; 250 pdev->name = "ehci-platform";
253 pdev->id = 0; 251 pdev->id = 0;
254 pdev->dev.dma_mask = &alchemy_ehci_dmamask; 252 pdev->dev.dma_mask = &alchemy_all_dmamask;
255 pdev->dev.platform_data = &alchemy_ehci_pdata; 253 pdev->dev.platform_data = &alchemy_ehci_pdata;
256 254
257 if (platform_device_register(pdev)) 255 if (platform_device_register(pdev))
@@ -271,7 +269,7 @@ static void __init alchemy_setup_usb(int ctype)
271 res[1].flags = IORESOURCE_IRQ; 269 res[1].flags = IORESOURCE_IRQ;
272 pdev->name = "ohci-platform"; 270 pdev->name = "ohci-platform";
273 pdev->id = 1; 271 pdev->id = 1;
274 pdev->dev.dma_mask = &alchemy_ohci_dmamask; 272 pdev->dev.dma_mask = &alchemy_all_dmamask;
275 pdev->dev.platform_data = &alchemy_ohci_pdata; 273 pdev->dev.platform_data = &alchemy_ohci_pdata;
276 274
277 if (platform_device_register(pdev)) 275 if (platform_device_register(pdev))
@@ -338,7 +336,11 @@ static struct platform_device au1xxx_eth0_device = {
338 .name = "au1000-eth", 336 .name = "au1000-eth",
339 .id = 0, 337 .id = 0,
340 .num_resources = MAC_RES_COUNT, 338 .num_resources = MAC_RES_COUNT,
341 .dev.platform_data = &au1xxx_eth0_platform_data, 339 .dev = {
340 .dma_mask = &alchemy_all_dmamask,
341 .coherent_dma_mask = DMA_BIT_MASK(32),
342 .platform_data = &au1xxx_eth0_platform_data,
343 },
342}; 344};
343 345
344static struct resource au1xxx_eth1_resources[][MAC_RES_COUNT] __initdata = { 346static struct resource au1xxx_eth1_resources[][MAC_RES_COUNT] __initdata = {
@@ -370,7 +372,11 @@ static struct platform_device au1xxx_eth1_device = {
370 .name = "au1000-eth", 372 .name = "au1000-eth",
371 .id = 1, 373 .id = 1,
372 .num_resources = MAC_RES_COUNT, 374 .num_resources = MAC_RES_COUNT,
373 .dev.platform_data = &au1xxx_eth1_platform_data, 375 .dev = {
376 .dma_mask = &alchemy_all_dmamask,
377 .coherent_dma_mask = DMA_BIT_MASK(32),
378 .platform_data = &au1xxx_eth1_platform_data,
379 },
374}; 380};
375 381
376void __init au1xxx_override_eth_cfg(unsigned int port, 382void __init au1xxx_override_eth_cfg(unsigned int port,