1 #include <linux/module.h>
2 #include <linux/kernel.h>
3 #include <linux/init.h>
4 #include <linux/platform_device.h>
5 #include <linux/bootmem.h>
7 #include <asm/hardware.h>
9 #include <asm/mach-types.h>
10 #include <asm/mach/map.h>
12 #include <asm/arch/board.h>
13 #include <asm/arch/sram.h>
14 #include <asm/arch/omapfb.h>
16 #if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE)
18 static struct omapfb_platform_data omapfb_config
;
20 static u64 omap_fb_dma_mask
= ~(u32
)0;
22 static struct platform_device omap_fb_device
= {
26 .dma_mask
= &omap_fb_dma_mask
,
27 .coherent_dma_mask
= ~(u32
)0,
28 .platform_data
= &omapfb_config
,
33 /* called from map_io */
34 void omapfb_reserve_mem(void)
36 const struct omap_fbmem_config
*fbmem_conf
;
38 omapfb_config
.fbmem
.fb_sram_start
= omap_fb_sram_start
;
39 omapfb_config
.fbmem
.fb_sram_size
= omap_fb_sram_size
;
41 fbmem_conf
= omap_get_config(OMAP_TAG_FBMEM
, struct omap_fbmem_config
);
43 if (fbmem_conf
!= NULL
) {
44 /* indicate that the bootloader already initialized the
45 * fb device, so we'll skip that part in the fb driver
47 omapfb_config
.fbmem
.fb_sdram_start
= fbmem_conf
->fb_sdram_start
;
48 omapfb_config
.fbmem
.fb_sdram_size
= fbmem_conf
->fb_sdram_size
;
49 if (fbmem_conf
->fb_sdram_size
) {
50 pr_info("Reserving %u bytes SDRAM for frame buffer\n",
51 fbmem_conf
->fb_sdram_size
);
52 reserve_bootmem(fbmem_conf
->fb_sdram_start
,
53 fbmem_conf
->fb_sdram_size
);
58 static inline int omap_init_fb(void)
60 const struct omap_lcd_config
*conf
;
62 conf
= omap_get_config(OMAP_TAG_LCD
, struct omap_lcd_config
);
66 omapfb_config
.lcd
= *conf
;
68 return platform_device_register(&omap_fb_device
);
71 arch_initcall(omap_init_fb
);
75 void omapfb_reserve_mem(void) {}