Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 1 | /* |
| 2 | * File: arch/arm/plat-omap/fb.c |
| 3 | * |
| 4 | * Framebuffer device registration for TI OMAP platforms |
| 5 | * |
| 6 | * Copyright (C) 2006 Nokia Corporation |
| 7 | * Author: Imre Deak <imre.deak@nokia.com> |
| 8 | * |
| 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. |
| 13 | * |
| 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. |
| 18 | * |
| 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. |
| 22 | */ |
| 23 | |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 24 | #include <linux/module.h> |
| 25 | #include <linux/kernel.h> |
Andrea Righi | 27ac792 | 2008-07-23 21:28:13 -0700 | [diff] [blame] | 26 | #include <linux/mm.h> |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 27 | #include <linux/init.h> |
| 28 | #include <linux/platform_device.h> |
Russell King | 98864ff | 2010-05-22 23:59:11 +0100 | [diff] [blame] | 29 | #include <linux/memblock.h> |
Russell King | fced80c | 2008-09-06 12:10:45 +0100 | [diff] [blame] | 30 | #include <linux/io.h> |
Tomi Valkeinen | 91773a0 | 2009-08-03 15:06:36 +0300 | [diff] [blame] | 31 | #include <linux/omapfb.h> |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 32 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 33 | #include <mach/hardware.h> |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 34 | #include <asm/mach/map.h> |
| 35 | |
Tony Lindgren | ce491cf | 2009-10-20 09:40:47 -0700 | [diff] [blame] | 36 | #include <plat/board.h> |
| 37 | #include <plat/sram.h> |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 38 | |
Manjunath Kondaiah G | b0a330d | 2010-10-08 10:00:19 -0700 | [diff] [blame] | 39 | #include "fb.h" |
| 40 | |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 41 | #if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE) |
| 42 | |
| 43 | static struct omapfb_platform_data omapfb_config; |
Imre Deak | b7cc6d4 | 2007-03-06 03:16:36 -0800 | [diff] [blame] | 44 | static int config_invalid; |
| 45 | static int configured_regions; |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 46 | |
| 47 | static u64 omap_fb_dma_mask = ~(u32)0; |
| 48 | |
| 49 | static struct platform_device omap_fb_device = { |
| 50 | .name = "omapfb", |
| 51 | .id = -1, |
| 52 | .dev = { |
| 53 | .dma_mask = &omap_fb_dma_mask, |
| 54 | .coherent_dma_mask = ~(u32)0, |
| 55 | .platform_data = &omapfb_config, |
| 56 | }, |
| 57 | .num_resources = 0, |
| 58 | }; |
| 59 | |
Tomi Valkeinen | b39a982d | 2009-08-04 16:12:50 +0300 | [diff] [blame] | 60 | void omapfb_set_platform_data(struct omapfb_platform_data *data) |
| 61 | { |
| 62 | } |
| 63 | |
Imre Deak | b7cc6d4 | 2007-03-06 03:16:36 -0800 | [diff] [blame] | 64 | static inline int ranges_overlap(unsigned long start1, unsigned long size1, |
| 65 | unsigned long start2, unsigned long size2) |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 66 | { |
Imre Deak | b7cc6d4 | 2007-03-06 03:16:36 -0800 | [diff] [blame] | 67 | return (start1 >= start2 && start1 < start2 + size2) || |
| 68 | (start2 >= start1 && start2 < start1 + size1); |
| 69 | } |
| 70 | |
| 71 | static inline int range_included(unsigned long start1, unsigned long size1, |
| 72 | unsigned long start2, unsigned long size2) |
| 73 | { |
| 74 | return start1 >= start2 && start1 + size1 <= start2 + size2; |
| 75 | } |
| 76 | |
| 77 | |
| 78 | /* Check if there is an overlapping region. */ |
| 79 | static int fbmem_region_reserved(unsigned long start, size_t size) |
| 80 | { |
| 81 | struct omapfb_mem_region *rg; |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 82 | int i; |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 83 | |
Imre Deak | b7cc6d4 | 2007-03-06 03:16:36 -0800 | [diff] [blame] | 84 | rg = &omapfb_config.mem_desc.region[0]; |
| 85 | for (i = 0; i < OMAPFB_PLANE_NUM; i++, rg++) { |
| 86 | if (!rg->paddr) |
| 87 | /* Empty slot. */ |
| 88 | continue; |
| 89 | if (ranges_overlap(start, size, rg->paddr, rg->size)) |
| 90 | return 1; |
| 91 | } |
| 92 | return 0; |
| 93 | } |
| 94 | |
| 95 | /* |
| 96 | * Get the region_idx`th region from board config/ATAG and convert it to |
| 97 | * our internal format. |
| 98 | */ |
Uwe Kleine-König | 9dbb7a5 | 2010-09-02 10:03:40 +0200 | [diff] [blame] | 99 | static int __init get_fbmem_region(int region_idx, struct omapfb_mem_region *rg) |
Imre Deak | b7cc6d4 | 2007-03-06 03:16:36 -0800 | [diff] [blame] | 100 | { |
| 101 | const struct omap_fbmem_config *conf; |
| 102 | u32 paddr; |
| 103 | |
| 104 | conf = omap_get_nr_config(OMAP_TAG_FBMEM, |
| 105 | struct omap_fbmem_config, region_idx); |
| 106 | if (conf == NULL) |
| 107 | return -ENOENT; |
| 108 | |
| 109 | paddr = conf->start; |
| 110 | /* |
| 111 | * Low bits encode the page allocation mode, if high bits |
| 112 | * are zero. Otherwise we need a page aligned fixed |
| 113 | * address. |
| 114 | */ |
| 115 | memset(rg, 0, sizeof(*rg)); |
| 116 | rg->type = paddr & ~PAGE_MASK; |
| 117 | rg->paddr = paddr & PAGE_MASK; |
| 118 | rg->size = PAGE_ALIGN(conf->size); |
| 119 | return 0; |
| 120 | } |
| 121 | |
| 122 | static int set_fbmem_region_type(struct omapfb_mem_region *rg, int mem_type, |
| 123 | unsigned long mem_start, |
| 124 | unsigned long mem_size) |
| 125 | { |
| 126 | /* |
| 127 | * Check if the configuration specifies the type explicitly. |
| 128 | * type = 0 && paddr = 0, a default don't care case maps to |
| 129 | * the SDRAM type. |
| 130 | */ |
Nicolas Kaiser | e1a75a1 | 2010-10-05 20:31:54 +0200 | [diff] [blame] | 131 | if (rg->type || !rg->paddr) |
Imre Deak | b7cc6d4 | 2007-03-06 03:16:36 -0800 | [diff] [blame] | 132 | return 0; |
| 133 | if (ranges_overlap(rg->paddr, rg->size, mem_start, mem_size)) { |
| 134 | rg->type = mem_type; |
| 135 | return 0; |
| 136 | } |
| 137 | /* Can't determine it. */ |
| 138 | return -1; |
| 139 | } |
| 140 | |
| 141 | static int check_fbmem_region(int region_idx, struct omapfb_mem_region *rg, |
| 142 | unsigned long start_avail, unsigned size_avail) |
| 143 | { |
| 144 | unsigned long paddr = rg->paddr; |
| 145 | size_t size = rg->size; |
| 146 | |
| 147 | if (rg->type > OMAPFB_MEMTYPE_MAX) { |
| 148 | printk(KERN_ERR |
| 149 | "Invalid start address for FB region %d\n", region_idx); |
| 150 | return -EINVAL; |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 151 | } |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 152 | |
Imre Deak | b7cc6d4 | 2007-03-06 03:16:36 -0800 | [diff] [blame] | 153 | if (!rg->size) { |
| 154 | printk(KERN_ERR "Zero size for FB region %d\n", region_idx); |
| 155 | return -EINVAL; |
| 156 | } |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 157 | |
Imre Deak | b7cc6d4 | 2007-03-06 03:16:36 -0800 | [diff] [blame] | 158 | if (!paddr) |
| 159 | /* Allocate this dynamically, leave paddr 0 for now. */ |
| 160 | return 0; |
| 161 | |
| 162 | /* |
| 163 | * Fixed region for the given RAM range. Check if it's already |
| 164 | * reserved by the FB code or someone else. |
| 165 | */ |
| 166 | if (fbmem_region_reserved(paddr, size) || |
| 167 | !range_included(paddr, size, start_avail, size_avail)) { |
| 168 | printk(KERN_ERR "Trying to use reserved memory " |
| 169 | "for FB region %d\n", region_idx); |
| 170 | return -EINVAL; |
| 171 | } |
| 172 | |
| 173 | return 0; |
| 174 | } |
| 175 | |
Russell King | a1af0fb | 2010-05-22 23:53:45 +0100 | [diff] [blame] | 176 | static int valid_sdram(unsigned long addr, unsigned long size) |
| 177 | { |
Yinghai Lu | 5fd03dd | 2010-10-05 21:28:10 -0700 | [diff] [blame] | 178 | return memblock_is_region_memory(addr, size); |
Russell King | a1af0fb | 2010-05-22 23:53:45 +0100 | [diff] [blame] | 179 | } |
| 180 | |
| 181 | static int reserve_sdram(unsigned long addr, unsigned long size) |
| 182 | { |
Russell King | 98864ff | 2010-05-22 23:59:11 +0100 | [diff] [blame] | 183 | if (memblock_is_region_reserved(addr, size)) |
| 184 | return -EBUSY; |
| 185 | if (memblock_reserve(addr, size)) |
| 186 | return -ENOMEM; |
| 187 | return 0; |
Russell King | a1af0fb | 2010-05-22 23:53:45 +0100 | [diff] [blame] | 188 | } |
| 189 | |
Imre Deak | b7cc6d4 | 2007-03-06 03:16:36 -0800 | [diff] [blame] | 190 | /* |
| 191 | * 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. |
| 193 | */ |
Russell King | 98864ff | 2010-05-22 23:59:11 +0100 | [diff] [blame] | 194 | void __init omapfb_reserve_sdram_memblock(void) |
Imre Deak | b7cc6d4 | 2007-03-06 03:16:36 -0800 | [diff] [blame] | 195 | { |
Russell King | a1af0fb | 2010-05-22 23:53:45 +0100 | [diff] [blame] | 196 | unsigned long reserved = 0; |
| 197 | int i; |
Imre Deak | b7cc6d4 | 2007-03-06 03:16:36 -0800 | [diff] [blame] | 198 | |
| 199 | if (config_invalid) |
| 200 | return; |
| 201 | |
Imre Deak | b7cc6d4 | 2007-03-06 03:16:36 -0800 | [diff] [blame] | 202 | for (i = 0; ; i++) { |
Russell King | a1af0fb | 2010-05-22 23:53:45 +0100 | [diff] [blame] | 203 | struct omapfb_mem_region rg; |
Imre Deak | b7cc6d4 | 2007-03-06 03:16:36 -0800 | [diff] [blame] | 204 | |
| 205 | if (get_fbmem_region(i, &rg) < 0) |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 206 | break; |
Russell King | a1af0fb | 2010-05-22 23:53:45 +0100 | [diff] [blame] | 207 | |
Imre Deak | b7cc6d4 | 2007-03-06 03:16:36 -0800 | [diff] [blame] | 208 | if (i == OMAPFB_PLANE_NUM) { |
Russell King | a1af0fb | 2010-05-22 23:53:45 +0100 | [diff] [blame] | 209 | pr_err("Extraneous FB mem configuration entries\n"); |
Imre Deak | b7cc6d4 | 2007-03-06 03:16:36 -0800 | [diff] [blame] | 210 | config_invalid = 1; |
| 211 | return; |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 212 | } |
Russell King | a1af0fb | 2010-05-22 23:53:45 +0100 | [diff] [blame] | 213 | |
Imre Deak | b7cc6d4 | 2007-03-06 03:16:36 -0800 | [diff] [blame] | 214 | /* Check if it's our memory type. */ |
Russell King | a1af0fb | 2010-05-22 23:53:45 +0100 | [diff] [blame] | 215 | if (rg.type != OMAPFB_MEMTYPE_SDRAM) |
Imre Deak | b7cc6d4 | 2007-03-06 03:16:36 -0800 | [diff] [blame] | 216 | continue; |
Russell King | a1af0fb | 2010-05-22 23:53:45 +0100 | [diff] [blame] | 217 | |
| 218 | /* Check if the region falls within SDRAM */ |
| 219 | if (rg.paddr && !valid_sdram(rg.paddr, rg.size)) |
| 220 | continue; |
| 221 | |
| 222 | if (rg.size == 0) { |
| 223 | pr_err("Zero size for FB region %d\n", i); |
Imre Deak | b7cc6d4 | 2007-03-06 03:16:36 -0800 | [diff] [blame] | 224 | config_invalid = 1; |
| 225 | return; |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 226 | } |
Russell King | a1af0fb | 2010-05-22 23:53:45 +0100 | [diff] [blame] | 227 | |
Tomi Valkeinen | 72af2b3 | 2009-05-11 09:58:19 -0700 | [diff] [blame] | 228 | if (rg.paddr) { |
Russell King | a1af0fb | 2010-05-22 23:53:45 +0100 | [diff] [blame] | 229 | if (reserve_sdram(rg.paddr, rg.size)) { |
| 230 | pr_err("Trying to use reserved memory for FB region %d\n", |
| 231 | i); |
| 232 | config_invalid = 1; |
| 233 | return; |
| 234 | } |
Tomi Valkeinen | 72af2b3 | 2009-05-11 09:58:19 -0700 | [diff] [blame] | 235 | reserved += rg.size; |
| 236 | } |
Russell King | a1af0fb | 2010-05-22 23:53:45 +0100 | [diff] [blame] | 237 | |
| 238 | if (omapfb_config.mem_desc.region[i].size) { |
| 239 | pr_err("FB region %d already set\n", i); |
| 240 | config_invalid = 1; |
| 241 | return; |
| 242 | } |
| 243 | |
Imre Deak | b7cc6d4 | 2007-03-06 03:16:36 -0800 | [diff] [blame] | 244 | omapfb_config.mem_desc.region[i] = rg; |
| 245 | configured_regions++; |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 246 | } |
| 247 | omapfb_config.mem_desc.region_cnt = i; |
Imre Deak | b7cc6d4 | 2007-03-06 03:16:36 -0800 | [diff] [blame] | 248 | if (reserved) |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 249 | pr_info("Reserving %lu bytes SDRAM for frame buffer\n", |
Imre Deak | b7cc6d4 | 2007-03-06 03:16:36 -0800 | [diff] [blame] | 250 | reserved); |
| 251 | } |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 252 | |
Imre Deak | b7cc6d4 | 2007-03-06 03:16:36 -0800 | [diff] [blame] | 253 | /* |
| 254 | * Called at sram init time, before anything is pushed to the SRAM stack. |
| 255 | * Because of the stack scheme, we will allocate everything from the |
| 256 | * start of the lowest address region to the end of SRAM. This will also |
| 257 | * include padding for page alignment and possible holes between regions. |
| 258 | * |
| 259 | * As opposed to the SDRAM case, we'll also do any dynamic allocations at |
| 260 | * this point, since the driver built as a module would have problem with |
| 261 | * freeing / reallocating the regions. |
| 262 | */ |
Uwe Kleine-König | e92840b | 2010-09-02 10:03:39 +0200 | [diff] [blame] | 263 | unsigned long __init omapfb_reserve_sram(unsigned long sram_pstart, |
Imre Deak | b7cc6d4 | 2007-03-06 03:16:36 -0800 | [diff] [blame] | 264 | unsigned long sram_vstart, |
| 265 | unsigned long sram_size, |
| 266 | unsigned long pstart_avail, |
| 267 | unsigned long size_avail) |
| 268 | { |
| 269 | struct omapfb_mem_region rg; |
| 270 | unsigned long pend_avail; |
| 271 | unsigned long reserved; |
| 272 | int i; |
| 273 | |
| 274 | if (config_invalid) |
| 275 | return 0; |
| 276 | |
| 277 | reserved = 0; |
| 278 | pend_avail = pstart_avail + size_avail; |
| 279 | for (i = 0; ; i++) { |
| 280 | if (get_fbmem_region(i, &rg) < 0) |
| 281 | break; |
| 282 | if (i == OMAPFB_PLANE_NUM) { |
| 283 | printk(KERN_ERR |
| 284 | "Extraneous FB mem configuration entries\n"); |
| 285 | config_invalid = 1; |
| 286 | return 0; |
| 287 | } |
| 288 | |
| 289 | /* Check if it's our memory type. */ |
| 290 | if (set_fbmem_region_type(&rg, OMAPFB_MEMTYPE_SRAM, |
| 291 | sram_pstart, sram_size) < 0 || |
| 292 | (rg.type != OMAPFB_MEMTYPE_SRAM)) |
| 293 | continue; |
| 294 | BUG_ON(omapfb_config.mem_desc.region[i].size); |
| 295 | |
| 296 | if (check_fbmem_region(i, &rg, pstart_avail, size_avail) < 0) { |
| 297 | config_invalid = 1; |
| 298 | return 0; |
| 299 | } |
| 300 | |
| 301 | if (!rg.paddr) { |
| 302 | /* Dynamic allocation */ |
| 303 | if ((size_avail & PAGE_MASK) < rg.size) { |
| 304 | printk("Not enough SRAM for FB region %d\n", |
| 305 | i); |
| 306 | config_invalid = 1; |
| 307 | return 0; |
| 308 | } |
| 309 | size_avail = (size_avail - rg.size) & PAGE_MASK; |
| 310 | rg.paddr = pstart_avail + size_avail; |
| 311 | } |
| 312 | /* Reserve everything above the start of the region. */ |
| 313 | if (pend_avail - rg.paddr > reserved) |
| 314 | reserved = pend_avail - rg.paddr; |
| 315 | size_avail = pend_avail - reserved - pstart_avail; |
| 316 | |
| 317 | /* |
| 318 | * We have a kernel mapping for this already, so the |
| 319 | * driver won't have to make one. |
| 320 | */ |
| 321 | rg.vaddr = (void *)(sram_vstart + rg.paddr - sram_pstart); |
| 322 | omapfb_config.mem_desc.region[i] = rg; |
| 323 | configured_regions++; |
| 324 | } |
| 325 | omapfb_config.mem_desc.region_cnt = i; |
| 326 | if (reserved) |
| 327 | pr_info("Reserving %lu bytes SRAM for frame buffer\n", |
| 328 | reserved); |
| 329 | return reserved; |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 330 | } |
| 331 | |
Imre Deak | 771af22 | 2006-12-06 17:13:50 -0800 | [diff] [blame] | 332 | void omapfb_set_ctrl_platform_data(void *data) |
| 333 | { |
| 334 | omapfb_config.ctrl_platform_data = data; |
| 335 | } |
| 336 | |
Uwe Kleine-König | 375c324 | 2010-09-02 10:03:38 +0200 | [diff] [blame] | 337 | static int __init omap_init_fb(void) |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 338 | { |
| 339 | const struct omap_lcd_config *conf; |
| 340 | |
Imre Deak | b7cc6d4 | 2007-03-06 03:16:36 -0800 | [diff] [blame] | 341 | if (config_invalid) |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 342 | return 0; |
Imre Deak | b7cc6d4 | 2007-03-06 03:16:36 -0800 | [diff] [blame] | 343 | if (configured_regions != omapfb_config.mem_desc.region_cnt) { |
| 344 | printk(KERN_ERR "Invalid FB mem configuration entries\n"); |
| 345 | return 0; |
| 346 | } |
| 347 | conf = omap_get_config(OMAP_TAG_LCD, struct omap_lcd_config); |
| 348 | if (conf == NULL) { |
| 349 | if (configured_regions) |
| 350 | /* FB mem config, but no LCD config? */ |
| 351 | printk(KERN_ERR "Missing LCD configuration\n"); |
| 352 | return 0; |
| 353 | } |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 354 | omapfb_config.lcd = *conf; |
| 355 | |
| 356 | return platform_device_register(&omap_fb_device); |
| 357 | } |
| 358 | |
| 359 | arch_initcall(omap_init_fb); |
| 360 | |
Tomi Valkeinen | b39a982d | 2009-08-04 16:12:50 +0300 | [diff] [blame] | 361 | #elif defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) |
| 362 | |
| 363 | static u64 omap_fb_dma_mask = ~(u32)0; |
| 364 | static struct omapfb_platform_data omapfb_config; |
| 365 | |
| 366 | static struct platform_device omap_fb_device = { |
| 367 | .name = "omapfb", |
| 368 | .id = -1, |
| 369 | .dev = { |
| 370 | .dma_mask = &omap_fb_dma_mask, |
| 371 | .coherent_dma_mask = ~(u32)0, |
| 372 | .platform_data = &omapfb_config, |
| 373 | }, |
| 374 | .num_resources = 0, |
| 375 | }; |
| 376 | |
| 377 | void omapfb_set_platform_data(struct omapfb_platform_data *data) |
| 378 | { |
| 379 | omapfb_config = *data; |
| 380 | } |
| 381 | |
Uwe Kleine-König | 375c324 | 2010-09-02 10:03:38 +0200 | [diff] [blame] | 382 | static int __init omap_init_fb(void) |
Tomi Valkeinen | b39a982d | 2009-08-04 16:12:50 +0300 | [diff] [blame] | 383 | { |
| 384 | return platform_device_register(&omap_fb_device); |
| 385 | } |
| 386 | |
| 387 | arch_initcall(omap_init_fb); |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 388 | |
Russell King | 98864ff | 2010-05-22 23:59:11 +0100 | [diff] [blame] | 389 | void omapfb_reserve_sdram_memblock(void) |
| 390 | { |
| 391 | } |
| 392 | |
Uwe Kleine-König | e92840b | 2010-09-02 10:03:39 +0200 | [diff] [blame] | 393 | unsigned long __init omapfb_reserve_sram(unsigned long sram_pstart, |
Imre Deak | b7cc6d4 | 2007-03-06 03:16:36 -0800 | [diff] [blame] | 394 | unsigned long sram_vstart, |
| 395 | unsigned long sram_size, |
| 396 | unsigned long start_avail, |
David Brownell | cc150b0 | 2007-03-28 16:38:14 -0700 | [diff] [blame] | 397 | unsigned long size_avail) |
| 398 | { |
| 399 | return 0; |
| 400 | } |
Imre Deak | b7cc6d4 | 2007-03-06 03:16:36 -0800 | [diff] [blame] | 401 | |
Tomi Valkeinen | b39a982d | 2009-08-04 16:12:50 +0300 | [diff] [blame] | 402 | #else |
| 403 | |
| 404 | void omapfb_set_platform_data(struct omapfb_platform_data *data) |
| 405 | { |
| 406 | } |
| 407 | |
Russell King | 98864ff | 2010-05-22 23:59:11 +0100 | [diff] [blame] | 408 | void omapfb_reserve_sdram_memblock(void) |
| 409 | { |
| 410 | } |
| 411 | |
Uwe Kleine-König | e92840b | 2010-09-02 10:03:39 +0200 | [diff] [blame] | 412 | unsigned long __init omapfb_reserve_sram(unsigned long sram_pstart, |
Tomi Valkeinen | b39a982d | 2009-08-04 16:12:50 +0300 | [diff] [blame] | 413 | unsigned long sram_vstart, |
| 414 | unsigned long sram_size, |
| 415 | unsigned long start_avail, |
| 416 | unsigned long size_avail) |
| 417 | { |
| 418 | return 0; |
| 419 | } |
Tony Lindgren | 0dc5e77 | 2006-04-02 17:46:26 +0100 | [diff] [blame] | 420 | |
| 421 | #endif |