Configuring i.MX6 boards for different screens

One of the first hurdles to a great out-of-the-box-experience we have on i.MX6 at the moment is configuration of screen resolutions. We’re aiming to support four different displays on the Nitrogen6X and Sabre Lite:

Unfortunately, our set of tools doesn’t yet support automatic detection of the displays, so we’ve been using a number of work arounds. In this post, we’ll describe the general state of affairs and hopefully let you know how to set things up for your use.

U-Boot

To begin with, the U-Boot versions we’re shipping don’t yet support displays. Fabio Estevan published some patches that allow Sabre Lite to support the Freescale panel and we have some patches gathering dust that support the RGB display and our 1024×600 panel, but we haven’t yet released this into our shipments.

This is yet another reason for us to make the transition to main-line U-Boot.

Linux

The Linux kernels we’re shipping do contain support for all four displays listed above. You can configure them through the kernel command line (bootargs in U-Boot).

In the various releases, this is either done by a generic boot script which expects you to set and save a persistent bootargs or bootargs_base variable, or has a set of boot scripts with various settings hard-coded in the boot script.

Kernel parameters

The kernel parameter values for the displays are:
Display Setting
7″ 800×480 resistive touch mxcfb0:dev=lcd,CLAA-WVGA,if=RGB666
7″ 1024×600 capacitive multi-touch mxcfb0:dev=ldb,1024x600M@60,if=RGB666
Freescale’s LVDS1 mxcfb0:dev=ldb,LDB-XGA,if=RGB666
HDMI at 720P mxcfb0:dev=hdmi,1280x720M@60,if=RGB24
Note that there are four components to the video= clause:
mxcfbN: This display specifier defines the ordering of display devices under Linux. Note that there is not a 1:1 correspondence with /dev/fbN because /dev/fb1 and /dev/fb3 will be automatically configured as overlay devices for /dev/fb0 and /dev/fb2.
dev=X This clause specifies the output interface used for the display. Options are lcd for the parallel RGB interface, ldb for the LVDS interface and hdmi for the HDMI transmitter.
displayname or resolution This clause can either define a named panel such as LDB-XGA or CLAA-WVGA or a resolution in VESA Coordinated Video Timings format. Named panels are defined in a board-specific file.
if=depth This clause defines the output format at the transmitter. Options include RGB666 for 18-bit panels and RGB24 for 24-bit displays. Note that this does not define the in memory bit depth of the frame buffer. That’s done with the bpp= kernel command-line parameter.

Distribution-specific notes

Android

Our Android image contains support for four different display resolutions through separate boot scripts:
-rwxr-xr-x 1 root root 887 2012-05-21 12:24 6q_bootscript
-rwxr-xr-x 1 root root 466 2012-04-15 20:57 6q_bootscript.1080p
-rwxr-xr-x 1 root root 342 2012-04-03 19:04 6q_bootscript.7inresistive
-rwxr-xr-x 1 root root 382 2012-04-03 19:05 6q_bootscript.dual_hdmi_hannstar
-rwxr-xr-x 1 root root 338 2012-04-03 19:01 6q_bootscript.hannstar
The default boot script will attempt to determine whether HDMI is supported using the hdmidet command. In order for this to function, a Boundary Devices U-Boot image newer than April 12, 2012 must be running. If present, a 720P HDMI display will be configured as the primary display and a WVGA display will be configured as a secondary (or vice versa).

Support for the 1024×600 LVDS panel was added after the Android image was built. Please note the notes in the comment section for a description of how to add support for this panel.

Timesys

Timesys images generally expect you to define the bootargs variable to contain a display reference:
U-Boot> setenv bootargs mxcfb0:dev=hdmi,1280x720M@60,if=RGB24
U-Boot> saveenv
U-Boot> run bootcmd

Windows CE

Windows Embedded Compact 7 from Adeneo contains two support for HDMI and the Freescale LVDS1 panel in the form of two separate O/S images (NK*.bin).

QNX

At the time of this writing, only the 7″ Parallel RGB display is supported in QNX.

Known issues

There is a known bug in the HDMI driver which causes display corruption if an HDMI monitor is either disconnected and reconnected or powered down and back up during operation.

Tags:

