Resolution of incorrect U-boot LCD boot logo and LCD character display

Source: Internet
Author: User
Tags bmp image

From: http://www.linuxidc.com/Linux/2011-08/39658.htm

To display the logo, of course, the first thing we need to do is to modify and improve the LCD driver. I will not go into details about the driver modification. I will search for it online, but I recommend it.Tekkaman ninjaIt is certainly okay to refer to his blog.

ReferTekkaman ninja

/*************************************** **************************************** ***

Image placement path

All the boot logos are placed under/tools/logos. You only need to replace the logo of your team.

For s3c2440, you just need to replace denx.bmp with the logo you want.

For the Atmel chip, it is said that the Atmel logo will be displayed, so replace that logo.

HoweverThe logo you replaced must be exactly the same as the original size and format.Otherwise, the U-boot instance will be shut down and restarted.

Ii. Image Size Standards
Different logos correspond to different sizes. 160*96 for S3C2440Resolution.

Iii. Image conversion script

Before creating an image, make sure that the image is installed on your Linux host.Netpbm
Toolkit. If it is Ubuntu, you can directly install it with the new version. If it is another release version, you can download the source code compilation on the netpbm homepage.


Cut the image you want into a jpg image of 160*96 and use the following script to process it:


#!/bin/sh
#install Netpbm first

    jpegtopnm $1 | ppmquant 31 | ppmtobmp -bpp 8 > $2


Usage: (Script Name) (name of the jpg image to be processed) (output file name) /*************************************** * ******** the above method is correct after testing. Another method is available for image conversion.

You can use any tool to convert the logo image to a BMP image. The size is 160*96 pixels and the color depth is 256 colors, that is, 8bpp (8-bit color depth ), save the file name as needed.

After the above work is done, the logo display is OK, because the uboot version I use is 2008.10 andTekkaman ninjaDifferent, after the modified Code is compiled, the uboot version information cannot be displayed on the LCD, and some version information is overwritten, resulting in abnormal display. At one time, I had no idea where to solve it?

Now it seems that I still don't know how the version information is printed. As a result, I have no idea how to solve this problem. Finally, I have read the source code and finally found this sentence.

Printf ("% s \ n", version_string );

Add the printed version information, good

Search the keyword version_string,

The following function is found in drivers/Video/cfb_console.c at around 1200 rows.

Static void * video_logo (void)
{
Char info [128];
Extern char version_string;
Int space, Len, y_off = 0;

The statement for printing information on the LCD is in this function.

Logo_plot (video_fb_address, video_cols, 0, 0 );

Sprintf (Info, "% s", & version_string); // This statement prints information on the LCD

Space = (video_line_len/2-video_info_x)/video_font_width;
Len = strlen (Info );

If (LEN> space ){
Video_drawchars (video_info_x, video_info_y,
(Uchar *) info, space );
Video_drawchars (video_info_x + video_font_width,
Video_info_y + video_font_height,
(Uchar *) info + space, len-space );
Y_off = 1;
} Else
Video_drawstring (video_info_x, video_info_y, (uchar *) info );

The red part is the code to be added. Currently, only the uboot version 2008.10 needs to be added. If this happens in another version of uboot, check this function, you may find the cause.

Compile, run, OK, it shows no problem.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.