| 
 | 
 
 本帖最后由 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图片移植进来? |   
 
 
 
 |