20 Responses to “Configuring i.MX6 boards for different screens”

  1. ericn July 25, 2012 5:56 pm #

    A customer just reminded me of an outstanding bug related to Ubuntu releases and the 7″ display.

    It appears that something in the startup of X decides to re-configure the display and in the process, bit 17 of the IPU1_DI0_GENERAL register gets cleared to zero. This bit defines the pixel clock polarity and this will result in visible artifacts on the display.

    If you see this problem, you can use the ‘devregs’ tool at http://boundarydevices.com/devregs.zip to verify the symptom and temporarily fix it.

        root@linaro-ubuntu-desktop:~# devregs IPU1_DI0_GENERAL
        IPU1_DI0_GENERAL:0x02640000    =0x00300004
    
        root@linaro-ubuntu-desktop:~# devregs IPU1_DI0_GENERAL 0x00320004
        IPU1_DI0_GENERAL:0x02640000    =0x00300004
        IPU1_DI0_GENERAL:0x02640000 == 0x00300004...0x00320004
    

    You can read about devregs in this post:
    http://boundarydevices.com/i-mx5x-device-register-access/

    And you can get the sources here:
    https://github.com/boundarydevices/imx-utils

  2. ericn July 27, 2012 4:49 pm #

    The cabling for either LVDS displays uses two connections on the Sabre Lite or Nitrogen6X board and a single connection on the display end.

    We have custom cables for the Freescale LVDS1 display as shown in this photo:
    http://boundarydevices.com/?attachment_id=1535

    This photo shows how the cabling is routed to J6 and J7 on a Sabre Lite.
    http://boundarydevices.com/?attachment_id=1536

    • Michael January 14, 2013 7:13 am #

      Is there a pinout / schematic on the adapter cable that you have?
      Curious on how the signals are mapped between the connectors.

      • ericn January 14, 2013 8:17 am #

        The Hardware user manual for each of our products lists the pin-outs for each of the displays.

        The schematic for the SABRE Lite is also available in the Support tab of the product page.

        The data sheets for each of the panels (7″ 1024×600, 7″ 800×480) we distribute are also available in their respective Support tabs.

  3. ericn August 7, 2012 9:32 am #

    We just noticed that the Hannstar boot scripts in the Android image were missing a ‘vmalloc=400M’ clause, which caused them to fail allocating frame buffers.

    The zip file at http://boundarydevices.com/hannstar-android-bootscripts.zip contains updates.

  4. bmy September 3, 2012 4:56 am #

    I’m using the lvds output wich is working fine. I wonder if it is possible to rotate the screen to 90° clockwise. I haven’t found any kernel arguments or tutorials using xrandr.

    • ericn September 3, 2012 8:02 am #

      Hi bmy,

      This isn’t really i.MX6 specific, but we wrote some notes about X-Windows rotation under LTIB here:
      http://boundarydevices.com/portrait-mode-x-on-i-mx51/

      If you read the comments, there are some notes about Debian and the console as well.

      Regards,

      Eric

      • bmy September 3, 2012 10:58 am #

        Thank you for your comment eric. Unfortunately I do not use LTIB but an Ubuntu 12.03 version. According to the comments I would have to follow a set of patches to perform on my system. Unfortunately I do not have the time to. I remember that most of the systems allowed several kernel arguments, why does the freescale drivers do not provide a corresponding implementation?

  5. zwitt September 18, 2012 12:45 pm #

    Hi Eric,

    for our application we need a 10″ PCAP display.
    Could you please check if it were possible that display :
    https://docs.google.com/open?id=0B0nxV5k1OdqER1pSN2hqWUVXU0U
    to the sabre board to connect ?
    If necessary, what should be done so that it works ?

    Thanks and Best Regards from Görlitz

    Zbig

    PS Sorry for my poor English

    • ericn September 18, 2012 1:42 pm #

      It certainly looks straightforward at first glance. You’ll need at least a custom cable to match up with J6 (LVDS) and J7 (Power/I2C) as shown
      in the SABRE Lite schematics.

      Backlight control is usually the hardest part of this kind of integration, but I’d be surprised if it required much if any additional circuitry.

  6. David February 5, 2013 12:40 pm #

    I have an HDMI TV display running that is not responding to the edid inquiry. I would like to change the default mode list so that I can get sound over the HDMI into the TV. Where is this list and is it persistent and editable?

    • ericn February 5, 2013 2:44 pm #

      I don’t know of an easy way to over-ride this, either through command-line or code edits. This is on our “like to fix” list, since for many applications, it’s the right thing to force a particular output resolution and config.

      You might want to reach out to others on i.MX Community to see if someone’s tackled this before.

  7. Alexander February 25, 2013 4:31 pm #

    Hi, we are using Sabre Lite board with 7″ 1024x×600 LVDS display for our SW development.
    Okaya specification saying that this display is capable to work in 6bit/8bit modes. I measured the SELB pin (#28) on LCD Daughter board: HIGH level, which is 6 bit mode.
    Are there any suggestions of how to turn this display into 8bit LVDS (24-bit color) mode? Some mods on LCD Daughter board somebody tried already? Thank You.

    • ericn February 26, 2013 5:27 pm #

      Hi Alexander,

      We’ll run this test when time permits.

      If you’re in a position to pull the pin low, you can test it from a software side
      by simply changing the ‘if=RGB666′ to ‘if=RGB24′ on the kernel command-line.

  8. Paul DeMetrotion March 27, 2013 8:59 am #

    I am looking for some video assistance on a custom i.MX6Q board we have in development. Currently I have HDMI and LVDS displays connected. When I boot our Ubuntu Linux kernel, only the video source which is attached to mxcfb0 displays the GUI. I can still utilize both displays using gstreamer. Should I be able to use both displays to extend the Ubuntu GUI? If so is the xorg.conf file used to set this up?

    Earlier in the boot cycle only the selected display displays the Linux penguins while the other display isn’t even in sync. Once the file system starts to load both displays get in sync. Following is the u-boot environment variables:
    bootargs=console=ttymxc0,115200 video=mxcfb0:dev=hdmi,1280x720M@60,if=RGB24 video=mxcfb1:dev=ldb,1024x600M@60,if=RGB666

    If I switch the fb0 and fb1 variables, then the LVDS display works and the HDMI display does not.

    Is there something within my custom board files that control which display gets enabled? How do I get both displays to work during the early boot cycle? I would expect to see penguins on both displays.

    Thanks is advance.

    • ericn March 27, 2013 1:43 pm #

      Hi Paul,

      I’m not certain what X magic is needed to drive both displays. I suspect that it involves Xinerama, but that could be wrong.

      I can explain the early boot cycle thing: U-Boot only has support for one display. Re-working it to support multiple would require hacking drivers/video/mxc_ipuv3_fb.c and associated modules in the U-Boot sources.

      • PaulD March 27, 2013 2:49 pm #

        Eric,
        Thanks for the response. I have been playing with Xinerama without any luck so far.

        Should I be able to have dual displays when the uImage is booting? I have an iWave board that displays penguins on both displays after u-boot hands off to the uImage kernel boot. Our custom board only displays penguins on the display that is mapped to fb0, either hdmi or lvds. Not a big deal but would like to have both if possible. The display mapped to fb1 never even syncs until late in the kernel boot.

        • ericn March 27, 2013 3:19 pm #

          Hi Paul,

          Nice dig with the “my iWave board does ….” ;)

          Penguins are easy though. You’ll just need to unblank /dev/fb2 somewhere in the boot process:

          # echo 0 > /sys/class/graphics/fb2/blank
          

          Note that /dev/fb1 is the YUV overlay associated with /dev/fb0 though. It’s not normally the second display.

          You can get a more complete picture through this bit of shell-fu to browse the /sys tree:

          for fb in /sys/class/graphics/fb? ; do
               echo "----------- $fb";
               cat $fb/name;
               cat $fb/mode;
               cat $fb/fsl_disp_*;
          done
          
  9. PaulD March 28, 2013 11:29 am #

    New finding on the Dual Screen issue with our iMX6Q custom board. I found the following error in my Xorg.0.log file – Screen 1 deleted because of no matching config section. This would explain why I cannot utilize the second display. Any ideas what is missing?

    [ 73.592] (II) VIVANTE: fb driver for vivante: VivanteGC500, VivanteGC2100,
    VivanteGCCORE
    [ 73.593] (++) using VT number 7

    [ 73.593] (WW) Falling back to old probe method for vivante
    [ 73.593] (II) Loading sub module “fbdevhw”
    [ 73.593] (II) LoadModule: “fbdevhw”
    [ 73.594] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
    [ 73.605] (II) Module fbdevhw: vendor=”X.Org Foundation”
    [ 73.605] compiled for 1.10.4, module version = 0.0.2
    [ 73.605] ABI class: X.Org Video Driver, version 10.0
    [ 73.606] (II) Loading /usr/lib/xorg/modules/drivers/vivante_drv.so
    [ 73.606] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
    [ 73.606] (II) VIVANTE(0): using default device
    [ 73.606] (II) Loading /usr/lib/xorg/modules/drivers/vivante_drv.so
    [ 73.606] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
    [ 73.606] (II) VIVANTE(1): using default device
    [ 73.606] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
    [ 73.606] (EE) Screen 1 deleted because of no matching config section.
    [ 73.606] (II) UnloadModule: “vivante”
    [ 73.606] (II) Unloading vivante
    [ 73.606] (II) UnloadModule: “fbdevhw”
    [ 73.606] (II) Unloading fbdevhw
    [ 73.607] (II) VIVANTE(0): Creating default Display subsection in Screen section

  10. Soujanya April 8, 2013 11:53 pm #

    Hello,
    I am interfacing 1920X1080 LVDS bit display with IMX6 custom board(sabrelite).I changed the u-boot environment variables as below: video=mxcfb0:dev=ldb,LDB-1080P60,if=RGB24,ldb=spl0,
    but i am unable to see anything on the display, are there any other configurations that need to taken care of?

Leave a Reply