1 #include <linux/config.h>
2 #include <linux/module.h>
3 #include <linux/kernel.h>
4 #include <linux/init.h>
5 #include <linux/platform_device.h>
6 #include <linux/bootmem.h>
8 #include <asm/hardware.h>
10 #include <asm/mach-types.h>
11 #include <asm/mach/map.h>
13 #include <asm/arch/board.h>
14 #include <asm/arch/sram.h>
15 #include <asm/arch/omapfb.h>
17 #if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE)
19 static struct omapfb_platform_data omapfb_config;
21 static u64 omap_fb_dma_mask = ~(u32)0;
23 static struct platform_device omap_fb_device = {
27 .dma_mask = &omap_fb_dma_mask,
28 .coherent_dma_mask = ~(u32)0,
29 .platform_data = &omapfb_config,
34 /* called from map_io */
35 void omapfb_reserve_mem(void)
37 const struct omap_fbmem_config *fbmem_conf;
39 omapfb_config.fbmem.fb_sram_start = omap_fb_sram_start;
40 omapfb_config.fbmem.fb_sram_size = omap_fb_sram_size;
42 fbmem_conf = omap_get_config(OMAP_TAG_FBMEM, struct omap_fbmem_config);
44 if (fbmem_conf != NULL) {
45 /* indicate that the bootloader already initialized the
46 * fb device, so we'll skip that part in the fb driver
48 omapfb_config.fbmem.fb_sdram_start = fbmem_conf->fb_sdram_start;
49 omapfb_config.fbmem.fb_sdram_size = fbmem_conf->fb_sdram_size;
50 if (fbmem_conf->fb_sdram_size) {
51 pr_info("Reserving %u bytes SDRAM for frame buffer\n",
52 fbmem_conf->fb_sdram_size);
53 reserve_bootmem(fbmem_conf->fb_sdram_start,
54 fbmem_conf->fb_sdram_size);
59 static inline int omap_init_fb(void)
61 const struct omap_lcd_config *conf;
63 conf = omap_get_config(OMAP_TAG_LCD, struct omap_lcd_config);
67 omapfb_config.lcd = *conf;
69 return platform_device_register(&omap_fb_device);
72 arch_initcall(omap_init_fb);
76 void omapfb_reserve_mem(void) {}