aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-realview/include
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-12-01 09:58:15 -0500
committerTakashi Iwai <tiwai@suse.de>2009-12-01 09:58:15 -0500
commitb00615d163cd24fa98d155acfc1f9d81d6fe1103 (patch)
treedde815788aaea3e336aaaf24763311ce63a22e1b /arch/arm/mach-realview/include
parent75639e7ee1401b3876c7a00ffe96ea8027668690 (diff)
parentd6797322231af98b9bb4afb175dd614cf511e5f7 (diff)
Merge branch 'topic/pcm-dma-fix' into topic/core-change
Diffstat (limited to 'arch/arm/mach-realview/include')
-rw-r--r--arch/arm/mach-realview/include/mach/memory.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/arch/arm/mach-realview/include/mach/memory.h b/arch/arm/mach-realview/include/mach/memory.h
index 293c30025e7e..2417bbcf97fd 100644
--- a/arch/arm/mach-realview/include/mach/memory.h
+++ b/arch/arm/mach-realview/include/mach/memory.h
@@ -29,4 +29,53 @@
29#define PHYS_OFFSET UL(0x00000000) 29#define PHYS_OFFSET UL(0x00000000)
30#endif 30#endif
31 31
32#if !defined(__ASSEMBLY__) && defined(CONFIG_ZONE_DMA)
33extern void realview_adjust_zones(int node, unsigned long *size,
34 unsigned long *hole);
35#define arch_adjust_zones(node, size, hole) \
36 realview_adjust_zones(node, size, hole)
37
38#define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_256M - 1)
39#define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_256M)
40#endif
41
42#ifdef CONFIG_SPARSEMEM
43
44/*
45 * Sparsemem definitions for RealView PBX.
46 *
47 * The RealView PBX board has another block of 512MB of RAM at 0x20000000,
48 * however only the block at 0x70000000 (or the 256MB mirror at 0x00000000)
49 * may be used for DMA.
50 *
51 * The macros below define a section size of 256MB and a non-linear virtual to
52 * physical mapping:
53 *
54 * 256MB @ 0x00000000 -> PAGE_OFFSET
55 * 512MB @ 0x20000000 -> PAGE_OFFSET + 0x10000000
56 * 256MB @ 0x80000000 -> PAGE_OFFSET + 0x30000000
57 */
58#ifdef CONFIG_REALVIEW_HIGH_PHYS_OFFSET
59#error "SPARSEMEM not available with REALVIEW_HIGH_PHYS_OFFSET"
60#endif
61
62#define MAX_PHYSMEM_BITS 32
63#define SECTION_SIZE_BITS 28
64
65/* bank page offsets */
66#define PAGE_OFFSET1 (PAGE_OFFSET + 0x10000000)
67#define PAGE_OFFSET2 (PAGE_OFFSET + 0x30000000)
68
69#define __phys_to_virt(phys) \
70 ((phys) >= 0x80000000 ? (phys) - 0x80000000 + PAGE_OFFSET2 : \
71 (phys) >= 0x20000000 ? (phys) - 0x20000000 + PAGE_OFFSET1 : \
72 (phys) + PAGE_OFFSET)
73
74#define __virt_to_phys(virt) \
75 ((virt) >= PAGE_OFFSET2 ? (virt) - PAGE_OFFSET2 + 0x80000000 : \
76 (virt) >= PAGE_OFFSET1 ? (virt) - PAGE_OFFSET1 + 0x20000000 : \
77 (virt) - PAGE_OFFSET)
78
79#endif /* CONFIG_SPARSEMEM */
80
32#endif 81#endif