[U-Boot] [PATCH 2/2] RFC: exynos: Disable the display controller when starting Linux

Ajay Kumar ajaykumar.rs at samsung.com
Thu Oct 3 11:04:20 CEST 2013


If the exynos display controller is still active when Linux starts,
then it will result in a kernel panic while FIMD sysmmu driver is
getting probed.
Calling exynos_fimd_lcd_disable() before jumping into kernel
disables the display controller by switching off the windows,
hence resolving the kernel panic which arises from sysmmu driver.

Create an Exynos specific definition for the weak function
arch_cleanup_before_linux(), and then place the call to
exynos_fimd_lcd_disable() inside the overrided definition of
arch_cleanup_before_linux().

Signed-off-by: Ajay Kumar <ajaykumar.rs at samsung.com>
Signed-off-by: Simon Glass <sjg at chromium.org>
---
 arch/arm/cpu/armv7/exynos/system.c        | 9 +++++++++
 arch/arm/include/asm/arch-exynos/system.h | 9 +++++++++
 drivers/video/exynos_fimd.c               | 8 ++++++++
 3 files changed, 26 insertions(+)

diff --git a/arch/arm/cpu/armv7/exynos/system.c b/arch/arm/cpu/armv7/exynos/system.c
index ad12445..977169b 100644
--- a/arch/arm/cpu/armv7/exynos/system.c
+++ b/arch/arm/cpu/armv7/exynos/system.c
@@ -69,3 +69,12 @@ void set_system_display_ctrl(void)
 	else
 		exynos5_set_system_display();
 }
+
+/*
+ * Cleanup any Exynos specific setting here,
+ * if they can cause problem during kernel boot.
+ */
+void arch_cleanup_before_linux(void)
+{
+	exynos_fimd_lcd_disable();
+}
diff --git a/arch/arm/include/asm/arch-exynos/system.h b/arch/arm/include/asm/arch-exynos/system.h
index 7e2057c..ed0c984 100644
--- a/arch/arm/include/asm/arch-exynos/system.h
+++ b/arch/arm/include/asm/arch-exynos/system.h
@@ -40,4 +40,13 @@ struct exynos5_sysreg {
 void set_usbhost_mode(unsigned int mode);
 void set_system_display_ctrl(void);
 
+#ifdef CONFIG_EXYNOS_FB
+/* Disable the display */
+void exynos_fimd_lcd_disable(void);
+#else
+static inline void exynos_fimd_lcd_disable(void)
+{
+}
+#endif
+
 #endif	/* _EXYNOS4_SYSTEM_H */
diff --git a/drivers/video/exynos_fimd.c b/drivers/video/exynos_fimd.c
index 8c2de4e..6a13d03 100644
--- a/drivers/video/exynos_fimd.c
+++ b/drivers/video/exynos_fimd.c
@@ -363,3 +363,11 @@ unsigned long exynos_fimd_calc_fbsize(void)
 {
 	return pvid->vl_col * pvid->vl_row * (NBITS(pvid->vl_bpix) / 8);
 }
+
+void exynos_fimd_lcd_disable(void)
+{
+	int i;
+
+	for (i = 0; i < 4; i++)
+		exynos_fimd_window_off(i);
+}
-- 
1.7.12.4



More information about the U-Boot mailing list