Patchwork [U-Boot,v2] mx51evk: Add DVI output support

login
register
mail settings
Submitter Fabio Estevam
Date Jan. 9, 2013, 2:55 p.m.
Message ID <1357743309-12339-1-git-send-email-fabio.estevam@freescale.com>
Download mbox | patch
Permalink /patch/210718/
State Awaiting Upstream
Delegated to: Stefano Babic
Headers show

Comments

Fabio Estevam - Jan. 9, 2013, 2:55 p.m.
Add DVI output support and make it the default video output.

Currently the CLAA WVGA panel is supported, but this panel has to be purchased
separately, so using the DVI output as the default would allow more people to
try the splash screen feature on a mx51evk.

If someone still wants to use the CLAA WVGA, just set the panel variable as:
set panel claa

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v1:
- Remove 'Let' from the Subject

 board/freescale/mx51evk/mx51evk.c       |    2 --
 board/freescale/mx51evk/mx51evk_video.c |   39 ++++++++++++++++++++++++++++---
 2 files changed, 36 insertions(+), 5 deletions(-)
Stefano Babic - Jan. 13, 2013, 11:08 a.m.
On 09/01/2013 15:55, Fabio Estevam wrote:
> Add DVI output support and make it the default video output.
> 
> Currently the CLAA WVGA panel is supported, but this panel has to be purchased
> separately, so using the DVI output as the default would allow more people to
> try the splash screen feature on a mx51evk.
> 
> If someone still wants to use the CLAA WVGA, just set the panel variable as:
> set panel claa
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---

Applied to -u-boot-imx (fix), thanks.

Best regards,
Stefan Babic

Patch

diff --git a/board/freescale/mx51evk/mx51evk.c b/board/freescale/mx51evk/mx51evk.c
index d1ef431..54c16b1 100644
--- a/board/freescale/mx51evk/mx51evk.c
+++ b/board/freescale/mx51evk/mx51evk.c
@@ -489,8 +489,6 @@  int board_init(void)
 	/* address of boot parameters */
 	gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
 
-	lcd_enable();
-
 	return 0;
 }
 
diff --git a/board/freescale/mx51evk/mx51evk_video.c b/board/freescale/mx51evk/mx51evk_video.c
index f036cf7..1583131 100644
--- a/board/freescale/mx51evk/mx51evk_video.c
+++ b/board/freescale/mx51evk/mx51evk_video.c
@@ -48,6 +48,22 @@  static struct fb_videomode const claa_wvga = {
 	.vmode		= FB_VMODE_NONINTERLACED
 };
 
+static struct fb_videomode const dvi = {
+	.name		= "DVI panel",
+	.refresh	= 60,
+	.xres		= 1024,
+	.yres		= 768,
+	.pixclock	= 15385,
+	.left_margin	= 220,
+	.right_margin	= 40,
+	.upper_margin	= 21,
+	.lower_margin	= 7,
+	.hsync_len	= 60,
+	.vsync_len	= 10,
+	.sync		= 0,
+	.vmode		= FB_VMODE_NONINTERLACED
+};
+
 void setup_iomux_lcd(void)
 {
 	/* DI2_PIN15 */
@@ -73,9 +89,26 @@  void setup_iomux_lcd(void)
 	gpio_direction_output(MX51EVK_LCD_BACKLIGHT, 1);
 }
 
-void lcd_enable(void)
+int board_video_skip(void)
 {
-	int ret = ipuv3_fb_init(&claa_wvga, 1, IPU_PIX_FMT_RGB565);
+	int ret;
+	char const *e = getenv("panel");
+
+	if (e) {
+		if (strcmp(e, "claa") == 0) {
+			ret = ipuv3_fb_init(&claa_wvga, 1, IPU_PIX_FMT_RGB565);
+			if (ret)
+				printf("claa cannot be configured: %d\n", ret);
+			return ret;
+		}
+	}
+
+	/*
+	 * 'panel' env variable not found or has different value than 'claa'
+	 *  Defaulting to dvi output.
+	 */
+	ret = ipuv3_fb_init(&dvi, 0, IPU_PIX_FMT_RGB24);
 	if (ret)
-		printf("LCD cannot be configured: %d\n", ret);
+		printf("dvi cannot be configured: %d\n", ret);
+	return ret;
 }