Difference between revisions of "CM-X300: U-Boot: LCD and Splash screen"

From Compulab Mediawiki
Jump to: navigation, search
m (1 revision(s))
 
Line 1: Line 1:
== Overview ==
+
#REDIRECT [[CM-X300: U-Boot: Custom Features]]
 
 
U-Boot for CM-X300 features LCD and splash screen support starting from version 2009.03-cm-x300-4.<br>
 
The support covers Toppoly TDO35S LCD supplied with the evaluation kit, standard VGA screens and custom LCDs.<br>
 
In order to enable splash screen display, the following setup is required:
 
* Connect an LCD or a VGA display to the SB-X300, as described in [http://www.compulab.co.il/x300/download/x300-sb-man.pdf SB-X300 reference manual]
 
* [[CM-X300:_U-Boot:_LCD_and_Splash_screen#Display_parameters_setup|Setup display parameters]]
 
* [[CM-X300:_U-Boot:_LCD_and_Splash_screen#Splash_screen_image|Store a splash screen image into the CM-X300 NAND flash]]
 
 
 
== Display parameters setup ==
 
In order to configure the U-Boot display sub-system, display parameters should be passed to the PXA3xx frame buffer driver.<br>
 
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.<br>
 
CM-X300 U-Boot features a convenient mechanism for using the predefined parameter sets and configuring custom display settings.<br>
 
The mechanism utilizes two U-Boot environment variables: the {{parameter|displaytype}} variable and the optional user defined variable for custom display settings.
 
 
 
=== Setting the "{{parameter|displaytype}}" variable ===
 
The {{parameter|displaytype}} variable may be assigned with one of the following values:
 
* {{parameter|toppoly}} - U-Boot will use the predefined parameter set for the TDO35S LCD.
 
* {{parameter|vga}} - U-Boot will use the predefined parameter set for standard VGA display.
 
* {{parameter|none}} - U-Boot will disable the display sub-system. This is also the default behavior when the {{parameter|displaytype}} variable value is not set.
 
* <{{parameter|varname}}> - U-Boot will search for the "{{parameter|varname}}" environment variable. The "{{parameter|varname}}" value will be used to setup the display parameters.
 
{{Note| If {{parameter|displaytype}} is set to {{parameter|toppoly}}, {{parameter|vga}} or {{parameter|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 {{parameter|customlcd}}.<br>
 
The {{parameter|customlcd}} variable is a string of parameters, describing the LCD characteristics.<br>
 
The syntax of {{parameter|customlcd}} variable is a comma separated list of {{parameter|<key>:<value>}} pairs and {{parameter|<value>}} singles. For example:
 
<pre>
 
<key1>:<value1>,<key2>:<value2>,<value3>,<key4>:<value4>
 
</pre>
 
The order of the parameters in the string is not important.<br>
 
{{Note|The syntax of the string is similar to the Linux kernel command line {{parameter|video}} parameter, with {{parameter|pxafb}} value (can be found at: http://kernel.org/doc/Documentation/fb/pxafb.txt). Linux users can append (with little changes) the {{parameter|customlcd}} variable to the Linux kernel command line, so the kernel will take care of the LCD setup on boot.}}
 
 
 
==== Parameters description ====
 
{|width="100%" cellpadding="3" border="1" style="border: 1px solid rgb(85, 85, 85); border-collapse: collapse;"
 
|-
 
| mode:XRESxYRES[-BPP]
 
| The display resolution in pixels: {{parameter|XRES}} - width, {{parameter|YRES}} - height. {{parameter|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.<br>
 
For example, in order to setup the parameters for TDO35S LCD in {{parameter|customlcd}} variable, use the following commands:
 
<pre>
 
> 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
 
</pre>
 
 
 
== 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 [[media:logo.480x640-8.bmp|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.<br>
 
 
 
=== 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:
 
<pre>
 
> tftp 80a00000 <bmp img name>
 
</pre>
 
* Or read the image from USB:
 
<pre>
 
> usb start
 
> fatload usb 0 80a00000 <bmp img name>
 
</pre>
 
* Erase the NAND flash at offset 0xC0000:
 
<pre>
 
> nand erase c0000 c0000
 
</pre>
 
* Write the splash screen image into the NAND flash:
 
<pre>
 
> nand write 80a00000 c0000 c0000
 
</pre>
 
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 {{parameter|splashimage}} environment variable must be set. The {{parameter|splashimage}} variable should contain the base address for splash screen shadow in RAM. Our recommended value is: {{parameter|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.
 
{{Warning|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 {{parameter|splashimage}} variable use the following command:
 
<pre>
 
> setenv splashimage 83e00000
 
> saveenv
 
</pre>
 
 
 
== 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 {{parameter|fbaddr}} environment variable. Writing any data to the address range from {{parameter|fbaddr}} to {{parameter|fbaddr + 1MB}} will corrupt the splash screen image.<br>
 
After the operating system initializes its own frame buffer, the value of {{parameter|fbaddr}} variable is meaningless.
 
 
 
== See also ==
 
* [[U-Boot quick reference]]
 
* [[U-Boot images]]
 
* [[CM-X300: U-Boot: Firmware Update]]
 
* [[CM-X300: U-Boot: Firmware Development]]
 
* [[Getting started with Linux on CM-X300]]
 
* [http://www.denx.de/wiki/U-Boot/Documentation U-Boot documentation]
 
 
 
[[Category:U-Boot|LCD and Splash screen]]
 
[[Category:CM-X300|LCD and Splash screen]]
 

Latest revision as of 10:58, 26 April 2010