diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-05-22 18:59:11 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-07-27 03:48:23 -0400 |
commit | 98864ff58dd2b8ef9e72b0d2c70f34e7ff24a2ee (patch) | |
tree | 87f93ed777f090220acb3cc066c85abe4b863d12 /arch/arm/plat-omap/fb.c | |
parent | 8d717a52d1b0959128be5134dd12608e8e4f2115 (diff) |
ARM: OMAP: Convert OMAPFB and VRAM SDRAM reservation to LMB
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/plat-omap/fb.c')
-rw-r--r-- | arch/arm/plat-omap/fb.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c index 97db493904fa..0054b9501a53 100644 --- a/arch/arm/plat-omap/fb.c +++ b/arch/arm/plat-omap/fb.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include <linux/mm.h> | 26 | #include <linux/mm.h> |
27 | #include <linux/init.h> | 27 | #include <linux/init.h> |
28 | #include <linux/platform_device.h> | 28 | #include <linux/platform_device.h> |
29 | #include <linux/bootmem.h> | 29 | #include <linux/memblock.h> |
30 | #include <linux/io.h> | 30 | #include <linux/io.h> |
31 | #include <linux/omapfb.h> | 31 | #include <linux/omapfb.h> |
32 | 32 | ||
@@ -173,25 +173,27 @@ static int check_fbmem_region(int region_idx, struct omapfb_mem_region *rg, | |||
173 | 173 | ||
174 | static int valid_sdram(unsigned long addr, unsigned long size) | 174 | static int valid_sdram(unsigned long addr, unsigned long size) |
175 | { | 175 | { |
176 | struct bootmem_data *bdata = NODE_DATA(0)->bdata; | 176 | struct memblock_property res; |
177 | unsigned long sdram_start, sdram_end; | ||
178 | 177 | ||
179 | sdram_start = bdata->node_min_pfn << PAGE_SHIFT; | 178 | res.base = addr; |
180 | sdram_end = bdata->node_low_pfn << PAGE_SHIFT; | 179 | res.size = size; |
181 | 180 | return !memblock_find(&res) && res.base == addr && res.size == size; | |
182 | return addr >= sdram_start && sdram_end - addr >= size; | ||
183 | } | 181 | } |
184 | 182 | ||
185 | static int reserve_sdram(unsigned long addr, unsigned long size) | 183 | static int reserve_sdram(unsigned long addr, unsigned long size) |
186 | { | 184 | { |
187 | return reserve_bootmem(addr, size, BOOTMEM_EXCLUSIVE); | 185 | if (memblock_is_region_reserved(addr, size)) |
186 | return -EBUSY; | ||
187 | if (memblock_reserve(addr, size)) | ||
188 | return -ENOMEM; | ||
189 | return 0; | ||
188 | } | 190 | } |
189 | 191 | ||
190 | /* | 192 | /* |
191 | * Called from map_io. We need to call to this early enough so that we | 193 | * Called from map_io. We need to call to this early enough so that we |
192 | * can reserve the fixed SDRAM regions before VM could get hold of them. | 194 | * can reserve the fixed SDRAM regions before VM could get hold of them. |
193 | */ | 195 | */ |
194 | void __init omapfb_reserve_sdram(void) | 196 | void __init omapfb_reserve_sdram_memblock(void) |
195 | { | 197 | { |
196 | unsigned long reserved = 0; | 198 | unsigned long reserved = 0; |
197 | int i; | 199 | int i; |
@@ -386,7 +388,10 @@ static inline int omap_init_fb(void) | |||
386 | 388 | ||
387 | arch_initcall(omap_init_fb); | 389 | arch_initcall(omap_init_fb); |
388 | 390 | ||
389 | void omapfb_reserve_sdram(void) {} | 391 | void omapfb_reserve_sdram_memblock(void) |
392 | { | ||
393 | } | ||
394 | |||
390 | unsigned long omapfb_reserve_sram(unsigned long sram_pstart, | 395 | unsigned long omapfb_reserve_sram(unsigned long sram_pstart, |
391 | unsigned long sram_vstart, | 396 | unsigned long sram_vstart, |
392 | unsigned long sram_size, | 397 | unsigned long sram_size, |
@@ -402,7 +407,10 @@ void omapfb_set_platform_data(struct omapfb_platform_data *data) | |||
402 | { | 407 | { |
403 | } | 408 | } |
404 | 409 | ||
405 | void omapfb_reserve_sdram(void) {} | 410 | void omapfb_reserve_sdram_memblock(void) |
411 | { | ||
412 | } | ||
413 | |||
406 | unsigned long omapfb_reserve_sram(unsigned long sram_pstart, | 414 | unsigned long omapfb_reserve_sram(unsigned long sram_pstart, |
407 | unsigned long sram_vstart, | 415 | unsigned long sram_vstart, |
408 | unsigned long sram_size, | 416 | unsigned long sram_size, |