[U-Boot] [PATCH 14/17] tegra: Support control of cache settings for LCD

Simon Glass sjg at chromium.org
Sun Jan 15 01:47:26 CET 2012


Add support for selecting the required cache mode for the LCD:
off, write-through or write-back.

Signed-off-by: Simon Glass <sjg at chromium.org>
---
 drivers/video/tegra.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/video/tegra.c b/drivers/video/tegra.c
index 7622d2d..f244cc1 100644
--- a/drivers/video/tegra.c
+++ b/drivers/video/tegra.c
@@ -175,6 +175,15 @@ void lcd_ctrl_init(void *lcdbase)
 		return;
 	}
 
+	/* For write-through or cache off, change the LCD memory region */
+	if (!(config.cache_type & FDT_LCD_CACHE_WRITE_BACK))
+		mmu_set_region_dcache(config.frame_buffer, size,
+			config.cache_type & FDT_LCD_CACHE_WRITE_THROUGH ?
+				DCACHE_WRITETHROUGH : DCACHE_OFF);
+
+	/* Enable flushing after LCD writes if requested */
+	lcd_set_flush_dcache(config.cache_type & FDT_LCD_CACHE_FLUSH);
+
 	debug("LCD frame buffer at %p\n", lcd_base);
 }
 
-- 
1.7.7.3



More information about the U-Boot mailing list