]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - board/compulab/common/omap3_display.c
Merge branch 'u-boot/master' into 'u-boot-arm/master'
[karo-tx-uboot.git] / board / compulab / common / omap3_display.c
index fae8d95403c1b5fc3da31f2a509bf1e1f8eabe67..61707f5b900e2f0278773592c72ce83bb3e6fb52 100644 (file)
@@ -14,6 +14,7 @@
 #include <stdio_dev.h>
 #include <asm/arch/dss.h>
 #include <lcd.h>
+#include <scf0403_lcd.h>
 #include <asm/arch-omap3/dss.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -22,6 +23,7 @@ enum display_type {
        NONE,
        DVI,
        DVI_CUSTOM,
+       DATA_IMAGE, /* #define CONFIG_SCF0403_LCD to use */
 };
 
 #define CMAP_ADDR      0x80100000
@@ -51,6 +53,7 @@ static const struct panel_config preset_dvi_640X480 = {
        .lcd_size       = PANEL_LCD_SIZE(640, 480),
        .timing_h       = DSS_HBP(48) | DSS_HFP(16) | DSS_HSW(96),
        .timing_v       = DSS_VBP(33) | DSS_VFP(10) | DSS_VSW(2),
+       .pol_freq       = DSS_IHS | DSS_IVS | DSS_IPC,
        .divisor        = 12 | (1 << 16),
        .data_lines     = LCD_INTERFACE_24_BIT,
        .panel_type     = ACTIVE_DISPLAY,
@@ -62,6 +65,7 @@ static const struct panel_config preset_dvi_800X600 = {
        .lcd_size       = PANEL_LCD_SIZE(800, 600),
        .timing_h       = DSS_HBP(88) | DSS_HFP(40) | DSS_HSW(128),
        .timing_v       = DSS_VBP(23) | DSS_VFP(1) | DSS_VSW(4),
+       .pol_freq       = DSS_IHS | DSS_IVS | DSS_IPC,
        .divisor        = 8 | (1 << 16),
        .data_lines     = LCD_INTERFACE_24_BIT,
        .panel_type     = ACTIVE_DISPLAY,
@@ -73,6 +77,7 @@ static const struct panel_config preset_dvi_1024X768 = {
        .lcd_size       = PANEL_LCD_SIZE(1024, 768),
        .timing_h       = DSS_HBP(160) | DSS_HFP(24) | DSS_HSW(136),
        .timing_v       = DSS_VBP(29) | DSS_VFP(3) | DSS_VSW(6),
+       .pol_freq       = DSS_IHS | DSS_IVS | DSS_IPC,
        .divisor        = 5 | (1 << 16),
        .data_lines     = LCD_INTERFACE_24_BIT,
        .panel_type     = ACTIVE_DISPLAY,
@@ -84,7 +89,8 @@ static const struct panel_config preset_dvi_1152X864 = {
        .lcd_size       = PANEL_LCD_SIZE(1152, 864),
        .timing_h       = DSS_HBP(256) | DSS_HFP(64) | DSS_HSW(128),
        .timing_v       = DSS_VBP(32) | DSS_VFP(1) | DSS_VSW(3),
-       .divisor        = 3 | (1 << 16),
+       .pol_freq       = DSS_IHS | DSS_IVS | DSS_IPC,
+       .divisor        = 4 | (1 << 16),
        .data_lines     = LCD_INTERFACE_24_BIT,
        .panel_type     = ACTIVE_DISPLAY,
        .load_mode      = 2,
@@ -95,6 +101,7 @@ static const struct panel_config preset_dvi_1280X960 = {
        .lcd_size       = PANEL_LCD_SIZE(1280, 960),
        .timing_h       = DSS_HBP(312) | DSS_HFP(96) | DSS_HSW(112),
        .timing_v       = DSS_VBP(36) | DSS_VFP(1) | DSS_VSW(3),
+       .pol_freq       = DSS_IHS | DSS_IVS | DSS_IPC,
        .divisor        = 3 | (1 << 16),
        .data_lines     = LCD_INTERFACE_24_BIT,
        .panel_type     = ACTIVE_DISPLAY,
@@ -106,6 +113,7 @@ static const struct panel_config preset_dvi_1280X1024 = {
        .lcd_size       = PANEL_LCD_SIZE(1280, 1024),
        .timing_h       = DSS_HBP(248) | DSS_HFP(48) | DSS_HSW(112),
        .timing_v       = DSS_VBP(38) | DSS_VFP(1) | DSS_VSW(3),
+       .pol_freq       = DSS_IHS | DSS_IVS | DSS_IPC,
        .divisor        = 3 | (1 << 16),
        .data_lines     = LCD_INTERFACE_24_BIT,
        .panel_type     = ACTIVE_DISPLAY,
@@ -113,6 +121,18 @@ static const struct panel_config preset_dvi_1280X1024 = {
        .gfx_format     = GFXFORMAT_RGB16,
 };
 
+static const struct panel_config preset_dataimage_480X800 = {
+       .lcd_size       = PANEL_LCD_SIZE(480, 800),
+       .timing_h       = DSS_HBP(2) | DSS_HFP(2) | DSS_HSW(2),
+       .timing_v       = DSS_VBP(17) | DSS_VFP(20) | DSS_VSW(3),
+       .pol_freq       = DSS_IVS | DSS_IHS | DSS_IPC | DSS_ONOFF,
+       .divisor        = 10 | (1 << 10),
+       .data_lines     = LCD_INTERFACE_18_BIT,
+       .panel_type     = ACTIVE_DISPLAY,
+       .load_mode      = 2,
+       .gfx_format     = GFXFORMAT_RGB16,
+};
+
 /*
  * set_resolution_params()
  *
@@ -140,6 +160,13 @@ static enum display_type set_dvi_preset(const struct panel_config preset,
        return DVI;
 }
 
+static enum display_type set_dataimage_preset(const struct panel_config preset,
+               int x_res, int y_res)
+{
+       set_preset(preset, x_res, y_res);
+       return DATA_IMAGE;
+}
+
 /*
  * parse_mode() - parse the mode parameter of custom lcd settings
  *
@@ -363,6 +390,8 @@ static enum display_type env_parse_displaytype(char *displaytype)
                return set_dvi_preset(preset_dvi_1280X960, 1280, 960);
        else if (!strncmp(displaytype, "dvi1280x1024", 12))
                return set_dvi_preset(preset_dvi_1280X1024, 1280, 1024);
+       else if (!strncmp(displaytype, "dataimage480x800", 16))
+               return set_dataimage_preset(preset_dataimage_480X800, 480, 800);
 
        return NONE;
 }
@@ -395,12 +424,31 @@ void lcd_ctrl_init(void *lcdbase)
        clrsetbits_le32(&prcm->clksel_dss, 0xF, 3);
 }
 
+#ifdef CONFIG_SCF0403_LCD
+static void scf0403_enable(void)
+{
+       gpio_direction_output(58, 1);
+       scf0403_init(157);
+}
+#else
+static inline void scf0403_enable(void) {}
+#endif
+
 void lcd_enable(void)
 {
-       if (lcd_def == DVI || lcd_def == DVI_CUSTOM) {
+       switch (lcd_def) {
+       case NONE:
+               return;
+       case DVI:
+       case DVI_CUSTOM:
                gpio_direction_output(54, 0); /* Turn on DVI */
-               omap3_dss_enable();
+               break;
+       case DATA_IMAGE:
+               scf0403_enable();
+               break;
        }
+
+       omap3_dss_enable();
 }
 
 void lcd_setcolreg(ushort regno, ushort red, ushort green, ushort blue) {}