3 @@ -435,7 +435,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,43 @@ 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 >= 64MB are bounced via buffers
27 + The kernel has traditionally handled this issue by using ARM
28 + specific DMA bounce support code for all accesses >= 64MB.
29 + That code causes problems of its own, so it is desirable to
32 + Enabling this option makes IXP4xx continue to use the problematic
33 + ARM DMA bounce code. Disabling this option makes IXP4xx use the
34 + kernel's generic bounce code.
38 +config IXP4XX_ZONE_DMA
39 + bool "Support > 64MB RAM"
40 + depends on !IXP4XX_LEGACY_DMABOUNCE
44 + The IXP4xx is limited to a 64MB window for PCI DMA, which
45 + requires that PCI accesses above 64MB are bounced via buffers
48 + Disabling this option allows you to omit the support code for
49 + DMA-able memory allocations and DMA bouncing, but the kernel
50 + will then not work properly if more than 64MB of RAM is present.
52 + Say 'Y' unless your platform is limited to <= 64MB of RAM.
55 tristate "IXP4xx Queue Manager support"
57 --- a/arch/arm/mach-ixp4xx/common-pci.c
58 +++ b/arch/arm/mach-ixp4xx/common-pci.c
59 @@ -321,27 +321,33 @@ static int abort_handler(unsigned long a
61 static int ixp4xx_pci_platform_notify(struct device *dev)
63 - if(dev->bus == &pci_bus_type) {
64 - *dev->dma_mask = SZ_64M - 1;
65 + if (dev->bus == &pci_bus_type) {
66 + *dev->dma_mask = SZ_64M - 1;
67 dev->coherent_dma_mask = SZ_64M - 1;
68 +#ifdef CONFIG_DMABOUNCE
69 dmabounce_register_dev(dev, 2048, 4096);
75 static int ixp4xx_pci_platform_notify_remove(struct device *dev)
77 - if(dev->bus == &pci_bus_type) {
78 +#ifdef CONFIG_DMABOUNCE
79 + if (dev->bus == &pci_bus_type)
80 dmabounce_unregister_dev(dev);
86 -int dma_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size)
87 +#ifdef CONFIG_DMABOUNCE
88 +int dma_needs_bounce_2(struct device *dev, dma_addr_t dma_addr, size_t size)
90 - return (dev->bus == &pci_bus_type ) && ((dma_addr + size) >= SZ_64M);
91 + return (dev->bus == &pci_bus_type ) && ((dma_addr + size) > SZ_64M);
95 +#ifdef CONFIG_ZONE_DMA
97 * Only first 64MB of memory can be accessed via PCI.
98 * We use GFP_DMA to allocate safe buffers to do map/unmap.
99 @@ -364,6 +370,7 @@ void __init ixp4xx_adjust_zones(unsigned
100 zhole_size[1] = zhole_size[0];
105 void __init ixp4xx_pci_preinit(void)
107 --- a/arch/arm/mach-ixp4xx/include/mach/memory.h
108 +++ b/arch/arm/mach-ixp4xx/include/mach/memory.h
111 #if !defined(__ASSEMBLY__) && defined(CONFIG_PCI)
113 +#ifdef CONFIG_ZONE_DMA
114 void ixp4xx_adjust_zones(unsigned long *size, unsigned long *holes);
116 #define arch_adjust_zones(size, holes) \
117 ixp4xx_adjust_zones(size, holes)
120 #define ISA_DMA_THRESHOLD (SZ_64M - 1)
121 #define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_64M)