3 @@ -417,7 +417,6 @@ config ARCH_IXP4XX
6 select GENERIC_CLOCKEVENTS
7 - select DMABOUNCE if PCI
9 Support for Intel's IXP4XX (XScale) family of processors.
11 --- a/arch/arm/mach-ixp4xx/Kconfig
12 +++ b/arch/arm/mach-ixp4xx/Kconfig
13 @@ -199,6 +199,45 @@ config IXP4XX_INDIRECT_PCI
14 need to use the indirect method instead. If you don't know
15 what you need, leave this option unselected.
17 +config IXP4XX_LEGACY_DMABOUNCE
18 + bool "legacy PCI DMA bounce support"
23 + The IXP4xx is limited to a 64MB window for PCI DMA, which
24 + requires that PCI accesses above 64MB are bounced via buffers
25 + below 64MB. Furthermore the IXP4xx has an erratum where PCI
26 + read prefetches just below the 64MB limit can trigger lockups.
28 + The kernel has traditionally handled these two issue by using
29 + ARM specific DMA bounce support code for all accesses >= 64MB.
30 + That code causes problems of its own, so it is desirable to
31 + disable it. As the kernel now has a workaround for the PCI read
32 + prefetch erratum, it no longer requires the ARM bounce code.
34 + Enabling this option makes IXP4xx continue to use the problematic
35 + ARM DMA bounce code. Disabling this option makes IXP4xx use the
36 + kernel's generic bounce code.
40 +config IXP4XX_ZONE_DMA
41 + bool "Support > 64MB RAM"
42 + depends on !IXP4XX_LEGACY_DMABOUNCE
46 + The IXP4xx is limited to a 64MB window for PCI DMA, which
47 + requires that PCI accesses above 64MB are bounced via buffers
50 + Disabling this option allows you to omit the support code for
51 + DMA-able memory allocations and DMA bouncing, but the kernel
52 + will then not work properly if more than 64MB of RAM is present.
54 + Say 'Y' unless your platform is limited to <= 64MB of RAM.
57 tristate "IXP4xx Queue Manager support"
59 --- a/arch/arm/mach-ixp4xx/common-pci.c
60 +++ b/arch/arm/mach-ixp4xx/common-pci.c
61 @@ -321,27 +321,38 @@ static int abort_handler(unsigned long a
63 static int ixp4xx_pci_platform_notify(struct device *dev)
65 - if(dev->bus == &pci_bus_type) {
66 - *dev->dma_mask = SZ_64M - 1;
67 + if (dev->bus == &pci_bus_type) {
68 + *dev->dma_mask = SZ_64M - 1;
69 dev->coherent_dma_mask = SZ_64M - 1;
70 +#ifdef CONFIG_DMABOUNCE
71 dmabounce_register_dev(dev, 2048, 4096);
77 static int ixp4xx_pci_platform_notify_remove(struct device *dev)
79 - if(dev->bus == &pci_bus_type) {
80 +#ifdef CONFIG_DMABOUNCE
81 + if (dev->bus == &pci_bus_type)
82 dmabounce_unregister_dev(dev);
88 +#ifdef CONFIG_DMABOUNCE
89 int dma_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size)
91 + /* Note that this returns true for the last page below 64M due to
92 + * IXP4xx erratum 15 (SCR 1289), which states that PCI prefetches
93 + * can cross the boundary between valid memory and a reserved region
94 + * causing AHB bus errors and a lock-up.
96 return (dev->bus == &pci_bus_type ) && ((dma_addr + size) >= SZ_64M);
100 +#ifdef CONFIG_ZONE_DMA
102 * Only first 64MB of memory can be accessed via PCI.
103 * We use GFP_DMA to allocate safe buffers to do map/unmap.
104 @@ -364,6 +375,7 @@ void __init ixp4xx_adjust_zones(int node
105 zhole_size[1] = zhole_size[0];
110 void __init ixp4xx_pci_preinit(void)
112 --- a/arch/arm/mach-ixp4xx/include/mach/memory.h
113 +++ b/arch/arm/mach-ixp4xx/include/mach/memory.h
116 #if !defined(__ASSEMBLY__) && defined(CONFIG_PCI)
118 +#ifdef CONFIG_ZONE_DMA
119 void ixp4xx_adjust_zones(int node, unsigned long *size, unsigned long *holes);
121 #define arch_adjust_zones(node, size, holes) \
122 ixp4xx_adjust_zones(node, size, holes)
125 #define ISA_DMA_THRESHOLD (SZ_64M - 1)
126 #define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_64M)