Skip to contentSkip to conversation

video: atmel_hlcdfb: Fix misaligned cache operation warning

PATCH New Wenyou Yang 3 participants 3 messages Jun 2, 2017 – Jun 9, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 video: atmel_hlcdfb: Fix misaligned cache operation warning

Fix the warning,
---8<---
CACHE: Misaligned operation at range [3fdffff0, 3fdffffc]
---<8---

---

 drivers/video/atmel_hlcdfb.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/video/atmel_hlcdfb.c +6 -2
index 47078fdaae..f77da2ec97 100644
@@ -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);
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 video: atmel_hlcdfb: Fix misaligned cache operation warning

Quoted 10 lines · Wenyou Yang

Fix the warning,
---8<---
CACHE: Misaligned operation at range [3fdffff0, 3fdffffc]
---<8---

---

 drivers/video/atmel_hlcdfb.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
#2 lore raw

PATCH 1/1 video: atmel_hlcdfb: Fix misaligned cache operation warning

In reply to Wenyou Yang
Quoted 10 lines · On Fri, 2 Jun 2017 11:29:04 +0800 Wenyou Yang wenyou.yang at atmel.com wrote:

Fix the warning,
---8<---
CACHE: Misaligned operation at range [3fdffff0, 3fdffffc]
---<8---

---

 drivers/video/atmel_hlcdfb.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

applied to u-boot-video/master, thanks!

--
Anatolij