uboot-lvds-panel-configuration

uboot lvds panel configuration

Environment

U-BOOT version: 2014

Source Reference:

Git: http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/
Branch: imx_v2014.04_3.10.53_1.1.0_ga File: ~/board/freescale/mx6sabresd/mx6sabresd.c

reference example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
static struct display_info_t const displays[] {
{
.bus = -1, .addr = 0, .pixfmt = IPU_PIX_FMT_RGB666, // IPU_PIX_FMT_RGB24
.detect = NULL,
.enable = NULL,
.mode = {
.name = "Hannstar-XGA",
.refresh = 60,
.xres = 1024,
.yres = 768,
.pixclock = 15385,
.left_margin = 220,
.right_margin = 40,
.upper_margin = 21,
.lower_margin = 7,
.hsync_len = 60,
.vsync_len = 10,
.sync = FB_SYNC_EXT,
.vmode = FB_VMODE_MONINTERLAED,
}
},
  • pixfmt: 18bit or 24bit

    • IPU_PIX_FMT_RGB666

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      static void setup_display(void)
      {
      ...
      reg = IOMUXC_GPR2_BGREF_PRMODE_EXTERNAL_RES
      ...
      | IOMUXC_GPR2_DATA_WIDTH_CH1_18BIT
      ...
      | IOMUXC_GPR2_DATA_WIDTH_CH0_18BIT
      }
      ```
      - `IPU_PIX_FMT_RGB24`

      static void setup_display(void)

      {
          ...
          reg = IOMUXC_GPR2_BGREF_PRMODE_EXTERNAL_RES
          ...
              | IOMUXC_GPR2_DATA_WIDTH_CH1_24BIT
          ...
              | IOMUXC_GPR2_DATA_WIDTH_CH0_24BIT
      }
      
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      24
      25
      26
      27
      28
      29
      30
      31
      - name: panel name checked in boot-env setting `panel`
      - refresh: refresh rate, set to typical
      - xres: x resolution / active width / H-display area
      - yres: y resolution / active height / V-display area
      - pixclock: pixel clock
      - calculate formula: `pixclock=(10^12)/clk_freq` (clk_freq: DCLK freq)
      - pixclock = `10^12 / (1024+220+40+60) * (768+21+7+10) * 60` = `15385 ps` (ps: pico-sencond, 10^(-12) second
      - Horizontal
      - left_margin: left margin / HS back porch (HBP)
      - right_margin: right margin / HS front porch (HFP)
      - hsync_len: horizontal sync length / HS pulse width (HPW)
      - Horizontal blanking time: HBP + HFP
      - Vertical
      - upper_margin: upper margin / VS back porch (VBP)
      - lower_margin: lower margin / VS front porch (VFP)
      - vsync_len: vertical sync length / VS pulse width (VPW)
      - Vertical blanking time: VBP + VFP
      - sync: FB_SYNC_EXT, external sync
      ~/drivers/video/videomodes.h
      - vmode: this is a progressive video mode, so set vmode to FB_VMODE_NONINTERLACED.
      ~/drivers/video/videomodes.h
      ## HDMI Full HD 1920x1080

{ .bus = -1, .addr = 0, .pixfmt = IPU_PIX_FMT_RGB24, .detect = NULL, .enable = do_enable_hdmi, .mode = { .name = “HDMI”, .refresh = 60, .xres = 640, .yres = 480, .pixclock = 39721, .left_margin = 48, .right_margin = 16, .upper_margin = 33, .lower_margin = 10, .hsync_len = 96, .vsync_len = 2, .sync = 0, .vmode = FB_VMODE_NONINTERLACED } } ```