* [U-Boot] [PATCH] mx51evk: Add LCD support
@ 2012-05-09 16:39 Fabio Estevam
2012-05-10 10:11 ` Stefano Babic
2012-05-25 8:09 ` Anatolij Gustschin
0 siblings, 2 replies; 3+ messages in thread
From: Fabio Estevam @ 2012-05-09 16:39 UTC (permalink / raw)
To: u-boot
Add support for CLAA07LC0ACW LCD that connects to the mx51evk 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@freescale.com>
---
board/freescale/mx51evk/mx51evk.c | 59 +++++++++++++++++++++++++++++++++++++
include/configs/mx51evk.h | 13 +++++++-
2 files changed, 71 insertions(+), 1 deletions(-)
diff --git a/board/freescale/mx51evk/mx51evk.c b/board/freescale/mx51evk/mx51evk.c
index b505a71..90dbabb 100644
--- a/board/freescale/mx51evk/mx51evk.c
+++ b/board/freescale/mx51evk/mx51evk.c
@@ -36,6 +36,12 @@
#include <fsl_pmic.h>
#include <mc13892.h>
#include <usb/ehci-fsl.h>
+#include <linux/fb.h>
+#include <ipu_pixfmt.h>
+
+#define MX51EVK_LCD_3V3 (3 * 32 + 9) /* GPIO4_9 */
+#define MX51EVK_LCD_5V (3 * 32 + 10) /* GPIO4_10 */
+#define MX51EVK_LCD_BACKLIGHT (2 * 32 + 4) /* GPIO3_4 */
DECLARE_GLOBAL_DATA_PTR;
@@ -453,6 +459,54 @@ 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_iomux(void)
+{
+ /* DI2_PIN15 */
+ mxc_request_iomux(MX51_PIN_DI_GP4, IOMUX_CONFIG_ALT4);
+
+ /* Pad settings for MX51_PIN_DI2_DISP_CLK */
+ mxc_iomux_set_pad(MX51_PIN_DI2_DISP_CLK, PAD_CTL_HYS_NONE |
+ PAD_CTL_PKE_ENABLE | PAD_CTL_PUE_KEEPER |
+ PAD_CTL_DRV_MAX | PAD_CTL_SRE_SLOW);
+
+ /* Turn on 3.3V voltage for LCD */
+ mxc_request_iomux(MX51_PIN_CSI2_D12, IOMUX_CONFIG_ALT3);
+ gpio_direction_output(MX51EVK_LCD_3V3, 1);
+
+ /* Turn on 5V voltage for LCD */
+ mxc_request_iomux(MX51_PIN_CSI2_D13, IOMUX_CONFIG_ALT3);
+ gpio_direction_output(MX51EVK_LCD_5V, 1);
+
+ /* Turn on GPIO backlight */
+ mxc_request_iomux(MX51_PIN_DI1_D1_CS, IOMUX_CONFIG_ALT4);
+ mxc_iomux_set_input(MX51_GPIO3_IPP_IND_G_IN_4_SELECT_INPUT,
+ INPUT_CTL_PATH1);
+ gpio_direction_output(MX51EVK_LCD_BACKLIGHT, 1);
+}
+
+void lcd_enable(void)
+{
+ int ret = mx51_fb_init(&claa_wvga, 1, IPU_PIX_FMT_RGB565);
+ if (ret)
+ printf("LCD cannot be configured: %d\n", ret);
+}
+
int board_early_init_f(void)
{
setup_iomux_uart();
@@ -460,6 +514,7 @@ int board_early_init_f(void)
#ifdef CONFIG_USB_EHCI_MX5
setup_usb_h1();
#endif
+ lcd_iomux();
return 0;
}
@@ -469,6 +524,8 @@ int board_init(void)
/* address of boot parameters */
gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
+ lcd_enable();
+
return 0;
}
@@ -479,6 +536,8 @@ int board_late_init(void)
setup_iomux_spi();
power_init();
#endif
+ setenv("stdout", "serial");
+
return 0;
}
#endif
diff --git a/include/configs/mx51evk.h b/include/configs/mx51evk.h
index 1477b21..58b6f1c 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 (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_BMP_16BPP
+#define CONFIG_VIDEO_LOGO
+
/* allow to overwrite serial and ethaddr */
#define CONFIG_ENV_OVERWRITE
#define CONFIG_CONS_INDEX 1
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] mx51evk: Add LCD support
2012-05-09 16:39 [U-Boot] [PATCH] mx51evk: Add LCD support Fabio Estevam
@ 2012-05-10 10:11 ` Stefano Babic
2012-05-25 8:09 ` Anatolij Gustschin
1 sibling, 0 replies; 3+ messages in thread
From: Stefano Babic @ 2012-05-10 10:11 UTC (permalink / raw)
To: u-boot
On 09/05/2012 18:39, Fabio Estevam wrote:
> Add support for CLAA07LC0ACW LCD that connects to the mx51evk 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@freescale.com>
> ---
> board/freescale/mx51evk/mx51evk.c | 59 +++++++++++++++++++++++++++++++++++++
> include/configs/mx51evk.h | 13 +++++++-
> 2 files changed, 71 insertions(+), 1 deletions(-)
>
> diff --git a/board/freescale/mx51evk/mx51evk.c b/board/freescale/mx51evk/mx51evk.c
> index b505a71..90dbabb 100644
> --- a/board/freescale/mx51evk/mx51evk.c
> +++ b/board/freescale/mx51evk/mx51evk.c
> @@ -36,6 +36,12 @@
> #include <fsl_pmic.h>
> #include <mc13892.h>
> #include <usb/ehci-fsl.h>
> +#include <linux/fb.h>
> +#include <ipu_pixfmt.h>
> +
> +#define MX51EVK_LCD_3V3 (3 * 32 + 9) /* GPIO4_9 */
> +#define MX51EVK_LCD_5V (3 * 32 + 10) /* GPIO4_10 */
> +#define MX51EVK_LCD_BACKLIGHT (2 * 32 + 4) /* GPIO3_4 */
>
> DECLARE_GLOBAL_DATA_PTR;
>
> @@ -453,6 +459,54 @@ 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_iomux(void)
> +{
> + /* DI2_PIN15 */
> + mxc_request_iomux(MX51_PIN_DI_GP4, IOMUX_CONFIG_ALT4);
> +
> + /* Pad settings for MX51_PIN_DI2_DISP_CLK */
> + mxc_iomux_set_pad(MX51_PIN_DI2_DISP_CLK, PAD_CTL_HYS_NONE |
> + PAD_CTL_PKE_ENABLE | PAD_CTL_PUE_KEEPER |
> + PAD_CTL_DRV_MAX | PAD_CTL_SRE_SLOW);
> +
> + /* Turn on 3.3V voltage for LCD */
> + mxc_request_iomux(MX51_PIN_CSI2_D12, IOMUX_CONFIG_ALT3);
> + gpio_direction_output(MX51EVK_LCD_3V3, 1);
> +
> + /* Turn on 5V voltage for LCD */
> + mxc_request_iomux(MX51_PIN_CSI2_D13, IOMUX_CONFIG_ALT3);
> + gpio_direction_output(MX51EVK_LCD_5V, 1);
> +
> + /* Turn on GPIO backlight */
> + mxc_request_iomux(MX51_PIN_DI1_D1_CS, IOMUX_CONFIG_ALT4);
> + mxc_iomux_set_input(MX51_GPIO3_IPP_IND_G_IN_4_SELECT_INPUT,
> + INPUT_CTL_PATH1);
> + gpio_direction_output(MX51EVK_LCD_BACKLIGHT, 1);
> +}
> +
> +void lcd_enable(void)
> +{
> + int ret = mx51_fb_init(&claa_wvga, 1, IPU_PIX_FMT_RGB565);
> + if (ret)
> + printf("LCD cannot be configured: %d\n", ret);
> +}
> +
> int board_early_init_f(void)
> {
> setup_iomux_uart();
> @@ -460,6 +514,7 @@ int board_early_init_f(void)
> #ifdef CONFIG_USB_EHCI_MX5
> setup_usb_h1();
> #endif
> + lcd_iomux();
>
> return 0;
> }
> @@ -469,6 +524,8 @@ int board_init(void)
> /* address of boot parameters */
> gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
>
> + lcd_enable();
> +
> return 0;
> }
>
> @@ -479,6 +536,8 @@ int board_late_init(void)
> setup_iomux_spi();
> power_init();
> #endif
> + setenv("stdout", "serial");
> +
> return 0;
> }
> #endif
> diff --git a/include/configs/mx51evk.h b/include/configs/mx51evk.h
> index 1477b21..58b6f1c 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 (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_BMP_16BPP
> +#define CONFIG_VIDEO_LOGO
> +
> /* allow to overwrite serial and ethaddr */
> #define CONFIG_ENV_OVERWRITE
> #define CONFIG_CONS_INDEX 1
No issue on my side, here my:
Acked-by: Stefano Babic <sbabic@denx.de>
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] mx51evk: Add LCD support
2012-05-09 16:39 [U-Boot] [PATCH] mx51evk: Add LCD support Fabio Estevam
2012-05-10 10:11 ` Stefano Babic
@ 2012-05-25 8:09 ` Anatolij Gustschin
1 sibling, 0 replies; 3+ messages in thread
From: Anatolij Gustschin @ 2012-05-25 8:09 UTC (permalink / raw)
To: u-boot
Hi,
On Wed, 9 May 2012 13:39:41 -0300
Fabio Estevam <fabio.estevam@freescale.com> wrote:
> Add support for CLAA07LC0ACW LCD that connects to the mx51evk 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@freescale.com>
> ---
> board/freescale/mx51evk/mx51evk.c | 59 +++++++++++++++++++++++++++++++++++++
> include/configs/mx51evk.h | 13 +++++++-
> 2 files changed, 71 insertions(+), 1 deletions(-)
Applied to u-boot-video/master, thanks!
Anatolij
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-05-25 8:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-09 16:39 [U-Boot] [PATCH] mx51evk: Add LCD support Fabio Estevam
2012-05-10 10:11 ` Stefano Babic
2012-05-25 8:09 ` Anatolij Gustschin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox