[U-Boot] [PATCH 6/6] powerpc/85xx: Add SHARP LQ084S3LG01 LCD support on P1022DS

Kumar Gala galak at kernel.crashing.org
Mon Mar 7 05:17:48 CET 2011


From: Jiang Yutang <b14898 at freescale.com>

SHARP LQ084S3LG01 TFT LCD is the default configuration with P1022DS RevC
board.  It only support 800x600 resolutions. While using DIU's DVI or
 LVDS ports, some environment var should be setting:

DVI:
'setenv monitor 0'
'setenv resolution 1280x1024'

LVDS(default):
'setenv monitor 1'
'setenv resolution 800x600'

environment var 'othbootargs' should be:
othbootargs=diufb=15M video=fslfb: $resolution -32 at 60,monitor=$monitor tty0

Save environment var 'monitor' as '0' or '1' then reset board, DIU will
change signal out to DVI or LVDS. DIU driver will according environment
var 'monitor' to automatic setting environment var 'resolution' as
800x600(SHARP LQ084S3LG01 LCD) or 1280x1024(DELL monitor).

Signed-off-by: Jiang Yutang <b14898 at freescale.com>
Signed-off-by: Kumar Gala <galak at kernel.crashing.org>
---
 board/freescale/p1022ds/diu.c |    8 ++++++--
 doc/README.p1022ds            |   22 ++++++++++++++++++++++
 drivers/video/fsl_diu_fb.c    |   20 +++++++++++++++++++-
 include/configs/P1022DS.h     |    6 ++++--
 4 files changed, 51 insertions(+), 5 deletions(-)

diff --git a/board/freescale/p1022ds/diu.c b/board/freescale/p1022ds/diu.c
index 15f95c6..d4fbc4f 100644
--- a/board/freescale/p1022ds/diu.c
+++ b/board/freescale/p1022ds/diu.c
@@ -102,12 +102,14 @@ int platform_diu_init(unsigned int *xres, unsigned int *yres)
 
 	monitor_port = getenv("monitor");
 	if (!strncmp(monitor_port, "1", 1)) { /* 1 - Single link LVDS */
-		*xres = 1024;
-		*yres = 768;
+		*xres = 800;
+		*yres = 600;
 		/* Enable the DFP port, disable the DVI and the backlight */
 		temp &= ~PX_BRDCFG1_DVIEN;
 		/* LVDS also needs backlight enabled, otherwise the display will be blank */
 		temp |= (PX_BRDCFG1_DFPEN | PX_BRDCFG1_BACKLIGHT);
+		setenv("monitor", "1");
+		setenv("resolution", "800x600");
 		printf("DIU link to 1-LVDS\n");
 	} else {	/* DVI */
 		*xres = 1280;
@@ -115,6 +117,8 @@ int platform_diu_init(unsigned int *xres, unsigned int *yres)
 		/* Enable the DVI port, disable the DFP and the backlight */
 		temp &= ~(PX_BRDCFG1_DFPEN | PX_BRDCFG1_BACKLIGHT);
 		temp |= PX_BRDCFG1_DVIEN;
+		setenv("monitor", "0");
+		setenv("resolution", "1280x1024");
 		printf("DIU link to 0-DVI\n");
 	}
 
diff --git a/doc/README.p1022ds b/doc/README.p1022ds
index 473ecf6..77db2f6 100644
--- a/doc/README.p1022ds
+++ b/doc/README.p1022ds
@@ -22,3 +22,25 @@ and AUDIO codec clock sources only setting as 11MHz or 12MHz !
 'setenv hwconfig 'audclk:11;tdm'	--- error !
 'setenv hwconfig 'audclk:10'		--- error !
 
