diff options
Diffstat (limited to 'arch/arm/mach-realview/core.c')
-rw-r--r-- | arch/arm/mach-realview/core.c | 45 |
1 files changed, 40 insertions, 5 deletions
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c index 702d81549c9..df5e67708c6 100644 --- a/arch/arm/mach-realview/core.c +++ b/arch/arm/mach-realview/core.c | |||
@@ -236,6 +236,29 @@ static struct clcd_panel vga = { | |||
236 | .bpp = 16, | 236 | .bpp = 16, |
237 | }; | 237 | }; |
238 | 238 | ||
239 | static struct clcd_panel xvga = { | ||
240 | .mode = { | ||
241 | .name = "XVGA", | ||
242 | .refresh = 60, | ||
243 | .xres = 1024, | ||
244 | .yres = 768, | ||
245 | .pixclock = 15748, | ||
246 | .left_margin = 152, | ||
247 | .right_margin = 48, | ||
248 | .upper_margin = 23, | ||
249 | .lower_margin = 3, | ||
250 | .hsync_len = 104, | ||
251 | .vsync_len = 4, | ||
252 | .sync = 0, | ||
253 | .vmode = FB_VMODE_NONINTERLACED, | ||
254 | }, | ||
255 | .width = -1, | ||
256 | .height = -1, | ||
257 | .tim2 = TIM2_BCD | TIM2_IPC, | ||
258 | .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1), | ||
259 | .bpp = 16, | ||
260 | }; | ||
261 | |||
239 | static struct clcd_panel sanyo_3_8_in = { | 262 | static struct clcd_panel sanyo_3_8_in = { |
240 | .mode = { | 263 | .mode = { |
241 | .name = "Sanyo QVGA", | 264 | .name = "Sanyo QVGA", |
@@ -314,9 +337,15 @@ static struct clcd_panel epson_2_2_in = { | |||
314 | static struct clcd_panel *realview_clcd_panel(void) | 337 | static struct clcd_panel *realview_clcd_panel(void) |
315 | { | 338 | { |
316 | void __iomem *sys_clcd = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_CLCD_OFFSET; | 339 | void __iomem *sys_clcd = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_CLCD_OFFSET; |
317 | struct clcd_panel *panel = &vga; | 340 | struct clcd_panel *vga_panel; |
341 | struct clcd_panel *panel; | ||
318 | u32 val; | 342 | u32 val; |
319 | 343 | ||
344 | if (machine_is_realview_eb()) | ||
345 | vga_panel = &vga; | ||
346 | else | ||
347 | vga_panel = &xvga; | ||
348 | |||
320 | val = readl(sys_clcd) & SYS_CLCD_ID_MASK; | 349 | val = readl(sys_clcd) & SYS_CLCD_ID_MASK; |
321 | if (val == SYS_CLCD_ID_SANYO_3_8) | 350 | if (val == SYS_CLCD_ID_SANYO_3_8) |
322 | panel = &sanyo_3_8_in; | 351 | panel = &sanyo_3_8_in; |
@@ -325,11 +354,11 @@ static struct clcd_panel *realview_clcd_panel(void) | |||
325 | else if (val == SYS_CLCD_ID_EPSON_2_2) | 354 | else if (val == SYS_CLCD_ID_EPSON_2_2) |
326 | panel = &epson_2_2_in; | 355 | panel = &epson_2_2_in; |
327 | else if (val == SYS_CLCD_ID_VGA) | 356 | else if (val == SYS_CLCD_ID_VGA) |
328 | panel = &vga; | 357 | panel = vga_panel; |
329 | else { | 358 | else { |
330 | printk(KERN_ERR "CLCD: unknown LCD panel ID 0x%08x, using VGA\n", | 359 | printk(KERN_ERR "CLCD: unknown LCD panel ID 0x%08x, using VGA\n", |
331 | val); | 360 | val); |
332 | panel = &vga; | 361 | panel = vga_panel; |
333 | } | 362 | } |
334 | 363 | ||
335 | return panel; | 364 | return panel; |
@@ -364,12 +393,18 @@ static void realview_clcd_enable(struct clcd_fb *fb) | |||
364 | writel(val, sys_clcd); | 393 | writel(val, sys_clcd); |
365 | } | 394 | } |
366 | 395 | ||
367 | static unsigned long framesize = SZ_1M; | ||
368 | |||
369 | static int realview_clcd_setup(struct clcd_fb *fb) | 396 | static int realview_clcd_setup(struct clcd_fb *fb) |
370 | { | 397 | { |
398 | unsigned long framesize; | ||
371 | dma_addr_t dma; | 399 | dma_addr_t dma; |
372 | 400 | ||
401 | if (machine_is_realview_eb()) | ||
402 | /* VGA, 16bpp */ | ||
403 | framesize = 640 * 480 * 2; | ||
404 | else | ||
405 | /* XVGA, 16bpp */ | ||
406 | framesize = 1024 * 768 * 2; | ||
407 | |||
373 | fb->panel = realview_clcd_panel(); | 408 | fb->panel = realview_clcd_panel(); |
374 | 409 | ||
375 | fb->fb.screen_base = dma_alloc_writecombine(&fb->dev->dev, framesize, | 410 | fb->fb.screen_base = dma_alloc_writecombine(&fb->dev->dev, framesize, |