FS2410 开发板linux-2.6.35内核 LCD 驱动移植

FS2410 开发板linux-2.6.35内核 LCD 驱动移植

在arch/arm/mach-smdk2410.c相应位置中添加如下蓝色行代码

#include    //added by Thomas.Yang 2011-01-30
#include
#include
#include
#include
#include
#include
#include


/*LCD35 driver Added by Thomas.Yang (Yang Zhiping) 2011-01-30
********************************************************************/
static struct s3c2410fb_display fb_thomas_display = {
        .type = S3C2410_LCDCON1_TFT,    //LCD 类型
        .width = 320,     //LCD 宽
        .height = 240,   //LCD 高
        .xres = 320,
        .yres = 240,
        .bpp = 16,   //LCD 色深,每个像素占多少位
        .pixclock = 156000,   //像素时钟
        .left_margin = 20,    
        .right_margin = 38,
        .hsync_len = 30,       //水平同步
        .upper_margin = 4,
        .lower_margin = 15,
        .vsync_len = 3,          //垂直同步
        .lcdcon5 = S3C2410_LCD
CON5_FRM565 |
             S3C2410_LCD
CON5_INVVLINE |
             S3C2410_LCDCON5_INVVFRAME |
             S3C2410_LCDCON5_PWREN |

             S3C2410_LCDCON5_HWSWP,
        };


The frame buffer device uses the following fields:

  - pixclock: pixel clock in ps (pico seconds)
  - left_margin: time from sync to picture
  - right_margin: time from picture to sync
  - upper_margin: time from sync to picture
  - lower_margin: time from picture to sync
  - hsync_len: length of horizontal sync
  - vsync_len: length of vertical sync


static struct s3c2410fb_mach_info s3c2410fb_thomas_info __initdata={
    .displays = &fb_thomas_display,
    .num_displays = 1,
    .default_display = 0,
    .gpcup = 0xffffffff,
    .gpcup_mask = 0xffffffff,
    .gpccon = 0xaa9556a9,
    .gpccon_mask = 0xffffffff,
    .gpdup = 0xffffffff,
    .gpdup_mask = 0xffffffff,
    .gpdcon = 0xaaaaaaaa,
    .gpdcon_mask = 0xffffffff,
    .lpcsel =0x00,
    };
/****************************************************************/

static void __init smdk2410_init(void)
{   
    s3c_i2c0_set_platdata(NULL);
    s3c24xx_fb_set_platdata(&s3c2410fb_thomas_info);   //LCD35 driver Added by Thomas.Yang (Yang Zhiping) 2011-01-30
    platform_add_devices(smdk2410_devices, ARRAY_SIZE(smdk2410_devices));
    smdk_machine_init();
}

在内核编译配置选项中选择:

 Device Drivers  ---> Graphics support  --->

              <*> Support for frame buffer devices  --->

                        <*> S3C2410 LCD framebuffer Support                                                       
                         [*]   S3C2410 lcd debug messages    

              [*] Backlight & LCD device support  --->

                       <*>  Samsung LTV350QV LCD Panel

              [*] Bootup logo  --->

                         [*]   Standard 224-color Linux logo (NEW)

 

make uImage -j4

 

启动内核,LCD既可以显示linux kernel 小企鹅了。

 

你可能感兴趣的:(FS2410开发板)