您的位置:首页 > 运维架构 > Linux

linux2.6.22.6中针对s3c2410的LCD驱动移植

2012-11-12 13:34 441 查看
1.在arch/arm/mach-s3c2410/mach-smdk2410.c中添加头文件:

#include <asm/arch/fb.h>

#include <asm/arch/regs-gpio.h>
#include <asm/arch/regs-lcd.h>
2.继续在上面的文件中添加

static struct s3c2410fb_mach_info smdk2410_lcdcfg __initdata={
.fixed_syncs= 0,
.regs={
.lcdcon1= (7<<8)|(0<<7)|(3<<5)|(12<<1),
.lcdcon2= (4<<24)|(239<<14)(4<<6)|4,
.lcdcon3= (13<<19)|(319<<8)|4,
.lcdcon4= (13<<8)|18,
.lcdcon5= (1<<11)|(1<<10)|(1<<9)|(1<<8)|(0<<7)|(0<<6)|(1<<3)|(0<<1)|(1),
},
.type=S3C2410_LCDCON1_TFT,
.lpcsel= ((0XCE6)&~7)|1<<4,//0x0,
[b].width= 320,//640,

.height= 240,//480,
.xres = {
.min = 322,
.max = 320,
.defval = 320,
},
[b].yres = {

.min = 240,
.max = 240,
.defval = 480,
},
.bpp = {
.min = 16,
.max = 16,
.defval = 16,
},
};
在smdk2410_init函数里添加:
static void __init smdk2410_init(void)
{
[b]s3c24xx_fb_set_platdata(&smdk2410_lcdcfg);

platform_add_devices(smdk2410_devices, ARRAY_SIZE(smdk2410_devices));
smdk_machine_init();
}
下面配置内核
Device Drivers --->
Graphics support --->
<*> S3C2410 LCD framebuffer support
<*> Virtual Frame Buffer support(ONLY FOR TESTING!)
Console display driver support --->
<*> Framebuffer Console support
[*] Framebuffer Console Rotation
[*] Select compiled-in fonts
[*] VGA 8x8 font
[*] VGA 8x16 font
[*] Mini 4x6 font
[*] Sparc console 8x16 font
[*] Bootup logo --->
--- Bootup logo
[*] Standard 224-color Linux logo
然后就是重新编译内核 ,tftp到开发板启动,应该就可以看到企鹅Tux了。但你如果想在LCD上显示自己的Logo,那下面我介绍一下自定义Logo的方法:
[/b][/b][/b]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: