aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/pci
diff options
context:
space:
mode:
authorManuel Lauss <manuel.lauss@gmail.com>2014-02-20 08:59:23 -0500
committerRalf Baechle <ralf@linux-mips.org>2014-03-26 18:09:21 -0400
commit88e9a93c9d53ddcf633aa07f14245da7f30408c2 (patch)
tree743667e5317873f87f82a430c71de90cd106b34a /arch/mips/pci
parent8005711c8d80e452748e9572bead54493818f042 (diff)
MIPS: Alchemy: Determine cohereny at runtime based on cpu type
All Alchemy chips have coherent DMA, but for example the USB or AC97 peripherals on the Au1000/1500/1100 are not. This patch uses DMA_MAYBE_COHERENT on Alchemy and sets coherentio based on CPU type. Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com> Cc: Linux-MIPS <linux-mips@linux-mips.org> Patchwork: https://patchwork.linux-mips.org/patch/6576/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/pci')
-rw-r--r--arch/mips/pci/pci-alchemy.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/mips/pci/pci-alchemy.c b/arch/mips/pci/pci-alchemy.c
index d1faece21b6a..563d1f61d6ee 100644
--- a/arch/mips/pci/pci-alchemy.c
+++ b/arch/mips/pci/pci-alchemy.c
@@ -16,6 +16,7 @@
16#include <linux/syscore_ops.h> 16#include <linux/syscore_ops.h>
17#include <linux/vmalloc.h> 17#include <linux/vmalloc.h>
18 18
19#include <asm/dma-coherence.h>
19#include <asm/mach-au1x00/au1000.h> 20#include <asm/mach-au1x00/au1000.h>
20#include <asm/tlbmisc.h> 21#include <asm/tlbmisc.h>
21 22
@@ -411,17 +412,15 @@ static int alchemy_pci_probe(struct platform_device *pdev)
411 } 412 }
412 ctx->alchemy_pci_ctrl.io_map_base = (unsigned long)virt_io; 413 ctx->alchemy_pci_ctrl.io_map_base = (unsigned long)virt_io;
413 414
414#ifdef CONFIG_DMA_NONCOHERENT
415 /* Au1500 revisions older than AD have borked coherent PCI */ 415 /* Au1500 revisions older than AD have borked coherent PCI */
416 if ((alchemy_get_cputype() == ALCHEMY_CPU_AU1500) && 416 if ((alchemy_get_cputype() == ALCHEMY_CPU_AU1500) &&
417 (read_c0_prid() < 0x01030202)) { 417 (read_c0_prid() < 0x01030202) && !coherentio) {
418 val = __raw_readl(ctx->regs + PCI_REG_CONFIG); 418 val = __raw_readl(ctx->regs + PCI_REG_CONFIG);
419 val |= PCI_CONFIG_NC; 419 val |= PCI_CONFIG_NC;
420 __raw_writel(val, ctx->regs + PCI_REG_CONFIG); 420 __raw_writel(val, ctx->regs + PCI_REG_CONFIG);
421 wmb(); 421 wmb();
422 dev_info(&pdev->dev, "non-coherent PCI on Au1500 AA/AB/AC\n"); 422 dev_info(&pdev->dev, "non-coherent PCI on Au1500 AA/AB/AC\n");
423 } 423 }
424#endif
425 424
426 if (pd->board_map_irq) 425 if (pd->board_map_irq)
427 ctx->board_map_irq = pd->board_map_irq; 426 ctx->board_map_irq = pd->board_map_irq;