linux-2.6.30.24 移植lcd

来源:互联网 发布:windows 文件夹 密码 编辑:程序博客网 时间:2024/06/05 04:50
先回忆一下关于tq2440 lcd的一些资料:
http://blog.sina.com.cn/s/blog_7090b8670101828y.html
参照tq2440出厂源代码。
1.
在mach-smdk2440.c/static struct s3c2410fb_displaysmdk2440_lcd_cfg __initdata中添加.setclkval =0x04,
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,
.setclkval =0x04,//设置为0x04
.xres = 480,
.yres = 272,
.bpp = 16,
.left_margin = 19,
.right_margin = 10,
.hsync_len = 30,
.upper_margin = 4,
.lower_margin = 2,
.vsync_len = 8,
};

2.然后在s3c2410fb_display这个结构体的定义中添加unsigned setclkval;
struct s3c2410fb_display {
unsigned type;

unsigned short width;
unsigned short height;

unsigned short xres;
unsigned short yres;
unsigned short bpp;

unsigned pixclock;
unsigned setclkval;
unsigned short left_margin;  
unsigned short right_margin;
unsigned short hsync_len;   
unsigned short upper_margin;
unsigned short lower_margin;
unsigned short vsync_len;

unsigned long lcdcon5;
};

struct s3c2410fb_mach_info {

struct s3c2410fb_display *displays;
unsigned num_displays;
unsigned default_display;


unsigned long gpcup;
unsigned long gpcup_mask;
unsigned long gpccon;
unsigned long gpccon_mask;
unsigned long gpdup;
unsigned long gpdup_mask;
unsigned long gpdcon;
unsigned long gpdcon_mask;

unsigned long lpcsel;
};



3.在driver/video/s3c2410fb.c中的 s3c2410fb_activate_var(structfb_info *info)中“"添加
struct s3c2410fb_mach_info *mach_info =fbi->dev->platform_data;
struct s3c2410fb_display *display = NULL;
struct s3c2410fb_display *default_display =mach_info->displays +
  mach_info->default_display;
fbi->regs.lcdcon1 |= S3C2410_LCDCON1_CLKVAL(default_display->setclkval);

LCD驱动内核配置选项如下:
Device Drivers->Graphics support->Support for framebuffer devices->Enable firmware EDID、Enable Video Mode HandlingHelpers和S3C2410 LCD framebuffer support,同时在Graphicssupport选项中还要选择Console display driver support->FramebufferConsole support;       
 5)添加开机Logo。具体Logo图片可以自行选择,我用的是Linux内核自带的
原创粉丝点击