summaryrefslogtreecommitdiff
path: root/drivers/video/atmel_hlcdfb.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2017-06-10 09:48:09 -0400
committerTom Rini <trini@konsulko.com>2017-06-10 09:48:09 -0400
commitd2e1ee686ab16c022d1a3049a35b4ce89a25d34e (patch)
tree8cacb796cda155844349ebd6ff68935dcc8e2042 /drivers/video/atmel_hlcdfb.c
parent75fd49c836d9a1750c9b6d86c0511b990fbe9fa8 (diff)
parent76a5e1b7156d16fec3dfa17c5135b28d4d657f0e (diff)
Merge branch 'master' of git://git.denx.de/u-boot-video
Diffstat (limited to 'drivers/video/atmel_hlcdfb.c')
-rw-r--r--drivers/video/atmel_hlcdfb.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/video/atmel_hlcdfb.c b/drivers/video/atmel_hlcdfb.c
index 47078fdaae..f77da2ec97 100644
--- a/drivers/video/atmel_hlcdfb.c
+++ b/drivers/video/atmel_hlcdfb.c
@@ -426,7 +426,9 @@ static void atmel_hlcdc_init(struct udevice *dev)
writel(~0UL, &regs->lcdc_baseidr);
/* Setup the DMA descriptor, this descriptor will loop to itself */
- desc = (struct lcd_dma_desc *)(uc_plat->base - 16);
+ desc = memalign(CONFIG_SYS_CACHELINE_SIZE, sizeof(*desc));
+ if (!desc)
+ return;
desc->address = (u32)uc_plat->base;
@@ -436,7 +438,9 @@ static void atmel_hlcdc_init(struct udevice *dev)
desc->next = (u32)desc;
/* Flush the DMA descriptor if we enabled dcache */
- flush_dcache_range((u32)desc, (u32)desc + sizeof(*desc));
+ flush_dcache_range((u32)desc,
+ ALIGN(((u32)desc + sizeof(*desc)),
+ CONFIG_SYS_CACHELINE_SIZE));
writel(desc->address, &regs->lcdc_baseaddr);
writel(desc->control, &regs->lcdc_basectrl);