+
+DIU Display Setting
+-------------------------------
+P1022ds DIU can link to DVI or LVDS, DVI can connect to DELL monitor(1280x1024 resolution)
+and LVDS can connect to SHARP LQ084S3LG01 LCD(only support 800x600 resolution) on board.
+Before using DIU, please check following environment var setting:
+
+DVI:
+'setenv monitor 0'
+'setenv resolution 1280x1024'
+
+LVDS(default):
+'setenv monitor 1'
+'setenv resolution 800x600'
+
+environment var 'othbootargs' should be:
+othbootargs=diufb=15M video=fslfb: $resolution -32 at 60,monitor=$monitor tty0
+
+Save environment var 'monitor' as '0' or '1' then reset board, DIU will change signal out to DVI or LVDS.
+DIU driver will according environment var 'monitor' to automatic setting environment var 'resolution' as
+800x600(SHARP LQ084S3LG01 LCD) or 1280x1024(DELL monitor).
+
diff --git a/drivers/video/fsl_diu_fb.c b/drivers/video/fsl_diu_fb.c
index 35ed938..1e3e6a2 100644
--- a/drivers/video/fsl_diu_fb.c
+++ b/drivers/video/fsl_diu_fb.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2007, 2010 Freescale Semiconductor, Inc.
+ * Copyright 2007, 2011 Freescale Semiconductor, Inc.
  * York Sun <yorksun at freescale.com>
  *
  * FSL DIU Framebuffer driver
@@ -51,6 +51,23 @@ struct fb_videomode {
 #define FB_SYNC_COMP_HIGH_ACT	8	/* composite sync high active   */
 #define FB_VMODE_NONINTERLACED  0	/* non interlaced */
 
+#ifdef CONFIG_SHARP_LQ084S3LG01_TFT_LCD
+static struct fb_videomode fsl_diu_mode_800 = {
+	.name		= "800x600-60",
+	.refresh	= 60,
+	.xres		= 800,
+	.yres		= 600,
+	.pixclock	= 25000,
+	.left_margin	= 88,
+	.right_margin	= 40,
+	.upper_margin	= 23,
+	.lower_margin	= 1,
+	.hsync_len	= 128,
+	.vsync_len	= 4,
+	.sync		= FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+	.vmode		= FB_VMODE_NONINTERLACED
+};
+#else
 /* This setting is used for the ifm pdm360ng with PRIMEVIEW PM070WL3 */
 static struct fb_videomode fsl_diu_mode_800 = {
 	.refresh	= 60,
@@ -66,6 +83,7 @@ static struct fb_videomode fsl_diu_mode_800 = {
 	.sync		= 0,
 	.vmode		= FB_VMODE_NONINTERLACED
 };
+#endif
 
 /*
  * These parameters give default parameters
diff --git a/include/configs/P1022DS.h b/include/configs/P1022DS.h
index ad10550..fd2d869 100644
--- a/include/configs/P1022DS.h
+++ b/include/configs/P1022DS.h
@@ -220,6 +220,7 @@
  * disable empty flash sector detection, which is I/O-intensive.
  */
 #undef CONFIG_SYS_FLASH_EMPTY_INFO
+#define CONFIG_SHARP_LQ084S3LG01_TFT_LCD
 #endif
 
 #ifndef CONFIG_DIU
@@ -510,9 +511,10 @@
 	"diuregs=md e002c000 1d\0"			 		\
 	"dium=mw e002c01c\0" 						\
 	"diuerr=md e002c014 1\0" 					\
-	"othbootargs=diufb=15M video=fslfb:1280x1024-32 at 60,monitor=0 tty0\0" \
+	"othbootargs=diufb=15M video=fslfb: $resolution -32 at 60,monitor=$monitor tty0\0" \
 	"hwconfig=esdhc;audclk:12\0"					\
-	"monitor=0-DVI\0"
+	"monitor=0\0"							\
+	"resolution=800x600\0"
 
 #define CONFIG_HDBOOT					\
 	"setenv bootargs root=/dev/$bdev rw "		\
-- 
1.7.2.3



More information about the U-Boot mailing list