Chinaunix首页 | 论坛 | 博客
  • 博客访问: 47894
  • 博文数量: 25
  • 博客积分: 1415
  • 博客等级: 上尉
  • 技术积分: 270
  • 用 户 组: 普通用户
  • 注册时间: 2009-04-13 05:50
文章分类

全部博文(25)

文章存档

2011年(5)

2010年(1)

2009年(19)

我的朋友

分类: LINUX

2009-04-13 08:21:16

硬件平台: S3C2440, NEC 3.5 240*360
内核: Linux 2.6.14
---------------------------------------------------------------------------
1. 在 arch/arm/mach-s3c2410/mach-smdk2410.c 中加入代码
static struct s3c2410fb_mach_info sbc2440_lcdcfg __initdata =
{
     .regs={
             .lcdcon1=          S3C2410_LCDCON1_TFT16BPP | \
                                S3C2410_LCDCON1_TFT | \
                                S3C2410_LCDCON1_CLKVAL(0x04),
                                                                                
             .lcdcon2=          S3C2410_LCDCON2_VBPD(1) | \
                                S3C2410_LCDCON2_LINEVAL(319) | \
                                S3C2410_LCDCON2_VFPD(5) | \
                                S3C2410_LCDCON2_VSPW(1),
                                                                                
             .lcdcon3=          S3C2410_LCDCON3_HBPD(36) | \
                                S3C2410_LCDCON3_HOZVAL(239) | \
                                S3C2410_LCDCON3_HFPD(19),
                                                                                
             .lcdcon4=          S3C2410_LCDCON4_MVAL(13) | \
                                S3C2410_LCDCON4_HSPW(5),
 
             .lcdcon5=          S3C2410_LCDCON5_FRM565 | \
                                S3C2410_LCDCON5_INVVLINE | \
                                S3C2410_LCDCON5_INVVFRAME | \
                                S3C2410_LCDCON5_PWREN | \
                                S3C2410_LCDCON5_HWSWP,
        },
        .lpcsel=        0xf82,
        .gpccon=        0xaa955699,
        .gpccon_mask=   0xffc003cc,
        .gpcup=         0x0000ffff,
        .gpcup_mask=    0xffffffff,
        .gpdcon=        0xaa95aaa1,
        .gpdcon_mask=   0xffc0fff0,
        .gpdup=         0x0000faff,
        .gpdup_mask=    0xffffffff,
       
    .fixed_syncs=1 ,                                                                        
   .width=         240,
   .height=        320,
   .xres=   {
   .min = 240,
   .max = 240,
   .defval = 240
   },
    .yres=   {
   .max = 320,
   .min = 320,
   .defval = 320},
    .bpp= {
   .min = 16,
   .max = 16 ,
   .defval = 16
   },
};
2.加入头文件
#include
#include
 
3.加入代码(使得改lcd的配置信息编入内核)
确认 static struct platform_device *smdk2410_devices[] __initdata 包含代码
&s3c_device_lcd
 
加入函数
static void __init smdk2410_init(void)
{
     set_s3c2410fb_info(&sbc2440_lcdcfg);  //此函数在 devs.c中有定义
}
 
ACHINE_START(SMDK2410, "SMDK2410")
/* @TODO: request a new identifier and switch * to SMDK2410 */
加入
 .init_machine = smdk2410_init,
 
4. make menuconfig 中配置:
<>device driver
     <> graphic support
          <>support for frame
            <*> Framebuffer Console support
            [*] 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
 
;-------------------------------------------------------------------------------
遇到错误解决:
s3c2410-lcd s3c2410-lcd: no platform data for lcd, cannot attach
s3c2410-lcd: probe of s3c2410-lcd failed with error -22 lp
 
解决方法
lcd配置信息应该加入 smdk2410.c 文件中 而不是2440中, 尽管你使用的是s3c2440, 并且你的mach_type应该是193 而不是362
 
 
参考
 
阅读(607) | 评论(0) | 转发(0) |
0

上一篇:AXIS + TOMCAT

下一篇:Linux内核 2.4.14 移植

给主人留下些什么吧!~~