]> git.karo-electronics.de Git - karo-tx-linux.git/blob - arch/arm/plat-mxc/include/mach/memory.h
ENGR00155147 mx5x mx6x: adjust dma zone max size to 184M
[karo-tx-linux.git] / arch / arm / plat-mxc / include / mach / memory.h
1 /*
2  * Copyright 2004-2011 Freescale Semiconductor, Inc. All Rights Reserved.
3  */
4
5 /*
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  */
10
11 #ifndef __ASM_ARCH_MXC_MEMORY_H__
12 #define __ASM_ARCH_MXC_MEMORY_H__
13
14 #include <asm/sizes.h>
15 #include <asm/page.h>
16
17 #define MX1_PHYS_OFFSET         UL(0x08000000)
18 #define MX21_PHYS_OFFSET        UL(0xc0000000)
19 #define MX25_PHYS_OFFSET        UL(0x80000000)
20 #define MX27_PHYS_OFFSET        UL(0xa0000000)
21 #define MX3x_PHYS_OFFSET        UL(0x80000000)
22 #define MX50_PHYS_OFFSET        UL(0x70000000)
23 #define MX51_PHYS_OFFSET        UL(0x90000000)
24 #define MX53_PHYS_OFFSET        UL(0x70000000)
25 #define MX6_PHYS_OFFSET         UL(0x10000000)
26
27 #if !defined(CONFIG_RUNTIME_PHYS_OFFSET)
28 # if defined CONFIG_ARCH_MX1
29 #  define PLAT_PHYS_OFFSET              MX1_PHYS_OFFSET
30 # elif defined CONFIG_MACH_MX21
31 #  define PLAT_PHYS_OFFSET              MX21_PHYS_OFFSET
32 # elif defined CONFIG_ARCH_MX25
33 #  define PLAT_PHYS_OFFSET              MX25_PHYS_OFFSET
34 # elif defined CONFIG_MACH_MX27
35 #  define PLAT_PHYS_OFFSET              MX27_PHYS_OFFSET
36 # elif defined CONFIG_ARCH_MX3
37 #  define PLAT_PHYS_OFFSET              MX3x_PHYS_OFFSET
38 # elif defined CONFIG_ARCH_MX50
39 #  define PLAT_PHYS_OFFSET              MX50_PHYS_OFFSET
40 # elif defined CONFIG_ARCH_MX51
41 #  define PLAT_PHYS_OFFSET              MX51_PHYS_OFFSET
42 # elif defined CONFIG_ARCH_MX53
43 #  define PLAT_PHYS_OFFSET              MX53_PHYS_OFFSET
44 # elif defined CONFIG_ARCH_MX50
45 #  define PLAT_PHYS_OFFSET              MX50_PHYS_OFFSET
46 # elif defined CONFIG_ARCH_MX6
47 #  define PLAT_PHYS_OFFSET              MX6_PHYS_OFFSET
48 # endif
49 #endif
50
51 #if defined(CONFIG_MX3_VIDEO)
52 /*
53  * Increase size of DMA-consistent memory region.
54  * This is required for mx3 camera driver to capture at least two QXGA frames.
55  */
56 #define CONSISTENT_DMA_SIZE SZ_8M
57
58 #elif defined(CONFIG_MX1_VIDEO) || defined(CONFIG_VIDEO_MX2_HOSTSUPPORT)
59 /*
60  * Increase size of DMA-consistent memory region.
61  * This is required for i.MX camera driver to capture at least four VGA frames.
62  */
63 #define CONSISTENT_DMA_SIZE SZ_4M
64 #else
65
66 #if defined(CONFIG_ARCH_MX5) || defined(CONFIG_ARCH_MX6)
67 #define CONSISTENT_DMA_SIZE     (184 * SZ_1M)
68 #else
69 #define CONSISTENT_DMA_SIZE     (32 * SZ_1M)
70 #endif
71
72 #endif /* CONFIG_MX1_VIDEO || CONFIG_VIDEO_MX2_HOSTSUPPORT */
73
74 #ifndef __ASSEMBLY__
75
76 #ifdef CONFIG_DMA_ZONE_SIZE
77 #define MXC_DMA_ZONE_SIZE       ((CONFIG_DMA_ZONE_SIZE * SZ_1M) >> PAGE_SHIFT)
78 #else
79 #define MXC_DMA_ZONE_SIZE       ((12 * SZ_1M) >> PAGE_SHIFT)
80 #endif
81
82 static inline void __arch_adjust_zones(unsigned long *zone_size,
83                 unsigned long *zhole_size)
84 {
85         /* Create separate zone to reserve memory for DMA */
86         zone_size[1] = zone_size[0] - MXC_DMA_ZONE_SIZE;
87         zone_size[0] = MXC_DMA_ZONE_SIZE;
88         zhole_size[1] = zhole_size[0];
89         zhole_size[0] = 0;
90 }
91
92 #define arch_adjust_zones(size, holes) \
93         __arch_adjust_zones(size, holes)
94
95 #endif
96
97 #endif /* __ASM_ARCH_MXC_MEMORY_H__ */