Difference between revisions of "CM-FX6: U-Boot: Display and console"

From Compulab Mediawiki
Jump to: navigation, search
 
(splashsource)
 
(2 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
* To enable display, set the {{parameter|displaytype}} environment variable to one of the supported display presets:
 
* To enable display, set the {{parameter|displaytype}} environment variable to one of the supported display presets:
 
<pre>
 
<pre>
> setenv displaytype &lt;preset&gt;
+
# setenv displaytype <preset>
> saveenv
+
# saveenv
 
</pre>
 
</pre>
 
* The supported values of {{parameter|displaytype}} are: HDMI.
 
* The supported values of {{parameter|displaytype}} are: HDMI.
Line 12: Line 12:
  
 
== Console support ==
 
== Console support ==
CM-FX6 U-Boot can send console output to the following devices: serial, HDMI display.
+
CM-FX6 U-Boot can send console output to the serial port and HDMI display.
CM-FX6 U-Boot can accept console input from the following devices: serial, USB keyboard.
+
CM-FX6 U-Boot can accept console input from the serial port and USB keyboard.
  
 
By default, U-Boot only performs console I/O over serial. If display is enabled (see [[#Enable display | Enable display]]), only the Compulab logo and the U-Boot header are displayed (no console output).
 
By default, U-Boot only performs console I/O over serial. If display is enabled (see [[#Enable display | Enable display]]), only the Compulab logo and the U-Boot header are displayed (no console output).
This behavior can be overridden in various ways:
+
This behaviour can be modified in various ways:
  
 
=== Console input: enabling USB keyboard ===
 
=== Console input: enabling USB keyboard ===
Line 23: Line 23:
 
* Start USB subsystem to detect the USB keyboard:
 
* Start USB subsystem to detect the USB keyboard:
 
<pre>
 
<pre>
> usb start
+
# usb start
 
</pre>
 
</pre>
 
* Add USB keyboard as console input device:
 
* Add USB keyboard as console input device:
 
<pre>
 
<pre>
> setenv stdin serial,usbkbd
+
# setenv stdin serial,usbkbd
> saveenv
+
# saveenv
 
</pre>
 
</pre>
 
* To make U-Boot detect the keyboard automatically at boot, run the following commands:
 
* To make U-Boot detect the keyboard automatically at boot, run the following commands:
 
<pre>
 
<pre>
> setenv preboot "usb start"
+
# setenv preboot "usb start"
> saveenv
+
# saveenv
 
</pre>
 
</pre>
  
Line 40: Line 40:
 
To output console to the display screen, run the following commands:
 
To output console to the display screen, run the following commands:
 
<pre>
 
<pre>
> setenv stdout serial,vga
+
# setenv stdout serial,vga
> setenv stderr serial,vga
+
# setenv stderr serial,vga
> saveenv
+
# saveenv
 
</pre>
 
</pre>
  
Line 48: Line 48:
  
 
== Splash screen ==
 
== Splash screen ==
 
The following setup is required to enable splash screen display:
 
* Connect a display to the SB-FX6 as described in [http://compulab.co.il/products/computer-on-modules/cm-fx6/#devres SB-FX6 reference manual]
 
* [[#Flashing the splash screen image into the SPI flash|Store a splash screen image in the CM-FX6 SPI flash]]
 
* [[#Setting up the environment|Setup U-Boot environment]]
 
 
=== Splash screen image ===
 
  
 
U-Boot for CM-FX6 supports uncompressed 8-bit BMP splash screen images.
 
U-Boot for CM-FX6 supports uncompressed 8-bit BMP splash screen images.
Line 61: Line 54:
 
U-Boot will automatically relocate the splash screen image from its storage into the MX6 display frame buffer.<br>
 
U-Boot will automatically relocate the splash screen image from its storage into the MX6 display frame buffer.<br>
  
==== Flashing the splash screen image into the SPI flash ====
+
The following setup is required to enable splash screen display:
 +
* Connect an HDMI display to the SB-FX6 as described in [http://compulab.co.il/products/computer-on-modules/cm-fx6/#devres SB-FX6 reference manual]
 +
* [[#Reading the splash image into memory|Read splash image into memory]]
 +
* [[#Flashing the splash image into the SPI flash|Flash the in-memory splash image into SPI flash]]
 +
* [[#Setting up the environment|Setup U-Boot environment]]
 +
 
 +
Upon completion of the above steps, the splash image will be displayed automatically on boot.
  
To write the splash screen image into the SPI flash use the following command sequence:
+
=== Reading the splash image into memory ===
* Download the image to the CM-FX6 RAM:
+
 
 +
Splash image can be read into memory from a variety of sources:
 +
* Network download:
 
<pre>
 
<pre>
> tftp 10800000 <bmp file name>
+
# tftp 10800000 <bmp file name>
 
</pre>
 
</pre>
* Or read the image from MMC/SD card:
+
* MMC/SD card:
 
<pre>
 
<pre>
> mmc dev 2
+
# mmc dev 2
> mmc rescan
+
# mmc rescan
> load mmc 2 10800000 <bmp file name>
+
# load mmc 2 10800000 <bmp file name>
 
</pre>
 
</pre>
* Detect SPI flash
+
* USB storage:
 
<pre>
 
<pre>
> sf probe
+
# usb start
 +
# load usb <device number> 10800000 <bmp file name>
 +
</pre>
 +
 
 +
==== Testing the splash image ====
 +
After reading the splash image into memory, the integrity of the splash image can be validated by displaying it using the {{cmd|bmp}} command:
 +
<pre>
 +
# bmp display 10800000
 +
</pre>
 +
This check also verifies that the splash image can be handled at the address it was read to (10800000 in our example).
 +
If the image is displayed correctly, the memory address can be safely used as the value of {{parameter|splashimage}} (see [[#Setting up the environment|Setting up the environment]]).
 +
 
 +
=== Flashing the splash image into the SPI flash ===
 +
* Detect SPI flash:
 +
<pre>
 +
# sf probe
 
</pre>
 
</pre>
 
* Erase the SPI flash at offset 0x100000:
 
* Erase the SPI flash at offset 0x100000:
 
<pre>
 
<pre>
> sf erase 100000 <bmp size>
+
# sf erase 100000 100000
 
</pre>
 
</pre>
* Write the splash screen image into the SPI flash:
+
* Write the in-memory splash screen image into the SPI flash:
 
<pre>
 
<pre>
> sf write 10800000 100000 <bmp size>
+
# sf write 10800000 100000 100000
 
</pre>
 
</pre>
 
Now the splash screen is in the SPI flash.
 
Now the splash screen is in the SPI flash.
  
==== Setting up the environment ====
+
=== Storing the splash image in filesystem formatted storage ===
===== splashsource =====
+
The splash image can be stored in a USB, MMC, or SATA storage as a file called {{filename|splash.bmp}}.
 +
The storage can be formatted with either FAT, EXT2 or EXT4 file system.
 +
 
 +
=== Setting up the environment ===
 +
==== splashsource ====
  
 
* Set the {{parameter|splashsource}} variable to one of the supported storage devices for splash image (optional). For example, the following selects SPI flash as the storage device:
 
* Set the {{parameter|splashsource}} variable to one of the supported storage devices for splash image (optional). For example, the following selects SPI flash as the storage device:
 
<pre>
 
<pre>
> setenv splashsource sf
+
# setenv splashsource sf
> saveenv
+
# saveenv
 
</pre>
 
</pre>
 
* If {{parameter|splashsource}} is not defined, U-Boot will default to loading splash screen from SPI flash.
 
* If {{parameter|splashsource}} is not defined, U-Boot will default to loading splash screen from SPI flash.
* The supported values for {{parameter|splashsource}} are: sf.
+
* The supported values for {{parameter|splashsource}} are
 +
** For raw data on SPI flash: sf.
 +
** For filesystem file: mmc_fs, usb_fs, sata_fs.
  
===== splashimage =====
+
==== splashimage ====
* Set the {{parameter|splashimage}} variable to the address to which you wish U-Boot to load the splash image from its storage. For example:
+
* Set the {{parameter|splashimage}} variable to the address where you wish U-Boot to load the splash image from the storage. For example:
 
<pre>
 
<pre>
> setenv splashimage 10800000
+
# setenv splashimage 10800000
> saveenv
+
# saveenv
 
</pre>
 
</pre>
  

Latest revision as of 11:29, 2 September 2015

Display support

CM-FX6 U-Boot supports displays that are connected via HDMI interface, and a resolution of 1024x768.

Enable display

  • To enable display, set the displaytype environment variable to one of the supported display presets:
# setenv displaytype <preset>
# saveenv
  • The supported values of displaytype are: HDMI.
  • For backwards compatibility, the displaytype variable can be substituted with the panel variable. If both variables are defined, displaytype takes precedence.

Console support

CM-FX6 U-Boot can send console output to the serial port and HDMI display. CM-FX6 U-Boot can accept console input from the serial port and USB keyboard.

By default, U-Boot only performs console I/O over serial. If display is enabled (see Enable display), only the Compulab logo and the U-Boot header are displayed (no console output). This behaviour can be modified in various ways:

Console input: enabling USB keyboard

  • Connect USB keyboard to a USB port.
  • Start USB subsystem to detect the USB keyboard:
# usb start
  • Add USB keyboard as console input device:
# setenv stdin serial,usbkbd
# saveenv
  • To make U-Boot detect the keyboard automatically at boot, run the following commands:
# setenv preboot "usb start"
# saveenv

Console output: enabling framebuffer console

To output console to the display screen, run the following commands:

# setenv stdout serial,vga
# setenv stderr serial,vga
# saveenv

Enabling framebuffer console will display the console output below the Compulab logo if no splash screen is setup, and will overwrite the splash screen otherwise.

Splash screen

U-Boot for CM-FX6 supports uncompressed 8-bit BMP splash screen images. An example of such an image can be found in the U-Boot for CM-FX6 package (here) under utilities-->splash_images folder. The splash screen image can be stored in the CM-FX6 SPI flash at offset 0x100000. U-Boot will automatically relocate the splash screen image from its storage into the MX6 display frame buffer.

The following setup is required to enable splash screen display:

Upon completion of the above steps, the splash image will be displayed automatically on boot.

Reading the splash image into memory

Splash image can be read into memory from a variety of sources:

  • Network download:
# tftp 10800000 <bmp file name>
  • MMC/SD card:
# mmc dev 2
# mmc rescan
# load mmc 2 10800000 <bmp file name>
  • USB storage:
# usb start
# load usb <device number> 10800000 <bmp file name>

Testing the splash image

After reading the splash image into memory, the integrity of the splash image can be validated by displaying it using the bmp command:

# bmp display 10800000

This check also verifies that the splash image can be handled at the address it was read to (10800000 in our example). If the image is displayed correctly, the memory address can be safely used as the value of splashimage (see Setting up the environment).

Flashing the splash image into the SPI flash

  • Detect SPI flash:
# sf probe
  • Erase the SPI flash at offset 0x100000:
# sf erase 100000 100000
  • Write the in-memory splash screen image into the SPI flash:
# sf write 10800000 100000 100000

Now the splash screen is in the SPI flash.

Storing the splash image in filesystem formatted storage

The splash image can be stored in a USB, MMC, or SATA storage as a file called splash.bmp. The storage can be formatted with either FAT, EXT2 or EXT4 file system.

Setting up the environment

splashsource

  • Set the splashsource variable to one of the supported storage devices for splash image (optional). For example, the following selects SPI flash as the storage device:
# setenv splashsource sf
# saveenv
  • If splashsource is not defined, U-Boot will default to loading splash screen from SPI flash.
  • The supported values for splashsource are
    • For raw data on SPI flash: sf.
    • For filesystem file: mmc_fs, usb_fs, sata_fs.

splashimage

  • Set the splashimage variable to the address where you wish U-Boot to load the splash image from the storage. For example:
# setenv splashimage 10800000
# saveenv

See also