Add video support to mx51evk board
PATCH 2/2 Add video support to mx51evk board
Adds video support to mx51evk board, this board allows different displays.
This patch enables the WVGA TFT LCD panel only, remove comments from include/configs/mx51evk.h to use it.
--- board/freescale/mx51evk/mx51evk.c | 56 +++++++++++++++++++++++++++++++++++++ include/configs/mx51evk.h | 11 +++++++ 2 files changed, 67 insertions(+), 0 deletions(-)
(quoted diff) +0 -0
b/board/freescale/mx51evk/mx51evk.c
index 2160d5a..884ae73 100644
board/freescale/mx51evk/mx51evk.c +6 -0
@@ -34,9 +34,37 @@#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] = {
@@ -148,6 +176,33 @@ static void setup_iomux_fec(void)
mxc_iomux_set_pad(MX51_PIN_NANDF_D11, 0x2180);
}
+#ifdef CONFIG_LCD
+void setup_iomux_ipu(void)
+{
+ /* 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, 0x85);
+ 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, 0x80);
+
+}
+
+void lcd_enable(void)
+{
+ int ret;
+
+ 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,6 +464,7 @@ int board_init(void)
setup_iomux_uart();
setup_iomux_fec();
+ setup_iomux_ipu();
return 0;
}
include/configs/mx51evk.h +11 -0
@@ -211,6 +211,17 @@#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
*/
Signature · 1 line
1.6.0.4
PATCH 2/2 Add video support to mx51evk board
Quoted 3 lines · On 11/02/2010 06:16 AM, Frias Renato-B13784 wrote:
Adds video support to mx51evk board, this board allows different displays. This patch enables the WVGA TFT LCD panel only, remove comments from
include/configs/mx51evk.hto use it.
This patch is corrupted as the first one by your mailer.
Quoted 7 lines
(quoted diff) +7
-0+#ifdef CONFIG_LCD +static struct fb_videomode claa_wvga = { + "CLAA07LC0ACW", + 57, /* Refresh */+ + 800, /* xres */ + 480, /* yres */ + 37037, /* pixclock = 27Mhz */
Review
Quoted 10 lines
(quoted diff) +10
-0+ 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 */ +};
It seems you start with trailing whitespaces instead of tabs
Review
Quoted 6 lines
(quoted diff) +6
-0+#ifdef CONFIG_LCD +void setup_iomux_ipu(void) +{ + /* 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, 0x85);
With the vision2 I introduced constants to set pads (PAD_CTL_*). At least for new values, you should use it.
Review
Quoted 3 lines
(quoted diff) +3
-0+ /* DISP2_DRDY pin */ + mxc_request_iomux(MX51_PIN_DI_GP4, IOMUX_CONFIG_ALT4); + mxc_iomux_set_pad(MX51_PIN_DI_GP4, 0x80);
Ditto
include/configs/mx51evk.h line 217
Quoted 12 lines
include/configs/mx51evk.h +4
-0@@ -211,6 +211,17 @@#define CONFIG_SYS_DDR_CLKSEL 0#define CONFIG_SYS_CLKTL_CBCDR 0x59E35100 +/* +* Framebuffer and LCD +*/ +/*
Are the new defines inside a comment ?
include/configs/mx51evk.h line 223
Quoted 6 lines
include/configs/mx51evk.h +6
-0+#define CONFIG_LCD +#define CONFIG_VIDEO_MX5 +#define LCD_BPP LCD_COLOR16 +#define CONFIG_CMD_BMP +#define CONFIG_BMP_16BPP +*/
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de =====================================================================
PATCH 2/2 Add video support to mx51evk board
Hello Stefano B,
Quoted 1 line · Stefano Babic
This patch is corrupted as the first one by your mailer.
I'm really sorry, I'll submit again.
Quoted 1 line
It seems you start with trailing whitespaces instead of tabs
I will fix on the next patch.
Quoted 2 lines
With the vision2 I introduced constants to set pads (PAD_CTL_*). At least for new values, you should use it.
Ok!.
Quoted 1 line
Are the new defines inside a comment ?
Yes, they are. Only those working with the WVGA display will benefit from it. There is no video support the LVDS or DVI output yet.
Do you have any recommendation here?
Best Regards,
Renato
PATCH 2/2 Add video support to mx51evk board
Quoted 3 lines · Renato Frias
Yes, they are. Only those working with the WVGA display will benefit from it. There is no video support the LVDS or DVI output yet.
Do you have any recommendation here?
I think the best way is Wolfgang's suggestion, and to use a video variable "video-mode=" for that. Extending his suggestion, we can use something like "video-mode=<display-name>:<xres>x<yres>x<bpp>@<freq>" and basing on the display name we can decide in lcd_enable() if we should activate the IPU or not. If the name matches the WVGA, the mx51evk can enable the lcd stuff at runtime.
Best regards,
Stefano
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de =====================================================================