天嵌 ARM开发社区

 找回密码
 注册
查看: 2049|回复: 3

求助:TQ6410-LCD驱动移植问题

[复制链接]
doublin 发表于 2011-10-4 15:19:21 | 显示全部楼层 |阅读模式
本帖最后由 doublin 于 2011-10-4 15:29 编辑

linux版本: linux2.6.30.4
硬件平台: TQ6410
自己摸索这添加LCD驱动,
【 linux/arch/arm/mach-s3c6410/mach-smdk6410.c】
static struct s3c_fb_pd_win smdk6410_fb_win0 = {
        /* this is to ensure we use win0 */
        .win_mode = {/*4.3" 480x272 */
                .pixclock = S3CFB_PIXEL_CLOCK,
                .left_margin = 3,
                .right_margin = 2,
                .upper_margin = 1,
                .lower_margin = 1,
                .hsync_len = 40,
                .vsync_len = 1,
                .xres = 480,
                .yres = 272,
        },
        .max_bpp        = 32,
        .default_bpp= 16,
};
static struct s3c_fb_platdata smdk6410_lcd_pdata __initdata = {
        .setup_gpio        = s3c64xx_fb_gpio_setup_24bpp,
        .win[0]                = &smdk6410_fb_win0,
        .vidcon0        = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
        .vidcon1        = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
};
static struct map_desc smdk6410_iodesc[] = {
        {
                /* LCD support */
                .virtual = (unsigned long)S3C_VA_LCD,
                .pfn = __phys_to_pfn(S3C_PA_FB),
                .length = SZ_16K,
                .type = MT_DEVICE,
        },
};
...
static struct platform_device *smdk6410_devices[] __initdata = {
#ifdef CONFIG_SMDK6410_SD_CH0
        &s3c_device_hsmmc0,
#endif
#ifdef CONFIG_SMDK6410_SD_CH1
        &s3c_device_hsmmc1,
#endif
        &s3c_device_i2c0,
        &s3c_device_i2c1,
        &s3c_device_fb,
        &smdk6410_lcd_powerdev,
                &s3c_device_nand,
};
static void __init smdk6410_map_io(void)
{
        s3c_device_nand.name = "s3c6410-nand";//here add by doublin
        s3c64xx_init_io(smdk6410_iodesc, ARRAY_SIZE(smdk6410_iodesc));
        s3c24xx_init_clocks(12000000);
        s3c24xx_init_uarts(smdk6410_uartcfgs, ARRAY_SIZE(smdk6410_uartcfgs));
}
static void __init smdk6410_machine_init(void)
{
        s3c_i2c0_set_platdata(NULL);
        s3c_i2c1_set_platdata(NULL);

        i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0));
        i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1));

        s3c_fb_set_platdata(&smdk6410_lcd_pdata);
        gpio_request(S3C64XX_GPN(5), "LCD power");
        gpio_request(S3C64XX_GPF(13), "LCD power");
        gpio_request(S3C64XX_GPF(15), "LCD power");

        s3c_device_nand.dev.platform_data = &s3c_nand_mtd_part_info;
        s3c_device_onenand.dev.platform_data = &s3c_onenand_data;

        platform_add_devices(smdk6410_devices, ARRAY_SIZE(smdk6410_devices));
}

【linux/drivers/video/s3c-fb.c】
static struct platform_driver s3c_fb_driver = {
.probe  = s3c_fb_probe,
.remove  = s3c_fb_remove,
.suspend = s3c_fb_suspend,
.resume  = s3c_fb_resume,
.driver  = {
  .name = "s3c-fb",
  .owner = THIS_MODULE,
},
};

【 linux/arch/arm/plat-s3c/dev-fb.c】
struct platform_device s3c_device_fb = {
.name    = "s3c-fb",
.id    = -1,
.num_resources   = ARRAY_SIZE(s3c_fb_resource),
.resource   = s3c_fb_resource,
.dev.dma_mask   = &s3c_device_fb.dev.coherent_dma_mask,
.dev.coherent_dma_mask = 0xffffffffUL,
};
make menuconfig如下
<*> Support for frame buffer devices --->                                             
  │ │    [ ]   Enable firmware EDID                                       
  │ │    [ ]   Framebuffer foreign endianness support  --->                 
  │ │    [ ]   Enable Video Mode Handling Helpers                        
  │ │    [ ]   Enable Tile Blitting Support                              
  │ │          *** Frame buffer hardware drivers ***                       
  │ │    < >   Epson S1D13XXX framebuffer support                           
  │ │    <*>   Samsung S3C framebuffer support                              
  │ │     
  •     Debug register writes                                      
      │ │    < >   Virtual Frame Buffer support (ONLY FOR TESTING!)   

    --- Console display driver support  --->
      │ │    [ ] VGA text console                                             
      │ │    <*> Framebuffer Console support                                 
      │ │    [ ]   Map the console to the primary display device            
      │ │    [ ]   Framebuffer Console Rotation                              
      │ │    Select compiled-in fonts                                      
      │ │    [ ]   VGA 8x8 font                                                
      │ │   
  •   VGA 8x16 font

  • Bootup logo  --->  
      │ │    [ ]   Standard black and white Linux logo                        
      │ │   
  • Standard 16-color Linux logo                              
      │ │    [ ]   Standard 224-color Linux logo   
    内核编译通过,挂在yaffs2文件系统都能启动都顺利,但是就不见屏幕上出小企鹅的logo……
    启动信息里面关于LCD的信息也只有如下提示:
    Console: switching to colour frame buffer device 60x17
    s3c-fb s3c-fb: window 0: fb
    这个信息是啥意思,LCD 移植成功?
    是不是yaffs2文件系统里面也要把那个小企鹅的logo图片移植进来?
  •  楼主| doublin 发表于 2011-10-9 00:10:05 | 显示全部楼层
    天嵌的技术支持都是看官么?:(
     楼主| doublin 发表于 2011-10-14 00:48:32 | 显示全部楼层
    天嵌技术支持人员~  俺不稀罕你来回帖了。 自己搞定了:@
    亚瑟王 发表于 2011-10-18 16:31:53 | 显示全部楼层
    楼主火气很大哦,消消火了,你在配置logo的时候没有选择logo啊,红色部分的信息没有发现错误。另外就是背光灯那个地方好像是设置错了端口的。
    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

    关闭

    i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

    Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号-2 )

    GMT+8, 2024-7-5 05:42 , Processed in 1.046875 second(s), 18 queries .

    Powered by Discuz! X3.4 Licensed

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表