#include <linux/module.h>
#include <linux/kernel.h>
+#include <linux/mm.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/bootmem.h>
-#include <asm/hardware.h>
+#include <mach/hardware.h>
#include <asm/io.h>
-#include <asm/mach-types.h>
#include <asm/mach/map.h>
-#include <asm/arch/board.h>
-#include <asm/arch/sram.h>
-#include <asm/arch/omapfb.h>
+#include <mach/board.h>
+#include <mach/sram.h>
+#include <mach/omapfb.h>
#if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE)
return 0;
}
-/* Get the region_idx`th region from board config/ATAG and convert it to
+/*
+ * Get the region_idx`th region from board config/ATAG and convert it to
* our internal format.
*/
static int get_fbmem_region(int region_idx, struct omapfb_mem_region *rg)
return -ENOENT;
paddr = conf->start;
- /* Low bits encode the page allocation mode, if high bits
+ /*
+ * Low bits encode the page allocation mode, if high bits
* are zero. Otherwise we need a page aligned fixed
* address.
*/
unsigned long mem_start,
unsigned long mem_size)
{
- /* Check if the configuration specifies the type explicitly.
+ /*
+ * Check if the configuration specifies the type explicitly.
* type = 0 && paddr = 0, a default don't care case maps to
* the SDRAM type.
*/
/* Allocate this dynamically, leave paddr 0 for now. */
return 0;
- /* Fixed region for the given RAM range. Check if it's already
+ /*
+ * Fixed region for the given RAM range. Check if it's already
* reserved by the FB code or someone else.
*/
if (fbmem_region_reserved(paddr, size) ||
return 0;
}
-/* Called from map_io. We need to call to this early enough so that we
+/*
+ * Called from map_io. We need to call to this early enough so that we
* can reserve the fixed SDRAM regions before VM could get hold of them.
*/
-void omapfb_reserve_sdram(void)
+void __init omapfb_reserve_sdram(void)
{
struct bootmem_data *bdata;
unsigned long sdram_start, sdram_size;
return;
bdata = NODE_DATA(0)->bdata;
- sdram_start = bdata->node_boot_start;
+ sdram_start = bdata->node_min_pfn << PAGE_SHIFT;
sdram_size = (bdata->node_low_pfn << PAGE_SHIFT) - sdram_start;
reserved = 0;
for (i = 0; ; i++) {
config_invalid = 1;
return;
}
- if (rg.paddr)
- reserve_bootmem(rg.paddr, rg.size);
- reserved += rg.size;
+ if (rg.paddr) {
+ reserve_bootmem(rg.paddr, rg.size, BOOTMEM_DEFAULT);
+ reserved += rg.size;
+ }
omapfb_config.mem_desc.region[i] = rg;
configured_regions++;
}
reserved);
}
-/* Called at sram init time, before anything is pushed to the SRAM stack.
+/*
+ * Called at sram init time, before anything is pushed to the SRAM stack.
* Because of the stack scheme, we will allocate everything from the
* start of the lowest address region to the end of SRAM. This will also
* include padding for page alignment and possible holes between regions.
size_avail = (size_avail - rg.size) & PAGE_MASK;
rg.paddr = pstart_avail + size_avail;
}
- /* Reserve everything above the start of the region.
- */
+ /* Reserve everything above the start of the region. */
if (pend_avail - rg.paddr > reserved)
reserved = pend_avail - rg.paddr;
size_avail = pend_avail - reserved - pstart_avail;
- /* We have a kernel mapping for this already, so the
+ /*
+ * We have a kernel mapping for this already, so the
* driver won't have to make one.
*/
rg.vaddr = (void *)(sram_vstart + rg.paddr - sram_pstart);
unsigned long sram_vstart,
unsigned long sram_size,
unsigned long start_avail,
- unsigned long size_avail) {}
+ unsigned long size_avail)
+{
+ return 0;
+}
#endif
-
-