Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1140407
  • 博文数量: 322
  • 博客积分: 10010
  • 博客等级: 上将
  • 技术积分: 3276
  • 用 户 组: 普通用户
  • 注册时间: 2009-12-17 09:21
文章分类

全部博文(322)

文章存档

2010年(155)

2009年(167)

我的朋友

分类: 嵌入式

2010-01-10 17:34:55

Linux 2.6.24.4移植到S3C2410(nano2410)之:LCD

 

【平台信息】

目标板(Nano2410)------------------------

CPU:     S3C2410X

SDRAM: HY57V561620(32MB)

FLASH:        K9F1208(64MB)

NET:      CS8900

 

HOST---------------------------------------

Linux Realse Version: Fecora Cor 8 (FC8)

CrossCompiler:           gcc-4.1.1/glibc-2.3.2

 

 

 

 

 

从启动信息可以看出没有加载成功LCD驱动

 

io scheduler cfq registered

s3c2410-lcd s3c2410-lcd: no platform data for lcd, cannot attach

s3c2410-lcd: probe of s3c2410-lcd failed with error -22

lp: driver loaded but no devices found

 

LCD为三星的3.5TFT. 分辨率320x240

 

内核代码修改步骤:

1.      修改文件/linux2.6.24.4/arch/arm/mach-s3c2410/mach-smdk2410.c

            加入头文件#include

           

添加代码

static struct s3c2410fb_display nano2410_lcd_cfg[] __initdata = {

            {

              /* Config for 240x320 LCD */

              .lcdcon5 = S3C2410_LCDCON5_FRM565 |

                        S3C2410_LCDCON5_INVVLINE |

                        S3C2410_LCDCON5_INVVFRAME |

                        S3C2410_LCDCON5_PWREN |

                        S3C2410_LCDCON5_HWSWP,

 

              .type             = S3C2410_LCDCON1_TFT,

              .width            = 320,

              .height          = 240,

              .pixclock = 100000, /* HCLK/10 */

              .xres              = 320,

              .yres             = 240,

              .bpp              = 16,

              .left_margin   = 16,

              .right_margin       = 6,

              .hsync_len    = 9,

              .upper_margin     = 4,

              .lower_margin      = 6,

              .vsync_len    = 16,

    }

};

 

 

static struct s3c2410fb_mach_info nano2410_fb_info __initdata = {

            .displays = nano2410_lcd_cfg,

            .num_displays       = ARRAY_SIZE(nano2410_lcd_cfg),

            .default_display = 0,

        .gpccon =       0xaa955699,

        .gpccon_mask =  0xffc003cc,

        .gpcup =        0x0000ffff,

        .gpcup_mask =   0xffffffff,

 

        .gpdcon =       0xaa95aaa1,

        .gpdcon_mask =  0xffc0fff0,

        .gpdup =        0x0000faff,

        .gpdup_mask =   0xffffffff,

 

            .lpcsel             = ((0xCE6) & ~7) | 1<<4,

};

 

在函数smdk2410_init()中加入

s3c24xx_fb_set_platdata(&nano2410_fb_info);

 

在内核配置时,启用graphic device里面的frambuffer.并打开boot logo

 

重新编译内核,看看启动信息

……

io scheduler cfq registered

Console: switching to colour frame buffer device 30x40

fb0: s3c2410fb frame buffer device

……

 

同时可以看到LCD上出现了一只可爱的小企鹅~~~

 

uboot中设置boot command中的console=tty .可以讲启动信息在LCD上显示.

阅读(599) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~