aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-realview/core.c
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2009-11-04 07:19:05 -0500
committerCatalin Marinas <catalin.marinas@arm.com>2009-11-05 05:10:36 -0500
commitc97c5aa83c41a532bc67da356d77da929bc41b9c (patch)
treeb01bec4b8151f5697512b180406c54bc5588811a /arch/arm/mach-realview/core.c
parent157aed7473d300587e89cc87e13f194e3fa6fa36 (diff)
RealView: Add sparsemem support for the RealView PBX platform
The RealView PBX board has two 512MB blocks of memory - one at 0x70000000 (with 256MB mirror at 0) and another at 0x20000000. Only the block at 0x70000000 (or the mirror at 0) may be used for DMA (e.g. framebuffer). This patch adds the sparsemem definitions to allow the use of all the memory split as follows: 256MB @ 0x00000000 (ZONE_DMA) 512MB @ 0x20000000 (ZONE_NORMAL) 256MB @ 0x80000000 (ZONE_NORMAL) Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm/mach-realview/core.c')
-rw-r--r--arch/arm/mach-realview/core.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index c21b0fd39652..9f293438e020 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -59,6 +59,25 @@
59/* used by entry-macro.S and platsmp.c */ 59/* used by entry-macro.S and platsmp.c */
60void __iomem *gic_cpu_base_addr; 60void __iomem *gic_cpu_base_addr;
61 61
62#ifdef CONFIG_ZONE_DMA
63/*
64 * Adjust the zones if there are restrictions for DMA access.
65 */
66void __init realview_adjust_zones(int node, unsigned long *size,
67 unsigned long *hole)
68{
69 unsigned long dma_size = SZ_256M >> PAGE_SHIFT;
70
71 if (!machine_is_realview_pbx() || node || (size[0] <= dma_size))
72 return;
73
74 size[ZONE_NORMAL] = size[0] - dma_size;
75 size[ZONE_DMA] = dma_size;
76 hole[ZONE_NORMAL] = hole[0];
77 hole[ZONE_DMA] = 0;
78}
79#endif
80
62/* 81/*
63 * This is the RealView sched_clock implementation. This has 82 * This is the RealView sched_clock implementation. This has
64 * a resolution of 41.7ns, and a maximum value of about 179s. 83 * a resolution of 41.7ns, and a maximum value of about 179s.
@@ -543,7 +562,7 @@ static int realview_clcd_setup(struct clcd_fb *fb)
543 fb->panel = realview_clcd_panel(); 562 fb->panel = realview_clcd_panel();
544 563
545 fb->fb.screen_base = dma_alloc_writecombine(&fb->dev->dev, framesize, 564 fb->fb.screen_base = dma_alloc_writecombine(&fb->dev->dev, framesize,
546 &dma, GFP_KERNEL); 565 &dma, GFP_KERNEL | GFP_DMA);
547 if (!fb->fb.screen_base) { 566 if (!fb->fb.screen_base) {
548 printk(KERN_ERR "CLCD: unable to map framebuffer\n"); 567 printk(KERN_ERR "CLCD: unable to map framebuffer\n");
549 return -ENOMEM; 568 return -ENOMEM;