February 26, 2012   Posted by: Dr. Ace Jeangle

How to setup correct LCD resolution

Most of modern LCD panels have embedded EEPROM memory with I2C interface that stores important information about its capabilities (including LCD resolution). This data usually takes 128 bytes and is referred as Extended Display Identification Data (EDID). Linux kernel searches for available EEPROM memories during startup and read this data.

Our v2 PCB uses a little bit different approach. It does not provide direct access from baseboard to LCD EDID info. Instead of this, it has PIC controller with embedded EEPROM, that can be programmed with EDID information and will pretend to baseboard to be LCD EDID EEPROM. This was done for three main reasons:

  1. Baseboard (BeagleBoard/PandaBoard) uses 1.8V level for I2C bus, but LCD requires 3.3V. So, we saved couple bucks on level translator (and you saved as well :).
  2. We get LVDS cables from LCD supplier without these 4 lines for EDID access. This is normal situation for LCDs that are supplied for notebooks. Making custom LVDS cable would increase the final price of our bundle.
  3. Some displays have different modes of operation with different resolution. And you can easy program different EDID data to PIC controller and switch between them during start-up.

Our current PIC firmware (version 1.0) does not include EDID procedure. New version with EDID support will be published soon. Therefore, below is short guide on manual changing of LCD resolution for Ubuntu and Android.

Linux kernel allows to assign manual LCD resolution in bootargs supplied by u-boot. This is usually done by script called “boot.scr” in “boot” partition that is loaded and executed by u-boot. “boot.scr” has special format and usually is created with the help of “mkimage” util from source file called “boot.txt”. Below is example of my “boot.txt” that I use for Android (Linaro build 12.01):

setenv initrd_high "0xffffffff"
setenv fdt_high "0xffffffff"
setenv bootcmd "fatload mmc 0:1 0x80200000 uImage; fatload mmc 0:1 0x81600000 uInitrd; bootm 0x80200000 0x81600000"
setenv bootargs "console=ttyO2,115200n8 rootwait ro earlyprintk fixrtc nocompcache vram=48M omapfb.vram=0:24M,1:24M [email protected] [email protected] [email protected] init=/init androidboot.console=ttyO2"

and for Ubuntu:

fatload mmc 0:1 0x80000000 uImage
fatload mmc 0:1 0x81600000 uInitrd
setenv bootargs ro elevator=noop vram=12M omapfb.mode=dvi:[email protected]
bootm 0x80000000 0x81600000

You should consider above “boot.txt” files as examples only, because they highly depend on OS and baseboard that you use.

The most important bootarg here is “[email protected]” – that’s exactly where we setup LCD resolution. 1024×600 sets resolution, “M” indicates the kernel will calculate a VESA mode on-the-fly instead of using modedb look-up, the “R” indicates reduced blanking which is for LCD panels, “16” is the color depth, “@60” is the # of frames per second.

Lets generate “boot.scr” file with the following commands:

mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "Run uImage" -d boot.txt boot.scr
chmod a+x boot.scr

“mkimage” is available in package “uboot-mkimage”.

Now copy generate “boot.scr” file to boot partition on your SD card, unmount it, put into baseboard and try. You should have native 1024×600 resolution now.

28 comments posted in: How-To