-
向mach-my6410.c里面填入相应的平台信息:
static struct s3c_fb_pd_win my6410_fb_win0 = {
/* this is to ensure we use win0 */
.win_mode = {
.left_margin = 2,
.right_margin = 2,
.upper_margin = 2,
.lower_margin = 2,
.hsync_len = 41,
.vsync_len = 10,
.xres = 480,
.yres = 272,
},
.max_bpp = 32,
.default_bpp = 16,
};
pixclock = 1000000 / DCLK = 1000000 / 9 = 111111
left_margin = Thb = 2
right_margin = Thf = 2
hsync_len = Thp = 41
upper_margin = Tvb = 2
lower_margin = Tvf = 2
vsync_len = Tvp = 10
xres = Thd = 480
Yres = Tvd = 272
static struct map_desc my6410_iodesc[] = {
{
/* LCD support */
.virtual = (unsigned long)S3C_VA_LCD,
.pfn = __phys_to_pfn(S3C_PA_FB),
.length = SZ_16K,
.type = MT_DEVICE,
},
};
- 然后将28内核中的drviers/video/samsung拷贝到drviers/video/目录下
-
修改drviers/video/的Kconfig文件,在文件中加入
source "drivers/video/samsung/Kconfig"
-
修改修改drviers/video/的Makefie文件,再最后一行添加:
obj-$(CONFIG_FB_S3C_EXT) += samsung/
- 在arch/arm/plat-samsung/include/plat/map-base.h里面添加
#define S3C_VA_LCD S3C_ADDR(0x01100000) /* LCD */
-
在include/generated/atuoconfig.h里面添加
#define CONFIG_FB_S3C_EXT_NUM 4
- 把drivers/video/samsung/s3cfb_fimd4x.c里面的
第1417行:
s3c6410_pm_do_save(s3c_lcd_save, ARRAY_SIZE(s3c_lcd_save));
改成
s3c_pm_do_save(s3c_lcd_save, ARRAY_SIZE(s3c_lcd_save));
第1438行
s3c6410_pm_do_restore(s3c_lcd_save, ARRAY_SIZE(s3c_lcd_save));
改成
s3c_pm_do_restore(s3c_lcd_save, ARRAY_SIZE(s3c_lcd_save));
-
配置内核:
Device Drivers --->
Graphics support --->
<*> Support for frame buffer devices ---> (里面的都空选)
<*> Support for frame buffer devices --->
[ ] Backlight & LCD device support --->
<*> S3C Framebuffer Support (eXtended)(修改Kconfig之后才有这个选)
Select LCD Type (4.3 inch 480x272 TFT LCD) --->
(X) 4.3 inch 480x272 TFT LCD
<*> Advanced options for S3C Framebuffer
Select BPP(Bits Per Pixel) (16 BPP) --->
(4) Number of Framebuffers
[ ] Enable Virtual Screen
[*] Enable Double Buffering
Console display driver support --->
<*> Framebuffer Console support
[*] Bootup logo --->(显示小企鹅)
[*] Standard 224-color Linux logo
如果驱动移植成功内核启动的时候会打印一下信息:
S3C_LCD clock got enabled :: 133.000 Mhz
LCD TYPE :: LTE480WV will be initialized
Window[0] - FB1: map_video_memory: clear ffd80000:0007f800
FB1: map_video_memory: dma=5f900000 cpu=ffd80000 size=0007f800
Window[0] - FB2: map_video_memory: clear ffdbfc00:0003fc00
FB2: map_video_memory: dma=5f93fc00 cpu=ffdbfc00 size=0003fc00
Console: switching to colour frame buffer device 60x34
fb0: s3cfb frame buffer device
Window[1] - FB1: map_video_memory: clear ffd00000:0007f800
FB1: map_video_memory: dma=5f980000 cpu=ffd00000 size=0007f800
Window[1] - FB2: map_video_memory: clear ffd3fc00:0003fc00
FB2: map_video_memory: dma=5f9bfc00 cpu=ffd3fc00 size=0003fc00
fb1: s3cfb frame buffer device
Window[2] - FB1: map_video_memory: clear ffcc0000:0003fc00
FB1: map_video_memory: dma=5fa00000 cpu=ffcc0000 size=0003fc00
fb2: s3cfb frame buffer device
Window[3] - FB1: map_video_memory: clear ffc80000:0003fc00
FB1: map_video_memory: dma=5fa40000 cpu=ffc80000 size=0003fc00
fb3: s3cfb frame buffer device
在LCD还会显示小企鹅:
相应的驱动程序都在
drviers/video/Samsung/s3cfb.c目录下
今天就为这驱动搞了一天,其实早就可以成功的,TMMD的不知道是不是手贱还是怎么的,
竟然把System Type --->
[* ] SMDK6400
选上了,最后系统一直打印都是SMDK6400的信息。幸好我靠
printk(KERN_INFO "DEBUG\n\n\n\n");
找到了原因。
以后有时间好好对LCD驱动做一下分析。