Index: include/configs/mx51evk.h
===================================================================
--- include/configs/mx51evk.h	(revision 173)
+++ include/configs/mx51evk.h	(working copy)
@@ -190,6 +190,15 @@
 #define CONFIG_SYS_DDR_CLKSEL	0
 #define CONFIG_SYS_CLKTL_CBCDR	0x59E35100

+/*
+ * Framebuffer and LCD
+ */
+#define CONFIG_LCD
+#define CONFIG_VIDEO_MX5
+#define LCD_BPP		LCD_COLOR16
+#define CONFIG_CMD_BMP
+#define CONFIG_BMP_16BPP
+
 /*-----------------------------------------------------------------------
  * FLASH and environment organization
  */
Index: board/freescale/mx51evk/mx51evk.c
===================================================================
--- board/freescale/mx51evk/mx51evk.c	(revision 170)
+++ board/freescale/mx51evk/mx51evk.c	(working copy)
@@ -34,10 +34,38 @@
 #include <fsl_pmic.h>
 #include <mc13892.h>

+#ifdef CONFIG_LCD
+#include <linux/fb.h>
+#include <lcd.h>
+#endif
+
 DECLARE_GLOBAL_DATA_PTR;

 static u32 system_rev;
+extern int mx51_fb_init(struct fb_videomode *mode, u32 ipu_di, u32 pix_fmt);

+#ifdef CONFIG_LCD
+static struct fb_videomode claa_wvga = {
+	"CLAA07LC0ACW",
+	57,	/* Refresh */
+	800,	/* xres */
+	480,	/* yres */
+	37037,	/* pixclock = 27Mhz */
+	40,	/* left margin */
+	60,	/* right margin */
+	10,	/* upper margin */
+	10,	/* lower margin */
+	20,	/* hsync-len */
+	10,	/* vsync-len */
+	0,	/* sync */
+	FB_VMODE_NONINTERLACED,	/* vmode */
+	0,	/* flag */
+};
+
+static int wvga_ipu_di = 1;
+static int wvga_bppix = 16;
+#endif
+
 #ifdef CONFIG_FSL_ESDHC
 struct fsl_esdhc_cfg esdhc_cfg[2] = {
 	{MMC_SDHC1_BASE_ADDR, 1},
@@ -148,6 +176,41 @@
 	mxc_iomux_set_pad(MX51_PIN_NANDF_D11, 0x2180);
 }

+#ifdef CONFIG_LCD
+void setup_iomux_ipu(void)
+{
+	puts( "setup_iopmux_ipu(): invoked\n" );
+	/* DISP2_DAT [0:15] are configured by default */
+	mxc_request_iomux(MX51_PIN_DI1_D1_CS, IOMUX_CONFIG_ALT4);
+	mxc_iomux_set_pad(MX51_PIN_DI1_D1_CS,
+		PAD_CTL_PKE_ENABLE | PAD_CTL_DRV_HIGH | PAD_CTL_SRE_FAST);
+	mxc_request_iomux(MUX_IN_GPIO3_IPP_IND_G_IN_4_SELECT_INPUT,
+		INPUT_CTL_PATH1);
+
+	/* DISP2_DRDY pin */
+	mxc_request_iomux(MX51_PIN_DI_GP4, IOMUX_CONFIG_ALT4);
+	mxc_iomux_set_pad(MX51_PIN_DI_GP4, PAD_CTL_PKE_ENABLE |
+		PAD_CTL_PUE_KEEPER | PAD_CTL_DRV_LOW);
+
+	puts( "setup_iopmux_ipu(): done\n" );
+}
+
+#endif
+
+#ifdef CONFIG_LCD
+void lcd_enable(void)
+{
+	int ret;
+puts( "lcd_enable(): invoked\n" );
+
+	ret = mx51_fb_init(&claa_wvga, wvga_ipu_di, wvga_bppix);
+	if (ret) {
+		puts("LCD cannot be configured\n");
+	}
+
+}
+#endif
+
 #ifdef CONFIG_MXC_SPI
 static void setup_iomux_spi(void)
 {
@@ -409,7 +472,9 @@

 	setup_iomux_uart();
 	setup_iomux_fec();
-
+#ifdef CONFIG_LCD
+	setup_iomux_ipu();
+#endif
 	return 0;
 }

Index: common/lcd.c
===================================================================
--- common/lcd.c	(revision 170)
+++ common/lcd.c	(working copy)
@@ -438,16 +438,21 @@
 ulong lcd_setmem (ulong addr)
 {
 	ulong size;
+#ifdef	ORIGINAL_PRE_TBESEMER
 	int line_length = (panel_info.vl_col * NBITS (panel_info.vl_bpix)) / 8;

 	debug ("LCD panel info: %d x %d, %d bit/pix\n",
 		panel_info.vl_col, panel_info.vl_row, NBITS (panel_info.vl_bpix) );

 	size = line_length * panel_info.vl_row;
+#else
+	size = 1024 * 1024 * 12;

 	/* Round up to nearest full page */
 	size = (size + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);

+#endif
+
 	/* Allocate pages for the frame buffer. */
 	addr -= size;


Index: drivers/video/mxc_ipuv3_fb.c
===================================================================
--- drivers/video/mxc_ipuv3_fb.c	(revision 170)
+++ drivers/video/mxc_ipuv3_fb.c	(working copy)
@@ -526,7 +526,7 @@
  *
  * @return      Appropriate error code to the kernel common code
  */
-static int mxcfb_probe(u32 interface_pix_fmt, struct fb_videomode *mode)
+static int mxcfb_probe(u32 interface_pix_fmt, struct fb_videomode
*mode, u32 ipu_di)
 {
 	struct fb_info *fbi;
