首页 > 其他 > 详细

TQ2440内核移植之LCD

时间:2014-03-03 16:30:48      阅读:415      评论:0      收藏:0      [点我收藏+]

内核版本:linux 2.6.30.4

开发板:TQ2440

交叉编译环境:arm-linux-gcc 4.3.3

在linux 2.6.30.4/driver/video/s3c2410fb.c 第370添加两行:

     struct s3c2410fb_mach_info *mach_info = fbi->dev->platform_data;
     struct s3c2410fb_display *default_display = mach_info->displays + mach_info->default_display;

修改添加上面两行后新行数的389:

	//fbi->regs.lcdcon1 |=  S3C2410_LCDCON1_CLKVAL(clkdiv);
	fbi->regs.lcdcon1 |=  S3C2410_LCDCON1_CLKVAL(default_display->setclkval);

修改linux 2.6.30.4/arch/arm/mach-s3c2410/include/mach/fb.h 中添加第40行:

unsigned setclkval;   /*clkval*/


下面修改LCD的参数,不同开发板的参数不一样,本文是基于4.3寸屏第参数:

修改108行为:

static struct s3c2410fb_display smdk2440_lcd_cfg __initdata = {

	.lcdcon5	= S3C2410_LCDCON5_FRM565 |
			  S3C2410_LCDCON5_INVVLINE |
			  S3C2410_LCDCON5_INVVFRAME |
			  S3C2410_LCDCON5_PWREN |
			  S3C2410_LCDCON5_HWSWP,

	.type		= S3C2410_LCDCON1_TFT,

	.width		= 480,
	.height		= 272,

	.pixclock	= 40000, /* HCLK 100 MHz, divisor 1 */
	.setclkval	= 0x4,
	.xres		= 480,
	.yres		= 272,
	.bpp		= 16,
	.left_margin	= 19,
	.right_margin	= 10,
	.hsync_len	= 30,
	.upper_margin	= 4,
	.lower_margin	= 2,
	.vsync_len	= 8,
};

同时注释掉151行:    //.lpcsel        = ((0xCE6) & ~7) | 1<<4,


配置内核支持LCD:

 Device Drivers  ---> 

              Graphics support  --->   

                      <*> Support for frame buffer devices  --->

                                         [*]   Enable firmware EDID 

                                          [*]   Enable Video Mode Handling Helpers 

                                          <*>   S3C2410 LCD framebuffer support  

                      Console display driver support --->

                                      <*> Framebuffer Console Support 

                    [*] Bootup Logo --->

                                    <*> Standard 224-color Linux logo

重新编译uImage

出现小企鹅话画面。


制作自己的启动图片:

在Centos下打开Applictaions->Graphics->GNU Image Manipulation Program

选择自己的图片打开,鼠标移动到图片上右键Image->Mode->indexed...   把256改成224

右键File->Save as保存为logo_linux_clut224.ppm确定后弹出一个对话框,选择Ascii,OK

把这个文件复制到logo文件夹中就可以了。

drivers/video/logo/logo_linux_clut224.ppm



TQ2440内核移植之LCD,布布扣,bubuko.com

TQ2440内核移植之LCD

原文:http://blog.csdn.net/hanglinux/article/details/20305099

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!