CM-FX6: U-Boot: Display and console

From Compulab Mediawiki
Revision as of 11:17, 10 May 2015 by Nikita (talk | contribs) (Flashing the splash image into the SPI flash)
Jump to: navigation, search

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.

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.
  • Currently the only supported value for splashsource is: sf.

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