Skip to content

Commit 9089870

Browse files
Nicolas Ferretorvalds
authored andcommitted
atmel_lcdfb: fix initialization of a pre-allocated framebuffer
Fix initialization of framebuffer not calling ioremap_writecombine() function and not using internal SRAM for at91sam9rl. This is a little rework of the "Don't initialize a pre-allocated framebuffer" patch that corrects the call to ioremap_writecombine() function. It also cuts the use of internal SRAM for at91sam9rl : it is a bit small for a framebuffer. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: Andrew Victor <linux@maxim.org.za> Cc: Haavard Skinnemoen <hskinnemoen@atmel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 3ef0f72 commit 9089870

File tree

2 files changed

+2
-23
lines changed

2 files changed

+2
-23
lines changed

arch/arm/mach-at91/at91sam9261_devices.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,10 +544,10 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data)
544544
struct resource *fb_res = &lcdc_resources[2];
545545
size_t fb_len = fb_res->end - fb_res->start + 1;
546546

547-
fb = ioremap_writecombine(fb_res->start, fb_len);
547+
fb = ioremap(fb_res->start, fb_len);
548548
if (fb) {
549549
memset(fb, 0, fb_len);
550-
iounmap(fb, fb_len);
550+
iounmap(fb);
551551
}
552552
}
553553
lcdc_data = *data;

arch/arm/mach-at91/at91sam9rl_devices.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -332,13 +332,6 @@ static struct resource lcdc_resources[] = {
332332
.end = AT91SAM9RL_ID_LCDC,
333333
.flags = IORESOURCE_IRQ,
334334
},
335-
#if defined(CONFIG_FB_INTSRAM)
336-
[2] = {
337-
.start = AT91SAM9RL_SRAM_BASE,
338-
.end = AT91SAM9RL_SRAM_BASE + AT91SAM9RL_SRAM_SIZE - 1,
339-
.flags = IORESOURCE_MEM,
340-
},
341-
#endif
342335
};
343336

344337
static struct platform_device at91_lcdc_device = {
@@ -381,20 +374,6 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data)
381374
at91_set_B_periph(AT91_PIN_PC24, 0); /* LCDD22 */
382375
at91_set_B_periph(AT91_PIN_PC25, 0); /* LCDD23 */
383376

384-
#ifdef CONFIG_FB_INTSRAM
385-
{
386-
void __iomem *fb;
387-
struct resource *fb_res = &lcdc_resources[2];
388-
size_t fb_len = fb_res->end - fb_res->start + 1;
389-
390-
fb = ioremap_writecombine(fb_res->start, fb_len);
391-
if (fb) {
392-
memset(fb, 0, fb_len);
393-
iounmap(fb, fb_len);
394-
}
395-
}
396-
#endif
397-
398377
lcdc_data = *data;
399378
platform_device_register(&at91_lcdc_device);
400379
}

0 commit comments

Comments
 (0)