]> git.sur5r.net Git - u-boot/commitdiff
video: atmel_hlcdfb: enable dcache support
authorWu, Josh <Josh.wu@atmel.com>
Mon, 19 May 2014 11:51:27 +0000 (19:51 +0800)
committerAndreas Bießmann <andreas.devel@googlemail.com>
Sat, 14 Jun 2014 16:07:02 +0000 (18:07 +0200)
To support dcache, we need flush DMA descriptor buffer before enable lcd
DMA.

Also we need call lcd_set_flush_dcache(1) to make lcd driver flush the
lcd buffer if there is any change.

Cc: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Josh Wu <josh.wu@atmel.com>
Acked-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
drivers/video/atmel_hlcdfb.c

index bb4d7d8c1471ad9ca79b203ad4cc7cc03c673c01..935ae42a9c873904ff8e7a174332438fe5d7d34c 100644 (file)
@@ -171,6 +171,9 @@ void lcd_ctrl_init(void *lcdbase)
                        | LCDC_BASECTRL_DMAIEN | LCDC_BASECTRL_DFETCH;
        desc->next = (u32)desc;
 
+       /* Flush the DMA descriptor if we enabled dcache */
+       flush_dcache_range((u32)desc, (u32)desc + sizeof(*desc));
+
        lcdc_writel(&regs->lcdc_baseaddr, desc->address);
        lcdc_writel(&regs->lcdc_basectrl, desc->control);
        lcdc_writel(&regs->lcdc_basenext, desc->next);
@@ -194,4 +197,7 @@ void lcd_ctrl_init(void *lcdbase)
        lcdc_writel(&regs->lcdc_lcden, value | LCDC_LCDEN_PWMEN);
        while (!(lcdc_readl(&regs->lcdc_lcdsr) & LCDC_LCDSR_PWMSTS))
                udelay(1);
+
+       /* Enable flushing if we enabled dcache */
+       lcd_set_flush_dcache(1);
 }