[U-Boot] LCD Support on mx51 vision2
Fabio Estevam
festevam at gmail.com
Tue May 8 23:24:38 CEST 2012
Anatolij,
On Tue, May 8, 2012 at 4:35 PM, Fabio Estevam <festevam at gmail.com> 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 <fsl_pmic.h>
#include <mc13892.h>
#include <usb/ehci-fsl.h>
+#include <linux/fb.h>
+#include <ipu_pixfmt.h>
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 <common.h>
#include <asm/errno.h>
@@ -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
--
U-Boot 2012.04.01-00075-g6efea73-dirty (May 08 2012 - 18:18:40)
CPU: Freescale i.MX51 rev3.0 at 800 MHz
Reset cause: POR
Board: MX51EVK
DRAM: 512 MiB
WARNING: Caches not enabled
MMC: FSL_SDHC: 0, FSL_SDHC: 1
mxcfb_init_fbinfo: 4 640 112 524
Framebuffer structures at: fbi=0xaf56e268 mxcfbi=0xaf56e478
fb_videomode_to_var mode->xres: -442503140
fbi->var.xres: -442503140
fbi->var.bits_per_pixel /8 : 2
fbi->fix.line_length: -885006280
fbi->fix.smem_len: 2012808736
Unable to allocate framebuffer memory
Framebuffer at 0x0
More information about the U-Boot
mailing list