IMX6 boot logo

From RidgeRun Developer Connection
Jump to: navigation, search

Changing u-boot boot logo from source code

Default U-boot boot logo is located at src/include/linux_logo.h; using an RGB colorspace and logo data structures containing that logo data in hexadecimal format.

In order to generate the linux_logo.h file with the appropriate format use the fblogo tool.

Steps to generate your logo file:

1. Edit your logo.png file to make sure its size is not bigger that your screen resolution.

2. Make sure your file is a palette PNG using 224 colors or less. To do so, under gimp, go to imge -> mode -> indexed and set the Maximum number of colors to a number less or equal to 224, and press the convert button.

3. Convert your *.png logo into a .h file

fblogo your_logo.png > linux_logo.h

4. Open your custom linux_logo.h file. You will see something like this at the beginning of the file.

/* linux_logo.h created with fblogo, 2014/02/10 15:57:43
 * include/linux/linux_logo.h: This is a linux logo
 *                             to be displayed on boot.
 *
 * Copyright (C) 1996 Larry Ewing (lewing@isc.tamu.edu)
 * Copyright (C) 1996,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
 *
 * You can put anything here, but:
 * LINUX_LOGO_COLORS has to be less than 224
 * Generated by fblogo version 0.5.1
 *
 *
 * Remember to modify drivers/video/fbcon.c:
 * Change "#define LOGO_H 80" to "#define LOGO_H 450"
 * Change "#define LOGO_W 80" to "#define LOGO_W 800"
 */

#ifndef __HAVE_ARCH_LINUX_LOGO
#define LINUX_LOGO_COLORS 223

In that information you can see the number of colors, width and height of your image.

5. Modify the #define LINUX_LOGO_COLORS variable in the src/include/linux_logo.h with the appropriate number of colors.

6. Replace the linux_logo_red[], linux_logo_green[], linux_logo_blue[] and linux_logo[] structures with the ones in your custom linux_logo.h.

7. In src/drivers/video/cfb_console.c replace the LINUX_LOGO_WIDTH, LINUX_LOGO_HEIGHT and LINUX_LOGO_COLORS variables with the appropriate values.

8. Add these variables CONFIG_VIDEO_LOGO and INCLUDE_LINUX_LOGO_DATA in the src/include/configs/nitrogen.h.

#define CONFIG_BMP_16BPP
+#define CONFIG_VIDEO_LOGO
+#define INCLUDE_LINUX_LOGO_DATA
#define CONFIG_IPUV3_CLK 260000000

9. Recompile uboot and you're done!!

Changing u-boot boot logo from uboot's prompt

1. First obtain a bitmap image to use as a boot logo (test.bmp).
2. Compress the image to reduce the size of it (test.bmp.gz).
3. Add the file to the SD card.
4. Check the MMC devices:

U-Boot > mmc list
FSL_SDHC: 0
 FSL_SDHC: 1

5. Execute the following to load the image to RAM:

U-Boot > fatload mmc 1 10000000 /test.bmp.gz

6. Store image on the flash.

U-Boot > sf probe
U-Boot > sf erase c2000 +${filesize}
U-Boot > sf write 10000000 c2000 ${filesize}

7. Create the following variables:

U-Boot > setenv splashimage 12000000
U-Boot > setenv splashpos m,m
U-Boot > setenv splashsize ${filesize}
U-Boot > setenv loadsplash 'if sf probe ; then sf read ${splashimage} c2000 ${splashsize} ; fi'

8. Add the following to the beginning of bootcmd:

run loadsplash; bmp d ${splashimage}

9. Save the environment.

U-Boot > saveenv

10. Reset the board.

U-Boot > reset

11. Check if the logo in the memory.

U-Boot > bmp i 12000000

Output:

Image size    : 800 x 950
Bits per pixel: 8
Compression   : 0

By default, Linux logo is located at drivers/video/logo' and it uses the extension .ppm, thus you need to generate a .ppm file based on your logo image.

1. Save your image in ppm format. To do so just open it with GIMP, then click on save as and use the ppm extension, then for the Data formatting select Ascii.

2. Reduce the number of colors of the recently created .ppm image

ppmquant 224 $YOUR_SRC_IMAGE.ppm > $YOUR_IMAGE.ppm

3. Copy your .ppm file to drivers/video/logo

cp $YOUR_IMAGE.ppm drivers/video/logo/logo_name_clut224.ppm

4. Add this entry to drivers/video/logo/Kconfig

config LOGO_NAME_CLUT224
        bool "Logo description"
        default y

5. Add this code in drivers/video/logo/logo.c under if (depth >= 8)

#ifdef CONFIG_LOGO_NAME_CLUT224
                /* Some comments */
                logo = &logo_name_clut224;
#endif  

6. Add an entry to the Makefile drivers/video/logo/Makefile

+obj-$(CONFIG_LOGO_NAME_CLUT224) += logo_name_clut224.o

7. Declare this variable in include/linux/linux_logo.h

extern const struct linux_logo logo_name_clut224;

After that, you can go to the root of your SDK, do a make config and under Kernel configuration -> Device Drivers -> Graphics support -> Bootup logo select your recently created logo, then just exit, save and compile. The next time you boot you should see your logo instead of the linux logo.

With iMX6 boards, the kernel boot logo appears as many times as cores are available, so for example, for the iMX6Q you'll see 4 penguins or your logo 4 times. To avoid this, edit the drivers/video/fbmem.c file and in the fb_show_logo function replace the num_online_cpus() in

y = fb_show_logo_line(info, rotate, fb_logo.logo, 0,
                              num_online_cpus());

for the number of times you want your logo to appear (usually just 1).

References