aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ixp4xx
diff options
context:
space:
mode:
authorSimon Kågström <simon.kagstrom@netinsight.net>2014-03-17 09:42:35 -0400
committerArnd Bergmann <arnd@arndb.de>2014-03-18 11:03:43 -0400
commitbfdad565ae0a61ac943974b8ae61ec0ed55ceb04 (patch)
tree8a38af677ffa2f7e9225a543cfbbc8f0b52f28a3 /arch/arm/mach-ixp4xx
parent64cf9d07ef1f5ed6abc6ed8a2420eb2849f7f444 (diff)
ARM: ixp4xx: Make dma_set_coherent_mask common, correct implementation
Non-PCI devices can use the entire 32-bit range, PCI dittos are limited to the first 64MiB. Also actually setup coherent_dma_mask. The patch has been verified on a board with 128MiB memory, one ipx4xx_eth device and a e100 PCI device. Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-ixp4xx')
-rw-r--r--arch/arm/mach-ixp4xx/common-pci.c9
-rw-r--r--arch/arm/mach-ixp4xx/common.c12
2 files changed, 12 insertions, 9 deletions
diff --git a/arch/arm/mach-ixp4xx/common-pci.c b/arch/arm/mach-ixp4xx/common-pci.c
index 200970d56f6d..055d81694a17 100644
--- a/arch/arm/mach-ixp4xx/common-pci.c
+++ b/arch/arm/mach-ixp4xx/common-pci.c
@@ -481,14 +481,5 @@ int ixp4xx_setup(int nr, struct pci_sys_data *sys)
481 return 1; 481 return 1;
482} 482}
483 483
484int dma_set_coherent_mask(struct device *dev, u64 mask)
485{
486 if (mask >= SZ_64M - 1)
487 return 0;
488
489 return -EIO;
490}
491
492EXPORT_SYMBOL(ixp4xx_pci_read); 484EXPORT_SYMBOL(ixp4xx_pci_read);
493EXPORT_SYMBOL(ixp4xx_pci_write); 485EXPORT_SYMBOL(ixp4xx_pci_write);
494EXPORT_SYMBOL(dma_set_coherent_mask);
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index 6d68aed6548a..df82a2b4a546 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -31,6 +31,7 @@
31#include <linux/gpio.h> 31#include <linux/gpio.h>
32#include <linux/cpu.h> 32#include <linux/cpu.h>
33#include <linux/sched_clock.h> 33#include <linux/sched_clock.h>
34#include <linux/pci.h>
34 35
35#include <mach/udc.h> 36#include <mach/udc.h>
36#include <mach/hardware.h> 37#include <mach/hardware.h>
@@ -578,6 +579,17 @@ void ixp4xx_restart(enum reboot_mode mode, const char *cmd)
578 } 579 }
579} 580}
580 581
582int dma_set_coherent_mask(struct device *dev, u64 mask)
583{
584 if (dev_is_pci(dev) && mask >= SZ_64M)
585 return -EIO;
586
587 dev->coherent_dma_mask = mask;
588
589 return 0;
590}
591EXPORT_SYMBOL(dma_set_coherent_mask);
592
581#ifdef CONFIG_IXP4XX_INDIRECT_PCI 593#ifdef CONFIG_IXP4XX_INDIRECT_PCI
582/* 594/*
583 * In the case of using indirect PCI, we simply return the actual PCI 595 * In the case of using indirect PCI, we simply return the actual PCI