CM-X300: U-Boot: LCD and Splash screen

From Compulab Mediawiki
Revision as of 11:36, 4 March 2010 by Mike (talk | contribs) (1 revision(s))
Jump to: navigation, search

Overview

U-Boot for CM-X300 features LCD and splash screen support starting from version 2009.03-cm-x300-4.
The support covers Toppoly TDO35S LCD supplied with the evaluation kit, standard VGA screens and custom LCDs.
In order to enable splash screen display, the following setup is required:

Display parameters setup

In order to configure the U-Boot display sub-system, display parameters should be passed to the PXA3xx frame buffer driver.
CM-X300 U-Boot provides predefined parameter sets for the TDO35S LCD and standard VGA. Custom LCD parameters should be defined according to the LCD datasheet.
CM-X300 U-Boot features a convenient mechanism for using the predefined parameter sets and configuring custom display settings.
The mechanism utilizes two U-Boot environment variables: the displaytype variable and the optional user defined variable for custom display settings.

Setting the "displaytype" variable

The displaytype variable may be assigned with one of the following values:

  • toppoly - U-Boot will use the predefined parameter set for the TDO35S LCD.
  • vga - U-Boot will use the predefined parameter set for standard VGA display.
  • none - U-Boot will disable the display sub-system. This is also the default behavior when the displaytype variable value is not set.
  • <varname> - U-Boot will search for the "varname" environment variable. The "varname" value will be used to setup the display parameters.
Admolition note.png If displaytype is set to toppoly, vga or none U-Boot will automatically perform the required display setup.

Custom LCD parameter setup

Throughout this section the optional user defined variable will be called customlcd.
The customlcd variable is a string of parameters, describing the LCD characteristics.
The syntax of customlcd variable is a comma separated list of <key>:<value> pairs and <value> singles. For example:

<key1>:<value1>,<key2>:<value2>,<value3>,<key4>:<value4>

The order of the parameters in the string is not important.

Admolition note.png The syntax of the string is similar to the Linux kernel command line video parameter, with pxafb value (can be found at: http://kernel.org/doc/Documentation/fb/pxafb.txt). Linux users can append (with little changes) the customlcd variable to the Linux kernel command line, so the kernel will take care of the LCD setup on boot.

Parameters description

mode:XRESxYRES[-BPP] The display resolution in pixels: XRES - width, YRES - height. BPP - bit depth (optional).
pixclock:PIXCLOCK Pixel clock in picoseconds.
left:LEFT Left display margin (Horizontal Back Porch)
right:RIGHT Right display margin (Horizontal Front Porch)
upper:UPPER Upper display margin (Vertical Back Porch)
lower:LOWER Lower display margin (Vertical Front Porch)
hsynclen:HSYNC Horizontal sync time (Horizontal Sync Pulse Width)
vsynclen:VSYNC Vertical sync time (Vertical Sync Pulse Width)
active Active (TFT) display
passive Passive (STN) display
hsync:HSYNC Horizontal sync polarity. 0 => active low, 1 => active high
vsync:VSYNC Vertical sync polarity. 0 => active low, 1 => active high
dpc:DPC Double pixel clock. 1=>true, 0=>false
outputen:POLARITY Output enable polarity. 0 => active low, 1 => active high
pixclockpol:POLARITY Pixel clock polarity. 0 => falling edge, 1 => rising edge

All the above values should be taken or derived from the LCD datasheet.
For example, in order to setup the parameters for TDO35S LCD in customlcd variable, use the following commands:

> setenv customlcd "mode:480x640-8,pixclock:38250,left:8,right:24,upper:2,lower:4,hsynclen:8,vsynclen:2,active,hsync:0,vsync:0,outputen:1"
> setenv displaytype "customlcd"
> saveenv

Splash screen image

CM-X300 U-Boot supports uncompressed 8-bit BMP splash screen images. The example of such an image for TDO35S LCD, can be downloaded from here. The splash screen image should be stored in the CM-X300 NAND flash at offset 0xC0000 and its maximal size should not exceed 768KB (0xC0000). U-Boot will automatically relocate the splash screen image from NAND flash into the PXA3xx CPU frame buffer.

Flashing the Splash screen image into the NAND flash

To store the splash screen image into the NAND flash use the following command sequence:

  • Download the image to the CM-X300 RAM:
> tftp 80a00000 <bmp img name>
  • Or read the image from USB:
> usb start
> fatload usb 0 80a00000 <bmp img name>
  • Erase the NAND flash at offset 0xC0000:
> nand erase c0000 c0000
  • Write the splash screen image into the NAND flash:
> nand write 80a00000 c0000 c0000

The splash screen is in the NAND flash.

Setting up the environment

In order to display the splash screen image that resides in the NAND flash, the splashimage environment variable must be set. The splashimage variable should contain the base address for splash screen shadow in RAM. Our recommended value is: 0x83e00000. This value ensures that the splash screen shadow does not overlap other vital locations in RAM (like U-Boot shadow) and is safe to use.

Admolition warning.png The splash screen shadow address range should not overlap other vital RAM locations in use. In particular, if the splash screen overlaps U-Boot code segment, the CM-X300 module may become disabled!

To set the splashimage variable use the following command:

> setenv splashimage 83e00000
> saveenv

Frame Buffer

The frame buffer location in system RAM is hard-coded into the CM-X300 U-Boot. The base address of the frame buffer is written to fbaddr environment variable. Writing any data to the address range from fbaddr to fbaddr + 1MB will corrupt the splash screen image.
After the operating system initializes its own frame buffer, the value of fbaddr variable is meaningless.

See also