]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
MX51: Add video support to vision2 board
authorStefano Babic <sbabic@denx.de>
Thu, 21 Oct 2010 08:34:39 +0000 (10:34 +0200)
committerAnatolij Gustschin <agust@denx.de>
Thu, 21 Oct 2010 22:05:05 +0000 (00:05 +0200)
The patch adds support for LCD to the vision2 board.

Signed-off-by: Stefano Babic <sbabic@denx.de>
board/ttcontrol/vision2/vision2.c
include/configs/vision2.h

index ce4cb78e9811f7e2f276b9dc8f7c3b7c7246f71f..071dad66c4e68e3353a37f2fe67f731b4c3074dc 100644 (file)
 #include <fsl_esdhc.h>
 #include <fsl_pmic.h>
 #include <mc13892.h>
+#include <linux/fb.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
 static u32 system_rev;
 
+extern int mx51_fb_init(struct fb_videomode *mode);
+
 #ifdef CONFIG_HW_WATCHDOG
 #include <watchdog.h>
 
+static struct fb_videomode nec_nl6448bc26_09c = {
+       "NEC_NL6448BC26-09C",
+       60,     /* Refresh */
+       640,    /* xres */
+       480,    /* yres */
+       37650,  /* pixclock = 26.56Mhz */
+       48,     /* left margin */
+       16,     /* right margin */
+       31,     /* upper margin */
+       12,     /* lower margin */
+       96,     /* hsync-len */
+       2,      /* vsync-len */
+       0,      /* sync */
+       FB_VMODE_NONINTERLACED, /* vmode */
+       0,      /* flag */
+};
+
 void hw_watchdog_reset(void)
 {
        int val;
@@ -423,6 +443,9 @@ static void setup_gpios(void)
        mxc_request_iomux(MX51_PIN_CSPI1_RDY, IOMUX_CONFIG_ALT3);
        mxc_iomux_set_pad(MX51_PIN_CSPI1_RDY, 0x82);
 
+       /* PWM Output GPIO1_2 */
+       mxc_request_iomux(MX51_PIN_GPIO1_2, IOMUX_CONFIG_ALT1);
+
        /*
         * Set GPIO1_4 to high and output; it is used to reset
         * the system on reboot
@@ -630,6 +653,33 @@ int board_early_init_f(void)
        return 0;
 }
 
+static void backlight(int on)
+{
+       if (on) {
+               mxc_gpio_set(65, 1);
+               udelay(10000);
+               mxc_gpio_set(68, 1);
+       } else {
+               mxc_gpio_set(65, 0);
+               mxc_gpio_set(68, 0);
+       }
+}
+
+void lcd_enable(void)
+{
+       int ret;
+
+       mxc_request_iomux(MX51_PIN_DI1_PIN2, IOMUX_CONFIG_ALT0);
+       mxc_request_iomux(MX51_PIN_DI1_PIN3, IOMUX_CONFIG_ALT0);
+
+       mxc_gpio_set(2, 1);
+       mxc_request_iomux(MX51_PIN_GPIO1_2, IOMUX_CONFIG_ALT0);
+
+       ret = mx51_fb_init(&nec_nl6448bc26_09c);
+       if (ret)
+               puts("LCD cannot be configured\n");
+}
+
 int board_init(void)
 {
 #ifdef CONFIG_SYS_ARM_WITHOUT_RELOC
@@ -709,3 +759,21 @@ int checkboard(void)
        return 0;
 }
 
+int do_vision_lcd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+       int on;
+
+       if (argc < 2)
+               return cmd_usage(cmdtp);
+
+       on = (strcmp(argv[1], "on") == 0);
+       backlight(on);
+
+       return 0;
+}
+
+U_BOOT_CMD(
+       lcdbl, CONFIG_SYS_MAXARGS, 1, do_vision_lcd,
+       "Vision2 Backlight",
+       "lcdbl [on|off]\n"
+);
index a2ecbe50d63f5b524f3d5c4114d5799cfff6eac8..d2d956524764c055addab748ca34b561e3500823 100644 (file)
 
 #define CONFIG_SYS_NO_FLASH
 
+/*
+ * Framebuffer and LCD
+ */
+#define CONFIG_PREBOOT
+#define CONFIG_LCD
+#define CONFIG_VIDEO_MX5
+#define CONFIG_SYS_CONSOLE_ENV_OVERWRITE
+#define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
+#define CONFIG_SYS_CONSOLE_IS_IN_ENV
+#define LCD_BPP                LCD_COLOR16
+#define CONFIG_SPLASH_SCREEN
+#define CONFIG_CMD_BMP
+#define CONFIG_BMP_16BPP
+
 #endif                         /* __CONFIG_H */