{"id":1420,"date":"2012-02-26T13:03:44","date_gmt":"2012-02-26T13:03:44","guid":{"rendered":"http:\/\/www.chalk-elec.com\/?p=1420"},"modified":"2012-03-14T11:58:01","modified_gmt":"2012-03-14T11:58:01","slug":"how-to-setup-correct-lcd-resolution","status":"publish","type":"post","link":"https:\/\/www.chalk-elec.com\/?p=1420","title":{"rendered":"How to setup correct LCD resolution"},"content":{"rendered":"<p>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. <\/p>\n<p>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:<\/p>\n<ol class=\"number-list\">\n<li>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 :).<\/li>\n<li>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.<\/li>\n<li>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.<\/li>\n<\/ol>\n<div class=\"line\"><\/div>\n<p>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.<\/p>\n<p>Linux kernel allows to assign manual LCD resolution in bootargs supplied by u-boot. This is usually done by script called &#8220;boot.scr&#8221; in &#8220;boot&#8221; partition that is loaded and executed by u-boot. &#8220;boot.scr&#8221; has special format and usually is created with the help of &#8220;mkimage&#8221; util from source file called &#8220;boot.txt&#8221;. Below is example of my &#8220;boot.txt&#8221; that I use for Android (Linaro build 12.01):<\/p>\n<pre>\r\nsetenv initrd_high \"0xffffffff\"\r\nsetenv fdt_high \"0xffffffff\"\r\nsetenv bootcmd \"fatload mmc 0:1 0x80200000 uImage; fatload mmc 0:1 0x81600000 uInitrd; bootm 0x80200000 0x81600000\"\r\nsetenv bootargs \"console=ttyO2,115200n8 rootwait ro earlyprintk fixrtc nocompcache vram=48M omapfb.vram=0:24M,1:24M omapfb.video_mode=1024x600MR-16@60 mem=456M@0x80000000 mem=512M@0xA0000000 init=\/init androidboot.console=ttyO2\"\r\nboot\r\n<\/pre>\n<p>and for Ubuntu:<\/p>\n<pre>\r\nfatload mmc 0:1 0x80000000 uImage\r\nfatload mmc 0:1 0x81600000 uInitrd\r\nsetenv bootargs ro elevator=noop vram=12M omapfb.mode=dvi:1024x600MR-16@60\r\nbootm 0x80000000 0x81600000\r\n<\/pre>\n<p>You should consider above &#8220;boot.txt&#8221; files as examples only, because they highly depend on OS and baseboard that you use.<\/p>\n<p>The most important bootarg here is &#8220;omapfb.video_mode=1024x600MR-16@60&#8221; &#8211; that&#8217;s exactly where we setup LCD resolution. 1024&#215;600 sets resolution, &#8220;M&#8221; indicates the kernel will calculate a VESA mode on-the-fly instead of using modedb look-up, the &#8220;R&#8221; indicates reduced blanking which is for LCD panels, &#8220;16&#8221; is the color depth, &#8220;@60&#8221; is the # of frames per second. <\/p>\n<p>Lets generate &#8220;boot.scr&#8221; file with the following commands:<\/p>\n<pre>\r\nmkimage -A arm -O linux -T script -C none -a 0 -e 0 -n \"Run uImage\" -d boot.txt boot.scr\r\nchmod a+x boot.scr\r\n<\/pre>\n<p>&#8220;mkimage&#8221; is available in package &#8220;uboot-mkimage&#8221;.<\/p>\n<p>Now copy generate &#8220;boot.scr&#8221; file to boot partition on your SD card, unmount it, put into baseboard and try. You should have native 1024&#215;600 resolution now.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-1420","post","type-post","status-publish","format-standard","hentry","category-howto"],"_links":{"self":[{"href":"https:\/\/www.chalk-elec.com\/index.php?rest_route=\/wp\/v2\/posts\/1420","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.chalk-elec.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chalk-elec.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chalk-elec.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chalk-elec.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1420"}],"version-history":[{"count":9,"href":"https:\/\/www.chalk-elec.com\/index.php?rest_route=\/wp\/v2\/posts\/1420\/revisions"}],"predecessor-version":[{"id":1440,"href":"https:\/\/www.chalk-elec.com\/index.php?rest_route=\/wp\/v2\/posts\/1420\/revisions\/1440"}],"wp:attachment":[{"href":"https:\/\/www.chalk-elec.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1420"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chalk-elec.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1420"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chalk-elec.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1420"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}