[U-Boot] [PATCH v1 4/6] video: fsl_dcu_fb: Update DCU layers for Vybrid

Sanchayan Maity maitysanchayan at gmail.com
Mon Feb 6 07:30:32 UTC 2017


From: Stefan Agner <stefan.agner at toradex.com>

Users control the graphical content of the panel by manipulating
configuration of elements in DCU4 called layers. The number of
layers is different for Vybrid and LS102XA SoC's. Update this
to reflect for LS102XA accordingly and for use with Vybrid.

Signed-off-by: Stefan Agner <stefan.agner at toradex.com>
Signed-off-by: Sanchayan Maity <maitysanchayan at gmail.com>
---
 arch/arm/include/asm/arch-ls102xa/config.h | 1 +
 drivers/video/fsl_dcu_fb.c                 | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/arch-ls102xa/config.h b/arch/arm/include/asm/arch-ls102xa/config.h
index 2f7233f2fe..7a909c88af 100644
--- a/arch/arm/include/asm/arch-ls102xa/config.h
+++ b/arch/arm/include/asm/arch-ls102xa/config.h
@@ -107,6 +107,7 @@
 #define CONFIG_SYS_FSL_SRK_LE
 
 #define DCU_LAYER_MAX_NUM			16
+#define DCU_TOTAL_LAYER_NUM			16
 
 #ifdef CONFIG_LS102XA
 #define CONFIG_USB_MAX_CONTROLLER_COUNT		1
diff --git a/drivers/video/fsl_dcu_fb.c b/drivers/video/fsl_dcu_fb.c
index c6fdedb5cf..22aba7ef48 100644
--- a/drivers/video/fsl_dcu_fb.c
+++ b/drivers/video/fsl_dcu_fb.c
@@ -178,7 +178,7 @@ static void reset_total_layers(void)
 	struct dcu_reg *regs = (struct dcu_reg *)CONFIG_SYS_DCU_ADDR;
 	int i;
 
-	for (i = 0; i < DCU_LAYER_MAX_NUM; i++) {
+	for (i = 0; i < DCU_TOTAL_LAYER_NUM; i++) {
 		dcu_write32(&regs->ctrldescl[i][0], 0);
 		dcu_write32(&regs->ctrldescl[i][1], 0);
 		dcu_write32(&regs->ctrldescl[i][2], 0);
@@ -188,8 +188,10 @@ static void reset_total_layers(void)
 		dcu_write32(&regs->ctrldescl[i][6], 0);
 		dcu_write32(&regs->ctrldescl[i][7], 0);
 		dcu_write32(&regs->ctrldescl[i][8], 0);
+#ifdef CONFIG_LS102XA
 		dcu_write32(&regs->ctrldescl[i][9], 0);
 		dcu_write32(&regs->ctrldescl[i][10], 0);
+#endif
 	}
 }
 
-- 
2.11.1



More information about the U-Boot mailing list