diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-05-11 10:39:00 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-05-12 03:36:53 -0400 |
commit | be20902ba67de70b38c995903321f4152dee57b7 (patch) | |
tree | 86f27d4d90b7408d421ce246527431e58a836bf3 /arch/arm/mach-pxa | |
parent | 2fb3ec5c9503ba8874e24170de2b40e8f1a58370 (diff) |
ARM: use ARM_DMA_ZONE_SIZE to adjust the zone sizes
Rather than each platform providing its own function to adjust the
zone sizes, use the new ARM_DMA_ZONE_SIZE definition to perform this
adjustment. This ensures that the actual DMA zone size and the
ISA_DMA_THRESHOLD/MAX_DMA_ADDRESS definitions are consistent with
each other, and moves this complexity out of the platform code.
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r-- | arch/arm/mach-pxa/cm-x2xx-pci.c | 27 | ||||
-rw-r--r-- | arch/arm/mach-pxa/include/mach/memory.h | 7 |
2 files changed, 1 insertions, 33 deletions
diff --git a/arch/arm/mach-pxa/cm-x2xx-pci.c b/arch/arm/mach-pxa/cm-x2xx-pci.c index 8b1a30959fae..1afc0fb7d6d5 100644 --- a/arch/arm/mach-pxa/cm-x2xx-pci.c +++ b/arch/arm/mach-pxa/cm-x2xx-pci.c | |||
@@ -29,33 +29,6 @@ | |||
29 | unsigned long it8152_base_address; | 29 | unsigned long it8152_base_address; |
30 | static int cmx2xx_it8152_irq_gpio; | 30 | static int cmx2xx_it8152_irq_gpio; |
31 | 31 | ||
32 | /* | ||
33 | * Only first 64MB of memory can be accessed via PCI. | ||
34 | * We use GFP_DMA to allocate safe buffers to do map/unmap. | ||
35 | * This is really ugly and we need a better way of specifying | ||
36 | * DMA-capable regions of memory. | ||
37 | */ | ||
38 | void __init cmx2xx_pci_adjust_zones(unsigned long *zone_size, | ||
39 | unsigned long *zhole_size) | ||
40 | { | ||
41 | unsigned int sz = SZ_64M >> PAGE_SHIFT; | ||
42 | |||
43 | if (machine_is_armcore()) { | ||
44 | pr_info("Adjusting zones for CM-X2XX\n"); | ||
45 | |||
46 | /* | ||
47 | * Only adjust if > 64M on current system | ||
48 | */ | ||
49 | if (zone_size[0] <= sz) | ||
50 | return; | ||
51 | |||
52 | zone_size[1] = zone_size[0] - sz; | ||
53 | zone_size[0] = sz; | ||
54 | zhole_size[1] = zhole_size[0]; | ||
55 | zhole_size[0] = 0; | ||
56 | } | ||
57 | } | ||
58 | |||
59 | static void cmx2xx_it8152_irq_demux(unsigned int irq, struct irq_desc *desc) | 32 | static void cmx2xx_it8152_irq_demux(unsigned int irq, struct irq_desc *desc) |
60 | { | 33 | { |
61 | /* clear our parent irq */ | 34 | /* clear our parent irq */ |
diff --git a/arch/arm/mach-pxa/include/mach/memory.h b/arch/arm/mach-pxa/include/mach/memory.h index 57a0b689b4d0..07734f37f8fd 100644 --- a/arch/arm/mach-pxa/include/mach/memory.h +++ b/arch/arm/mach-pxa/include/mach/memory.h | |||
@@ -17,12 +17,7 @@ | |||
17 | */ | 17 | */ |
18 | #define PLAT_PHYS_OFFSET UL(0xa0000000) | 18 | #define PLAT_PHYS_OFFSET UL(0xa0000000) |
19 | 19 | ||
20 | #if !defined(__ASSEMBLY__) && defined(CONFIG_MACH_ARMCORE) && defined(CONFIG_PCI) | 20 | #if defined(CONFIG_MACH_ARMCORE) && defined(CONFIG_PCI) |
21 | void cmx2xx_pci_adjust_zones(unsigned long *size, unsigned long *holes); | ||
22 | |||
23 | #define arch_adjust_zones(size, holes) \ | ||
24 | cmx2xx_pci_adjust_zones(size, holes) | ||
25 | |||
26 | #define ARM_DMA_ZONE_SIZE SZ_64M | 21 | #define ARM_DMA_ZONE_SIZE SZ_64M |
27 | #endif | 22 | #endif |
28 | 23 | ||