[U-Boot] [PATCH 3/3] mx53loco: Add LCD support

Liu Hui-R64343 r64343 at freescale.com
Fri May 11 03:50:33 CEST 2012


>-----Original Message-----
>From: Fabio Estevam [mailto:festevam at gmail.com]
>Sent: Friday, May 11, 2012 9:08 AM
>To: u-boot at lists.denx.de
>Cc: sbabic at denx.de; Liu Hui-R64343; Estevam Fabio-R49496
>Subject: [PATCH 3/3] mx53loco: Add LCD support
>
>From: Fabio Estevam <fabio.estevam at freescale.com>
>
>Add support for CLAA07LC0ACW LCD that connects to the mx53loco board.
>
>Configure the board to show the Linux logo on the LCD.
>
>Also increase the size of CONFIG_SYS_MALLOC_LEN variable to take into
>account the framebuffer usage.
>
>Signed-off-by: Fabio Estevam <fabio.estevam at freescale.com>

Acked-by: Jason Liu <r64343 at freescale.com>

>---
> board/freescale/mx53loco/mx53loco.c |   72
>+++++++++++++++++++++++++++++++++++
> include/configs/mx53loco.h          |   13 ++++++-
> 2 files changed, 84 insertions(+), 1 deletions(-)
>
>diff --git a/board/freescale/mx53loco/mx53loco.c
>b/board/freescale/mx53loco/mx53loco.c
>index dec966d..ad9e419 100644
>--- a/board/freescale/mx53loco/mx53loco.c
>+++ b/board/freescale/mx53loco/mx53loco.c
>@@ -39,6 +39,10 @@
> #include <pmic.h>
> #include <dialog_pmic.h>
> #include <fsl_pmic.h>
>+#include <linux/fb.h>
>+#include <ipu_pixfmt.h>
>+
>+#define MX53LOCO_LCD_POWER		(2 * 32 + 24)	/* GPIO3_24 */
>
> DECLARE_GLOBAL_DATA_PTR;
>
>@@ -402,10 +406,74 @@ static void clock_1GHz(void)
> 		printf("CPU:   Switch DDR clock to 400MHz failed\n");
> }
>
>+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_iomux(void)
>+{
>+	mxc_request_iomux(MX53_PIN_DI0_DISP_CLK, IOMUX_CONFIG_ALT0);
>+	mxc_request_iomux(MX53_PIN_DI0_PIN15, IOMUX_CONFIG_ALT0);
>+	mxc_request_iomux(MX53_PIN_DI0_PIN2, IOMUX_CONFIG_ALT0);
>+	mxc_request_iomux(MX53_PIN_DI0_PIN3, IOMUX_CONFIG_ALT0);
>+	mxc_request_iomux(MX53_PIN_DISP0_DAT0, IOMUX_CONFIG_ALT0);
>+	mxc_request_iomux(MX53_PIN_DISP0_DAT1, IOMUX_CONFIG_ALT0);
>+	mxc_request_iomux(MX53_PIN_DISP0_DAT2, IOMUX_CONFIG_ALT0);
>+	mxc_request_iomux(MX53_PIN_DISP0_DAT3, IOMUX_CONFIG_ALT0);
>+	mxc_request_iomux(MX53_PIN_DISP0_DAT4, IOMUX_CONFIG_ALT0);
>+	mxc_request_iomux(MX53_PIN_DISP0_DAT5, IOMUX_CONFIG_ALT0);
>+	mxc_request_iomux(MX53_PIN_DISP0_DAT6, IOMUX_CONFIG_ALT0);
>+	mxc_request_iomux(MX53_PIN_DISP0_DAT7, IOMUX_CONFIG_ALT0);
>+	mxc_request_iomux(MX53_PIN_DISP0_DAT8, IOMUX_CONFIG_ALT0);
>+	mxc_request_iomux(MX53_PIN_DISP0_DAT9, IOMUX_CONFIG_ALT0);
>+	mxc_request_iomux(MX53_PIN_DISP0_DAT10, IOMUX_CONFIG_ALT0);
>+	mxc_request_iomux(MX53_PIN_DISP0_DAT11, IOMUX_CONFIG_ALT0);
>+	mxc_request_iomux(MX53_PIN_DISP0_DAT12, IOMUX_CONFIG_ALT0);
>+	mxc_request_iomux(MX53_PIN_DISP0_DAT13, IOMUX_CONFIG_ALT0);
>+	mxc_request_iomux(MX53_PIN_DISP0_DAT14, IOMUX_CONFIG_ALT0);
>+	mxc_request_iomux(MX53_PIN_DISP0_DAT15, IOMUX_CONFIG_ALT0);
>+	mxc_request_iomux(MX53_PIN_DISP0_DAT16, IOMUX_CONFIG_ALT0);
>+	mxc_request_iomux(MX53_PIN_DISP0_DAT17, IOMUX_CONFIG_ALT0);
>+	mxc_request_iomux(MX53_PIN_DISP0_DAT18, IOMUX_CONFIG_ALT0);
>+	mxc_request_iomux(MX53_PIN_DISP0_DAT19, IOMUX_CONFIG_ALT0);
>+	mxc_request_iomux(MX53_PIN_DISP0_DAT20, IOMUX_CONFIG_ALT0);
>+	mxc_request_iomux(MX53_PIN_DISP0_DAT21, IOMUX_CONFIG_ALT0);
>+	mxc_request_iomux(MX53_PIN_DISP0_DAT22, IOMUX_CONFIG_ALT0);
>+	mxc_request_iomux(MX53_PIN_DISP0_DAT23, IOMUX_CONFIG_ALT0);
>+
>+	/* Turn on GPIO backlight */
>+	mxc_request_iomux(MX53_PIN_EIM_D24, IOMUX_CONFIG_ALT1);
>+	gpio_direction_output(MX53LOCO_LCD_POWER, 1);
>+
>+	/* Turn on display contrast */
>+	mxc_request_iomux(MX53_PIN_GPIO_1, IOMUX_CONFIG_ALT1);
>+	gpio_direction_output(IOMUX_TO_GPIO(MX53_PIN_GPIO_1), 1); }
>+
>+void lcd_enable(void)
>+{
>+	int ret = ipuv3_fb_init(&claa_wvga, 0, IPU_PIX_FMT_RGB565);
>+	if (ret)
>+		printf("LCD cannot be configured: %d\n", ret); }
>+
> int board_early_init_f(void)
> {
> 	setup_iomux_uart();
> 	setup_iomux_fec();
>+	lcd_iomux();
>
> 	return 0;
> }
>@@ -432,6 +500,8 @@ int board_late_init(void)
> 		clock_1GHz();
> 	print_cpuinfo();
>
>+	setenv("stdout", "serial");
>+
> 	return 0;
> }
> #endif
>@@ -441,6 +511,8 @@ int board_init(void)
> 	gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
>
> 	mxc_set_sata_internal_clock();
>+
>+	lcd_enable();
>
> 	return 0;
> }
>diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h index
>eab0e27..99daafb 100644
>--- a/include/configs/mx53loco.h
>+++ b/include/configs/mx53loco.h
>@@ -38,7 +38,7 @@
> #define CONFIG_INITRD_TAG
>
> /* Size of malloc() pool */
>-#define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 2 * 1024 *
>1024)
>+#define CONFIG_SYS_MALLOC_LEN		(10 * 1024 * 1024)
>
> #define CONFIG_BOARD_EARLY_INIT_F
> #define CONFIG_BOARD_LATE_INIT
>@@ -220,4 +220,15 @@
> 	#define CONFIG_LIBATA
> #endif
>
>+/* 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_BMP_16BPP
>+#define CONFIG_VIDEO_LOGO
>+
> #endif				/* __CONFIG_H */
>--
>1.7.1
>




More information about the U-Boot mailing list