分类: LINUX
2013-02-27 14:26:57
Linux-2.6.30 _VGA _VGA _VGA _VGA 驱动移植
与 LCD 移植类似 , 只需 在 linux-2.6.30.4 内核中作相应改动便可实现对 VGA 接口驱动
的移植。下面实验根据需求设置为 640 × 480 输出。
× 时序图
1 、修改 smdk2410_lcd_cfg 结构体
#vi arch/arm/mach-s3c24 1 0/mach-smdk24 1 0.c
作如下改动:
static struct s3c2410fb_display smdk2410_lcd_cfg __initdata = {
.lcdcon5 = S3C2410_LCDCON5_FRM565 |
S3C2410_LCDCON5_INVVLINE |
S3C2410_LCDCON5_INVVFRAME |
S3C2410_LCDCON5_PWREN |
S3C2410_LCDCON5_HWSWP,
.type = S3C2410_LCDCON1_TFT,
.width = 640,
.height = 480,
.pixclock = 5000, /* HCLK 60 MHz, divisor 10 */
.xres = 640,
.yres = 480,
.bpp = 16,
.left_margin = 23,
.right_margin = 1,
.hsync_len = 135,
.upper_margin = 28,
.lower_margin = 2,
.vsync_len = 5,
};
2 、 修改 smdk2440_fb_info 结构体
#vi arch/arm/mach-s3c2440/mach-smdk2440.c
作如下改动:
static struct s3c2410fb_mach_info smdk2440_fb_info __initdata = {
.displays = &smdk2440_lcd_cfg,
.num_displays = 1,
.default_display = 0,
#if 0
/* currently setup by downloader */
.gpccon = 0xaa940659,
.gpccon_mask = 0xffffffff,
.gpcup = 0x0000ffff,
.gpcup_mask = 0xffffffff,
.gpdcon = 0xaa84aaa0,
.gpdcon_mask = 0xffffffff,
.gpdup = 0x0000faff,
.gpdup_mask = 0xffffffff,
#endif
.gpccon = 0xaa955699,
.gpccon_mask = 0xffc003cc,
.gpcup = 0x0000ffff,
.gpcup_mask = 0xffffffff,
.gpdcon = 0xaa95aaa1,
.gpdcon_mask = 0xffc0fff0,
.gpdup = 0x0000faff,
.gpdup_mask = 0xffffffff,
.lpcsel = 0x0f82,
};
3 、修改 drivers/video/s3c2410fb.c
388 // fbi->regs.lcdcon1 |= S3C2410_LCDCON1_CLKVAL(clkdiv);
389 fbi->regs.lcdcon1 |= S3C2410_LCDCON1_CLKVAL(0x01);
重新编译后下载到开发板,启动后可在显示器中看到图像。