]> git.sur5r.net Git - u-boot/blobdiff - drivers/video/fsl_dcu_fb.c
Merge branch 'master' of git://git.denx.de/u-boot-sunxi
[u-boot] / drivers / video / fsl_dcu_fb.c
index c6ed3c40bcedda778fa9821f76eafca839f583f9..9f6e7f83b0fda882cc6a1d801aefcd1315304a38 100644 (file)
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2014 Freescale Semiconductor, Inc.
  *
  * FSL DCU Framebuffer driver
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <asm/io.h>
@@ -104,7 +103,7 @@ static struct fb_videomode fsl_dcu_mode_480_272 = {
 /*
  * This setting is used for Siliconimage SiI9022A HDMI
  */
-static struct fb_videomode fsl_dcu_mode_640_480 = {
+static struct fb_videomode fsl_dcu_cea_mode_640_480 = {
        .name           = "640x480-60",
        .refresh        = 60,
        .xres           = 640,
@@ -120,6 +119,54 @@ static struct fb_videomode fsl_dcu_mode_640_480 = {
        .vmode          = FB_VMODE_NONINTERLACED,
 };
 
+static struct fb_videomode fsl_dcu_mode_640_480 = {
+       .name           = "640x480-60",
+       .refresh        = 60,
+       .xres           = 640,
+       .yres           = 480,
+       .pixclock       = 25175,
+       .left_margin    = 40,
+       .right_margin   = 24,
+       .upper_margin   = 32,
+       .lower_margin   = 11,
+       .hsync_len      = 96,
+       .vsync_len      = 2,
+       .sync           = 0,
+       .vmode          = FB_VMODE_NONINTERLACED,
+};
+
+static struct fb_videomode fsl_dcu_mode_800_480 = {
+       .name           = "800x480-60",
+       .refresh        = 60,
+       .xres           = 800,
+       .yres           = 480,
+       .pixclock       = 33260,
+       .left_margin    = 216,
+       .right_margin   = 40,
+       .upper_margin   = 35,
+       .lower_margin   = 10,
+       .hsync_len      = 128,
+       .vsync_len      = 2,
+       .sync           = 0,
+       .vmode          = FB_VMODE_NONINTERLACED,
+};
+
+static struct fb_videomode fsl_dcu_mode_1024_600 = {
+       .name           = "1024x600-60",
+       .refresh        = 60,
+       .xres           = 1024,
+       .yres           = 600,
+       .pixclock       = 48000,
+       .left_margin    = 104,
+       .right_margin   = 43,
+       .upper_margin   = 24,
+       .lower_margin   = 20,
+       .hsync_len      = 5,
+       .vsync_len      = 5,
+       .sync           = 0,
+       .vmode          = FB_VMODE_NONINTERLACED,
+};
+
 /*
  * DCU register map
  */
@@ -294,7 +341,7 @@ int fsl_dcu_init(unsigned int xres, unsigned int yres,
                    DCU_BGND_R(0) | DCU_BGND_G(0) | DCU_BGND_B(0));
 
        dcu_write32(&regs->mode,
-                   DCU_MODE_BLEND_ITER(DCU_LAYER_MAX_NUM) |
+                   DCU_MODE_BLEND_ITER(2) |
                    DCU_MODE_RASTER_EN);
 
        dcu_write32(&regs->threshold,
@@ -342,7 +389,16 @@ void *video_hw_init(void)
                fsl_dcu_mode_db = &fsl_dcu_mode_480_272;
                break;
        case RESOLUTION(640, 480):
-               fsl_dcu_mode_db = &fsl_dcu_mode_640_480;
+               if (!strncmp(options, "monitor=hdmi", 12))
+                       fsl_dcu_mode_db = &fsl_dcu_cea_mode_640_480;
+               else
+                       fsl_dcu_mode_db = &fsl_dcu_mode_640_480;
+               break;
+       case RESOLUTION(800, 480):
+               fsl_dcu_mode_db = &fsl_dcu_mode_800_480;
+               break;
+       case RESOLUTION(1024, 600):
+               fsl_dcu_mode_db = &fsl_dcu_mode_1024_600;
                break;
        default:
                printf("unsupported resolution %ux%u\n",