2 * File: arch/arm/plat-omap/fb.c
4 * Framebuffer device registration for TI OMAP platforms
6 * Copyright (C) 2006 Nokia Corporation
7 * Author: Imre Deak <imre.deak@nokia.com>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 #include <linux/module.h>
25 #include <linux/kernel.h>
26 #include <linux/init.h>
27 #include <linux/platform_device.h>
28 #include <linux/bootmem.h>
30 #include <asm/hardware.h>
32 #include <asm/mach-types.h>
33 #include <asm/mach/map.h>
35 #include <asm/arch/board.h>
36 #include <asm/arch/sram.h>
37 #include <asm/arch/omapfb.h>
39 #if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE)
41 static struct omapfb_platform_data omapfb_config;
43 static u64 omap_fb_dma_mask = ~(u32)0;
45 static struct platform_device omap_fb_device = {
49 .dma_mask = &omap_fb_dma_mask,
50 .coherent_dma_mask = ~(u32)0,
51 .platform_data = &omapfb_config,
56 /* called from map_io */
57 void omapfb_reserve_mem(void)
59 const struct omap_fbmem_config *fbmem_conf;
60 unsigned long total_size;
63 if (!omap_fb_sram_valid) {
64 /* FBMEM SRAM configuration was already found to be invalid.
65 * Ignore the whole configuration block. */
66 omapfb_config.mem_desc.region_cnt = 0;
72 while ((fbmem_conf = omap_get_nr_config(OMAP_TAG_FBMEM,
73 struct omap_fbmem_config, i)) != NULL) {
77 if (i == OMAPFB_PLANE_NUM) {
78 printk(KERN_ERR "ignoring extra plane info\n");
81 start = fbmem_conf->start;
82 size = fbmem_conf->size;
83 omapfb_config.mem_desc.region[i].paddr = start;
84 omapfb_config.mem_desc.region[i].size = size;
85 if (omap_fb_sram_plane != i && start) {
86 reserve_bootmem(start, size);
91 omapfb_config.mem_desc.region_cnt = i;
93 pr_info("Reserving %lu bytes SDRAM for frame buffer\n",
98 void omapfb_set_ctrl_platform_data(void *data)
100 omapfb_config.ctrl_platform_data = data;
103 static inline int omap_init_fb(void)
105 const struct omap_lcd_config *conf;
107 conf = omap_get_config(OMAP_TAG_LCD, struct omap_lcd_config);
111 omapfb_config.lcd = *conf;
113 return platform_device_register(&omap_fb_device);
116 arch_initcall(omap_init_fb);
120 void omapfb_reserve_mem(void) {}