mini2440学习之(三)-------移植LCD驱动

来源:互联网 发布:东方网络2017分红 编辑:程序博客网 时间:2024/06/04 01:34
 
转载请注明-----------------hongshaoone--------------------http://www.arm9home.com


1.修改arch/arm/mach-s3c2440/mach-smdk2440.c
CODE:
static struct s3c2410fb_display smdk2410_lcd_cfg __initdata = {
.lcdcon5 = S3C2410_LCDCON5_FRM565 |
S3C2410_LCDCON5_INVVLINE |
S3C2410_LCDCON5_INVVFRAME |
S3C2410_LCDCON5_PWREN |
S3C2410_LCDCON5_HWSWP,
.type = S3C2410_LCDCON1_TFT,
.width = 240,
.height = 320,
.pixclock = 174757,
.xres = 240,
.yres = 320,
.bpp = 16,
.left_margin = 6,
.right_margin = 37,
.hsync_len = 6,
.upper_margin = 4,
.lower_margin = 6,
.vsync_len = 2,
};
static struct s3c2410fb_mach_info smdk2410_fb_info __initdata = {
.displays = &smdk2410_lcd_cfg,
.num_displays = 1,
.default_display = 0,
.gpccon = 0xaa955699,
.gpccon_mask = 0xffc003cc,
.gpcup = 0x0000ffff,
.gpcup_mask = 0xffffffff,
.gpdcon = 0xaa95aaa1,
.gpdcon_mask = 0xffc0fff0,
.gpdup = 0x0000faff,
.gpdup_mask = 0xffffffff,
.lpcsel = 0xf82,
};
以上数据保持一致
2.在drivers/video/s3c2410fb.c 中添加如下函数
static void  LCD_POWER_ON()
{
        writel(readl(S3C2410_GPGUP)  | (1<<4) ,  S3C2410_GPGUP);
        writel(readl(S3C2410_GPGCON) | (3<<8),   S3C2410_GPGCON);
}
再在 s3c2410fb_init_registers() 的末尾调用 LCD_POWER_ON().
3.make menuconfig 设置
Device Drivers --->
                 Graphics support  --->
                      <*>Support for frame buffer device
                      <*>S3C2410  LCD framebuffer support
                      console   display   driver support------>
                       <*> Framebuffer  console support
                        [  ]  Select compiled-in fonts
                [*]  Bootup  logo  ----->
                           [*]Standard 224-color linux logo

4.最后编译运行  LCD屏亮起来了!你会看见企鹅的LOGO了~~~~~
原创粉丝点击