From patchwork Tue May 8 21:24:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 157822 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 E2929B6FA8 for ; Wed, 9 May 2012 07:24:51 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8A56A28077; Tue, 8 May 2012 23:24:50 +0200 (CEST) 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 LYafDC1n+1lw; Tue, 8 May 2012 23:24:50 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7B05128083; Tue, 8 May 2012 23:24:48 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7C71828083 for ; Tue, 8 May 2012 23:24:46 +0200 (CEST) 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 00GNnxxdf3Gm for ; Tue, 8 May 2012 23:24:43 +0200 (CEST) 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-ee0-f44.google.com (mail-ee0-f44.google.com [74.125.83.44]) by theia.denx.de (Postfix) with ESMTPS id 3E0C328077 for ; Tue, 8 May 2012 23:24:40 +0200 (CEST) Received: by eekd4 with SMTP id d4so887394eek.3 for ; Tue, 08 May 2012 14:24:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=p7FAkTYRSHAbF8eQRdI0R1PHbERAOiqABsnGAbEYxbY=; b=qaffJ6RFTDkghzJOo1/bKocuX8r+Y/U/LceokWDFj9lPZBJfYFtHXx/waDgr5zIX07 KArTvxXLnzuYNCE/w7b1R+gjeE1FnnZ0QNqjMKXE7Ea81cL10UdCxnWCGVMxtAd0ET2g buBsB1vY6D8bgLQFF1dhdqn8fCry/pruRufEsueFCBizsIQ+96RGlH+EC/aNob0x4J3F V9/c4SkOtPiv0vM0KN9s2fB3ZsOz1EmYNU5Sh1NVbIs6CEclt6tQsByIIMXCYZz9vAAJ btudJjrudlPVuHvAhcOeCXDbrfZCwMdOSSnjfsaqhgXuvFUXiIwB4LKB+z6QhAbzdtEx snSw== MIME-Version: 1.0 Received: by 10.213.152.65 with SMTP id f1mr98138ebw.119.1336512278952; Tue, 08 May 2012 14:24:38 -0700 (PDT) Received: by 10.213.22.148 with HTTP; Tue, 8 May 2012 14:24:38 -0700 (PDT) In-Reply-To: References: <20120508202823.25c38062@wker> Date: Tue, 8 May 2012 18:24:38 -0300 Message-ID: From: Fabio Estevam To: Anatolij Gustschin Cc: U-Boot-Denx Subject: Re: [U-Boot] LCD Support on mx51 vision2 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Anatolij, On Tue, May 8, 2012 at 4:35 PM, Fabio Estevam wrote: > Thanks for your suggestion. Increasing  CONFIG_SYS_MALLOC_LEN does not > fix the issue. Below is my patch and some more debug information. As you can see mode->xres is getting a weird value instead of '800' that I pass in the fb_videomode struct. diff --git a/board/freescale/mx51evk/mx51evk.c b/board/freescale/mx51evk/mx51evk.c index b505a71..a6cf64a 100644 --- a/board/freescale/mx51evk/mx51evk.c +++ b/board/freescale/mx51evk/mx51evk.c @@ -36,6 +36,8 @@ #include #include #include +#include +#include DECLARE_GLOBAL_DATA_PTR; @@ -453,6 +455,27 @@ int board_mmc_init(bd_t *bis) } #endif +static struct fb_videomode claa_wvga = { + .name = "CLAA07LC0ACW", + .refresh = 57, + .xres = 800, + .yres = 480, + .pixclock = 37037, + .left_margin = 40, + .right_margin = 60, + .upper_margin = 10, + .lower_margin = 10, + .hsync_len = 20, + .vsync_len = 10, + .sync = 0, + .vmode = FB_VMODE_NONINTERLACED +}; + +void lcd_enable(void) +{ + mx51_fb_init(&claa_wvga, 1, IPU_PIX_FMT_RGB565); +} + int board_early_init_f(void) { setup_iomux_uart(); diff --git a/drivers/video/mxc_ipuv3_fb.c b/drivers/video/mxc_ipuv3_fb.c index 1bee54c..c640838 100644 --- a/drivers/video/mxc_ipuv3_fb.c +++ b/drivers/video/mxc_ipuv3_fb.c @@ -26,6 +26,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA */ +#define DEBUG #include #include @@ -66,6 +67,8 @@ void fb_videomode_to_var(struct fb_var_screeninfo *var, var->vsync_len = mode->vsync_len; var->sync = mode->sync; var->vmode = mode->vmode & FB_VMODE_MASK; + + printf("%s mode->xres: %d\n", __func__, mode->xres); } /* @@ -542,8 +545,15 @@ static int mxcfb_probe(u32 interface_pix_fmt, uint8_t disp, fb_videomode_to_var(&fbi->var, mode); fbi->var.bits_per_pixel = 16; fbi->fix.line_length = fbi->var.xres * (fbi->var.bits_per_pixel / 8); + + printf("fbi->var.xres: %d\n", fbi->var.xres); + printf("fbi->var.bits_per_pixel /8 : %d\n", fbi->var.bits_per_pixel / 8); + printf("fbi->fix.line_length: %d\n", fbi->fix.line_length); + fbi->fix.smem_len = fbi->var.yres_virtual * fbi->fix.line_length; + printf("fbi->fix.smem_len: %d\n", fbi->fix.smem_len); + mxcfb_check_var(&fbi->var, fbi); /* Default Y virtual size is 2x panel size */ diff --git a/include/configs/mx51evk.h b/include/configs/mx51evk.h index 1477b21..e4240ba 100644 --- a/include/configs/mx51evk.h +++ b/include/configs/mx51evk.h @@ -51,7 +51,7 @@ /* * Size of malloc() pool */ -#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * 1024 * 1024) +#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 10 * 1024 * 1024) #define CONFIG_BOARD_LATE_INIT @@ -123,6 +123,17 @@ #define CONFIG_MXC_USB_PORTSC PORT_PTS_ULPI #define CONFIG_MXC_USB_FLAGS MXC_EHCI_POWER_PINS_ENABLED +/* Framebuffer and LCD */ +#define CONFIG_PREBOOT +#define CONFIG_VIDEO +#define CONFIG_VIDEO_MX5 +#define CONFIG_CFB_CONSOLE +#define CONFIG_VGA_AS_SINGLE_DEVICE +#define CONFIG_VIDEO_BMP_RLE8 +#define CONFIG_SPLASH_SCREEN +#define CONFIG_CMD_BMP +#define CONFIG_BMP_16BPP + /* allow to overwrite serial and ethaddr */ #define CONFIG_ENV_OVERWRITE #define CONFIG_CONS_INDEX 1