2. Startup Screen User Guide

This guide explains how to display the boot screen under uboot and alios.

3. uboot

Uboot provides the following functions:

  • Provide the switch of VO equipment in boot environment, including different VO interfaces and timing.

  • Provide VL video layer switch in boot environment.

  • Provide the setting of VO device background color in boot environment.

  • The default format of VL video layer is YUV420 PLANAR.

3.1. Uboot Command

  • startvo: start VO device

    Parameters: equipment number, interface type, timing.

    _images/image1.png
    • <dev> equipment number. Please refer to Table 1-1.

    • <intf-type> Interface type. Please refer to Table 1-1.

    • <timing> Timing.

    <> MIPI_TX, LVDS, I80 Without reference to timing variable, timing will be set according to the current corresponding driver.

    The standard timing on CV181X is as follows:

    2(1080P24),  3(1080P25),  4(1080P30),  5(720P50) ,  6(720P60) ,
    7(1080P50) ,  8(1080P60),  9(576P50),  10(480P60),  11(800x600)
    
  • stopvo: Turn off VO device

    Parameter: equipment number

    _images/image2.png
    • <dev> equipment number. Please refer to Table 1-1.

  • startvl: Start VL video layer

    Parameters: video layer number, image file address, video address, image file size, VO alignment.

    _images/image3.png
    • <layer> video layer number. Please refer to Table 1-1.

    • <addr_in> Image file address

    • <addr_out> Video address

    • <size> image file size

    • <alignment> VO alignment

  • stopvl: Turn off VL video layer

    Parameter: video layer number

    _images/image4.png
    • <layer> video layer number. Please refer to Table 1-1.

  • setvobg: Set VO device background color

    Parameters: equipment number, background color.

    • <dev> equipment number. Please refer to Table 1-1.

    • <bgcolor> background color (10bit RGB array, bit[29:20] is R, bit[19:10] is G, bit[9:0] is B).

Table 1-1

Processor Type

Equipment

Video layer

Graphics Layer

Interface Type

CV181X

[0]

[0]

[0]

64(BT.1120), 1024(LCD_18BIT), 2048(LCD_24BIT), 4096(LCD_30BIT), 8192(MIPI_TX), 65536(I80)

Table 1-2

Processor type

Maximum resolution of video layer

Graphics library maximum image resolution

CV181X

1280x720

1280x720

3.3. Uboot Command Example

The following is to operate with CV181X processor, configure the timing of device DHD MIPI_TX 720*1080@60 output as an example.

The address of the picture placed by each DDR is different. Please use the DDR address according to the processor.

  • Load JPEG files into memory

fatload mmc 1:1 0x84080000 logo.jpg
  • Decode JPEG to memory (jpg_buf_addr dest_buf_addr jpg_size)

cvi_jpeg 0x84080000 0x82080000 0x80000
  • DHD0 device start

startvo 0 8192 0  (MIPI_TX)
startvo 0 1024 0  (Single 6bit LVDS)
startvo 0 2048 0  (Single 8bit LVDS)
startvo 0 4096 0  (Single 10bit LVDS, not supported temporarily)
startvo 0 65536 0  (I80)
  • Video layer startup

startvl 0 0x84080000 0x82080000 0x80000 16
  • Set VO background color to black

setvobg 0 0x00000000
  • VL video layer off

Stopvl 0
  • DHD0 equipment shutdown

Stopvo 0

3.4. Use equipment and open machine screen

  1. Turn on the image file logo.jpg (BMP format drawing file is required for I80 screen) Copy to $BOOTLOGO_PATH(Default is /build/tools/common/bootlogo/logo.jpg).

  2. Modify build/boards/cv18xx/cv18xx_defconfig.The screen required for defconfig configuration is y, others need to be commented out.

  3. Modify build/boards/cv18xx/u-boot/cv18xx_defconfig .The screen required for defconfig configuration is y, others need to be commented out, and configure CONFIG_BOOTLOGO is y.

  4. Use the following command to compile BSP.

    export ENABLE_BOOTLOGO=1; source build/envsetup_soc.sh
    Build_all
    

3.5. Precautions

  • Configure boot screen, When displayed through BT.1120/656 interface,the driver of the external processor needs to be transplanted by itself.

  • If the boot screen uses MIPI_TX, LVDS or I80 interfaces, if there is an unsupported mipi_dsi, lvds or i80 panel, refer to headers in include/cvi_panels, add the corresponding header. Just refer to include/cvi_panels/cvi_panels.h other modification ,immediately available for mipi_dsi, lvds or i80 panel.

  • When using the storage device and saving the boot screen, it is necessary to save the boot screen in CV181x_asic.dtsi configures a memory space (Default is0x82080000), and ensure the LOGO_RESERVED_ADDR in u-boot/include/configs/CV181x-asic.h set to the same memory space.

4. alios

  • Alios startup screen currently only supports MIPI DSI interface, we provide the same mipi_tx_xx api as Linux(you can refer to Screen_Docking_Guide.pdf chapter MIPI_DSI).Users can initialize VO devices by calling these api in solution.

4.1. Adding and initializing panels

  1. Add the config option in mars_alios/solutions/helloworld/package.yaml and enable it, for example:

    CONFIG_PANEL_HX8394: 1
    
  2. Add the panel’s header in mars_alios/components/cvi_mmf_sdk/cvi_middleware/include/panel, you can refer to Screen_Docking_Guide.pdf or supported panel to implement data structures such as combo_dev_cfg_s。

  3. Implement the structure of panel_desc_s for a new panel in mars_alios/components/cvi_mmf_sdk/cvi_middleware/include/panel/dsi_panels.h。

  4. To use the reset, power, and backlight functions, you need to add gpio related information yourself, such as:

    #define VO_GPIO_POWER_PORT 5
    #define VO_GPIO_POWER_INDEX 2
    
  5. Quote dsi_panels.h in solution code and get panel_desc_s and gpio information.

  6. Call csi_gpio_xx() to set power, backlight, reset. such as:

    csi_gpio_t gpio = {0};
    csi_gpio_init(&gpio, VO_GPIO_POWER_PORT);
    csi_gpio_dir(&gpio, (1 << VO_GPIO_POWER_INDEX), GPIO_DIRECTION_OUTPUT);
    csi_gpio_write(&gpio, (1 << VO_GPIO_POWER_INDEX), 1);
    
  7. Call mipi_tx_init(), mipi_tx_cfg(), mipi_tx_set_hs_settle(), mipi_tx_enable() to initialize mipi_tx device. To send dcs cmd, you also need to call mipi_tx_send_cmd().

4.2. Enable startup screen

  1. Copy the startup image file logo.jpg to build/tools/common/bootlogo/logo.jpg and compile the SDK.

  2. In the solution code, build VDEC_STREAM_S structure, and specify that pu8Addr is equal to the macro definition CVIMMAP_BOOTLOGO_ADDR which stores logo. jpg data.

  3. Call CVI_VB_Init() to initialize VB.

  4. Initialize VDEC device(You can refer to MediaProcessingSoftwareDevelopmentReference_en.pdf chapter 8).

  5. Call CVI_VDEC_SendStream() Send jpeg data to VDEC for decoding.

  6. Call CVI_VDEC_GetFrame() Obtain the decoded VIDEO_FRAME_INFO_S structure.

  7. Call CVI_VO_SendLogoFromIon() Send to VO display, This api currently only supports NV21 format.