From patchwork Wed Jan 2 21:34:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 209150 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 6FD3C2C0090 for ; Thu, 3 Jan 2013 08:34:34 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 47C774A0BD; Wed, 2 Jan 2013 22:34:30 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WaIARJLP+202; Wed, 2 Jan 2013 22:34:30 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C00454A0EE; Wed, 2 Jan 2013 22:34:28 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4B1D24A0EE for ; Wed, 2 Jan 2013 22:34:27 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id USWMKPXJUrKO for ; Wed, 2 Jan 2013 22:34:24 +0100 (CET) X-Greylist: delayed 9931 seconds by postgrey-1.27 at theia; Wed, 02 Jan 2013 22:34:23 CET X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by theia.denx.de (Postfix) with ESMTPS id 765114A0BD for ; Wed, 2 Jan 2013 22:34:22 +0100 (CET) Received: by mail-vc0-f182.google.com with SMTP id fy27so14822316vcb.13 for ; Wed, 02 Jan 2013 13:34:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=qxzQej1dli1IXf97lHkZYDnt3Tgj7Lld/mqfAzcW+OI=; b=hD5OnMsmuV/L1wmr6D/FObFayHWiSIrsah37Y5CZ4db6yEdVxwI1IZ1FpDnxHkCPuf DCod9jaW7/aAHMBSb0C2Ym6CWl0eJY6Wzpjx70PLQLjAFVjoGJWjFXmOhQobbT2MVevN LCXfVPacSOgbUM+rYmyKsZMVj4/3MbW2IzhsIGYzD+P5yOULjZFDfXVT2DfZT/b4fbpY 9wDz4SYgXR4zwb/aPodbMTbQ/TgeeRJDOXmtYOjN7mN3Q5ZQF4nOc9UHk8nTmOPhz6Y2 a7YwDolGZj0Rw4J948Fl0xNi9kYs3yS5FrBkw0yZjo+s+CemqBXdLzTUtuUBRey0zrRc hckw== X-Received: by 10.52.71.174 with SMTP id w14mr62526174vdu.122.1357162461608; Wed, 02 Jan 2013 13:34:21 -0800 (PST) Received: from fabio-Latitude-E6410.cps.virtua.com.br ([189.61.223.46]) by mx.google.com with ESMTPS id cm9sm43832843vdb.3.2013.01.02.13.34.19 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 02 Jan 2013 13:34:20 -0800 (PST) From: Fabio Estevam To: sbabic@denx.de Date: Wed, 2 Jan 2013 19:34:13 -0200 Message-Id: <1357162453-25259-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.7.9.5 Cc: Fabio Estevam , u-boot@lists.denx.de Subject: [U-Boot] [PATCH v2] mx53loco: Add support for SEIKO 4.3'' WVGA panel X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Fabio Estevam Add support for the Seiko 4.3'' WVGA panel on mx53loco. By default, the CLAA WVGA panel is selected. In order to support the Seiko panel, the enviroment variable 'panel' must be set to 'seiko'. Signed-off-by: Fabio Estevam --- Changes since v1: - Allow a single binary to support both CLAA and Seiko panels board/freescale/mx53loco/mx53loco.c | 2 -- board/freescale/mx53loco/mx53loco_video.c | 53 ++++++++++++++++++++++++++--- 2 files changed, 49 insertions(+), 6 deletions(-) diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c index 63a4f8b..9635e62 100644 --- a/board/freescale/mx53loco/mx53loco.c +++ b/board/freescale/mx53loco/mx53loco.c @@ -463,8 +463,6 @@ int board_init(void) mxc_set_sata_internal_clock(); setup_iomux_i2c(); - lcd_enable(); - return 0; } diff --git a/board/freescale/mx53loco/mx53loco_video.c b/board/freescale/mx53loco/mx53loco_video.c index 69991e8..f02c0e5 100644 --- a/board/freescale/mx53loco/mx53loco_video.c +++ b/board/freescale/mx53loco/mx53loco_video.c @@ -46,6 +46,21 @@ static struct fb_videomode const claa_wvga = { .vmode = FB_VMODE_NONINTERLACED }; +static struct fb_videomode const seiko_wvga = { + .name = "Seiko-43WVF1G", + .refresh = 60, + .xres = 800, + .yres = 480, + .pixclock = 29851, /* picosecond (33.5 MHz) */ + .left_margin = 89, + .right_margin = 164, + .upper_margin = 23, + .lower_margin = 10, + .hsync_len = 10, + .vsync_len = 10, + .sync = 0, +}; + void setup_iomux_lcd(void) { mxc_request_iomux(MX53_PIN_DI0_DISP_CLK, IOMUX_CONFIG_ALT0); @@ -86,9 +101,39 @@ void setup_iomux_lcd(void) gpio_direction_output(IOMUX_TO_GPIO(MX53_PIN_GPIO_1), 1); } -void lcd_enable(void) +int board_video_skip(void) { - int ret = ipuv3_fb_init(&claa_wvga, 0, IPU_PIX_FMT_RGB565); - if (ret) - printf("LCD cannot be configured: %d\n", ret); + int ret; + char const *e = getenv("panel"); + + if (!e) { + /* 'panel' env variable not found. Default to 'claa' lcd */ + ret = ipuv3_fb_init(&claa_wvga, 0, IPU_PIX_FMT_RGB565); + if (ret) + printf("LCD cannot be configured: %d\n", ret); + return ret; + + } else { /* 'panel' env variable is found */ + if (strcmp(e, "claa") == 0) { + ret = ipuv3_fb_init(&claa_wvga, 0, IPU_PIX_FMT_RGB565); + if (ret) + printf("LCD cannot be configured: %d\n", ret); + return ret; + } + + if (strcmp(e, "seiko") == 0) { + ret = ipuv3_fb_init(&seiko_wvga, 0, IPU_PIX_FMT_RGB24); + if (ret) + printf("LCD cannot be configured: %d\n", ret); + return ret; + } + /* + * If 'panel' variable has a value different then + * 'claa' or 'seiko' then setup as 'claa' lcd by default + */ + ret = ipuv3_fb_init(&claa_wvga, 0, IPU_PIX_FMT_RGB565); + if (ret) + printf("LCD cannot be configured: %d\n", ret); + return ret; + } }