| 
 | 
 
最近在移植linux内核过程中碰到这个问题: 
yaffs Mar 24 2010 14:56:32 Installing.  
msgmni has been set to 118 
io scheduler noop registered 
io scheduler anticipatory registered (default) 
io scheduler deadline registered 
io scheduler cfq registered 
Failed to allocate video RAM: -12 
s3c2410-lcd: probe of s3c2410-lcd failed with error -12 
backlight initialized 
一直不知道是怎么回事,我把移植步骤说下(其实我是一步一步按照手册移植的,但是总是出现这个问题,不知道哪里错了),望大虾能够解答: 
1、修改 drivers/video/s3c2410fb.c文件 
static void s3c2410fb_activate_var(struct fb_info *info) 
{ 
        struct s3c2410fb_info *fbi = info->par; 
        void __iomem *regs = fbi->io; 
        int type = fbi->regs.lcdcon1 & S3C2410_LCDCON1_TFT; 
        struct fb_var_screeninfo *var = &info->var;         
        struct s3c2410fb_mach_info *mach_info = fbi->dev->platform_data; 
        struct s3c2410fb_display *default_display = mach_info->displays + 
                                      mach_info->default_display; 
        int clkdiv = s3c2410fb_calc_pixclk(fbi, var->pixclock) / 2; 
        dprintk("%s: var->xres  = %d\n",__FUNCTION__, var->xres); 
        dprintk("%s: var->yres  = %d\n",__FUNCTION__, var->yres); 
        dprintk("%s: var->bpp   = %d\n",__FUNCTION__, var->bits_per_pixel); 
                 
 
        fbi->regs.lcdcon1 |=  S3C2410_LCDCON1_CLKVAL(default_display->setclkval); 
 
2、修改arch/arm/mach-s3c2410/include/mach/fb.h文件 
/* LCD description */ 
struct s3c2410fb_display { 
        /* LCD type */ 
        unsigned type; 
 
        /* Screen size */ 
        unsigned short width; 
        unsigned short height; 
 
        /* Screen info */ 
        unsigned short xres; 
        unsigned short yres; 
        unsigned short bpp; 
 
        unsigned pixclock;                /* pixclock in picoseconds */  
 
        unsigned setclkval;                /* clkval */修改这个地方 
 
        unsigned short left_margin;          /* value in pixels (TFT) or HCLKs (STN) */ 
        unsigned short right_margin;         /* value in pixels (TFT) or HCLKs (STN) */ 
        unsigned short hsync_len;            /* value in pixels (TFT) or HCLKs (STN) */ 
        unsigned short upper_margin;        /* value in lines (TFT) or 0 (STN) */ 
        unsigned short lower_margin;        /* value in lines (TFT) or 0 (STN) */ 
        unsigned short vsync_len;        /* value in lines (TFT) or 0 (STN) */ 
 
        /* lcd configuration registers */ 
        unsigned long        lcdcon5; 
}; 
 
3、修改LCD参数设置文件:arch/arm/mach-s3c2440/mach-smdk2440.c如下 
/* LCD driver info */ 
 
static struct s3c2410fb_display smdk2440_lcd_cfg __initdata = { 
 
        .lcdcon5        = S3C2410_LCDCON5_FRM565 | 
                          S3C2410_LCDCON5_INVVLINE | 
                          S3C2410_LCDCON5_INVVFRAME | 
                          S3C2410_LCDCON5_PWREN | 
                          S3C2410_LCDCON5_HWSWP, 
 
        .type                = S3C2410_LCDCON1_TFT, 
 
#if defined(CONFIG_FB_S3C24X0_T240320) 
        .width                = 240, 
        .height                = 320, 
 
        .pixclock                = 100000, /* HCLK 100 MHz, divisor 4 */ 
        .setclkval                = 0x4, 
        .xres                = 240, 
        .yres                = 320, 
        .bpp                = 16, 
        .left_margin        = 3,        /* for HFPD*/ 
        .right_margin        = 6,        /* for HBPD*/ 
        .hsync_len        = 1,        /* for HSPW*/ 
        .upper_margin        = 2,        /* for VFPD*/ 
        .lower_margin        = 1,        /* for VBPD*/ 
        .vsync_len        = 1,        /* for VSPW*/ 
 
#elif        defined(CONFIG_FB_S3C24X0_S320240) 
        .width                = 320, 
        .height                = 240, 
 
        .pixclock                = 80000, /* HCLK 100 MHz, divisor 3 */ 
        .setclkval                = 0x3, 
        .xres                = 320, 
        .yres                = 240, 
        .bpp                = 16, 
        .left_margin        = 15,        /* for HFPD*/ 
        .right_margin        = 5,        /* for HBPD*/ 
        .hsync_len        = 8,        /* for HSPW*/ 
        .upper_margin        = 5,        /* for VFPD*/ 
        .lower_margin        = 3,        /* for VBPD*/ 
        .vsync_len        = 15,        /* for VSPW*/ 
 
#elif        defined(CONFIG_FB_S3C24X0_W320240) 
        .width                = 320, 
        .height                = 240, 
 
        .pixclock                = 80000, /* HCLK 100 MHz, divisor 3 */ 
        .setclkval                = 0x3, 
        .xres                = 320, 
        .yres                = 240, 
        .bpp                = 16, 
        .left_margin        = 28,        /* for HFPD*/ 
        .right_margin        = 24,        /* for HBPD*/ 
        .hsync_len        = 42,        /* for HSPW*/ 
        .upper_margin        = 6,        /* for VFPD*/ 
        .lower_margin        = 2,        /* for VBPD*/ 
        .vsync_len        = 12,        /* for VSPW*/ 
 
#elif        defined(CONFIG_FB_S3C24X0_LCD480272) 
        .width                = 480, 
        .height                = 272, 
 
        .pixclock                = 40000, /* HCLK 100 MHz, divisor 1 */ 
        .setclkval                = 0x4, 
        .xres                = 480, 
        .yres                = 272, 
        .bpp                = 16, 
        .left_margin        = 19,        /* for HFPD*/ 
        .right_margin        = 10,        /* for HBPD*/ 
        .hsync_len        = 30,        /* for HSPW*/ 
        .upper_margin        = 4,        /* for VFPD*/ 
        .lower_margin        = 2,        /* for VBPD*/ 
        .vsync_len        = 8,        /* for VSPW*/ 
 
#elif        defined(CONFIG_FB_S3C24X0_TFT640480) 
        .width                = 640, 
        .height                = 480, 
 
        .pixclock                = 40000, /* HCLK 100 MHz, divisor 1 */ 
        .setclkval                = 0x1, 
        .xres                = 640, 
        .yres                = 480, 
        .bpp                = 16, 
        .left_margin        = 40,        /* for HFPD*/ 
        .right_margin        = 67,        /* for HBPD*/ 
        .hsync_len        = 31,        /* for HSPW*/ 
        .upper_margin        = 5,        /* for VFPD*/ 
        .lower_margin        = 25,        /* for VBPD*/ 
        .vsync_len        = 1,        /* for VSPW*/ 
 
#elif        defined(CONFIG_FB_S3C24X0_TFT800480) 
        .width                = 800, 
        .height                = 480, 
 
        .pixclock                = 40000, /* HCLK 100 MHz, divisor 1 */ 
        .setclkval                = 0x1, 
        .xres                = 800, 
        .yres                = 480, 
        .bpp                = 16, 
        .left_margin        = 15,        /* for HFPD*/ 
        .right_margin        = 47,        /* for HBPD*/ 
        .hsync_len        = 95,        /* for HSPW*/ 
        .upper_margin        = 9,        /* for VFPD*/ 
        .lower_margin        = 5,        /* for VBPD*/ 
        .vsync_len        = 1,        /* for VSPW*/ 
 
#elif        defined(CONFIG_FB_S3C24X0_TFT800600) 
        .width                = 800, 
        .height                = 600, 
 
        .pixclock                = 40000, /* HCLK 100 MHz, divisor 1 */ 
        .setclkval                = 0x1, 
        .xres                = 800, 
        .yres                = 600, 
        .bpp                = 16, 
        .left_margin        = 15,        /* for HFPD*/ 
        .right_margin        = 47,        /* for HBPD*/ 
        .hsync_len        = 95,        /* for HSPW*/ 
        .upper_margin        = 9,        /* for VFPD*/ 
        .lower_margin        = 5,        /* for VBPD*/ 
        .vsync_len        = 1,        /* for VSPW*/ 
 
#endif 
}; 
4、修改drives/video/Kconfig 文件如下: 
config FB_S3C24X0 
        tristate "S3C24X0 LCD framebuffer support" 
        depends on FB && ARCH_S3C2410 
        select FB_CFB_FILLRECT 
        select FB_CFB_COPYAREA 
        select FB_CFB_IMAGEBLIT 
        ---help--- 
          Frame buffer driver for the built-in LCD controller in the Samsung 
          S3C2410 processor. 
 
          This driver is also available as a module ( = code which can be 
          inserted and removed from the running kernel whenever you want). The 
          module will be called s3c2410fb. If you want to compile it as a module, 
          say M here and read <file:Documentation/kbuild/modules.txt>. 
 
          If unsure, say N. 
choice 
        prompt "LCD select" 
        depends on FB_S3C24X0 
        help 
           S3C24X0 LCD size select 
config FB_S3C24X0_S320340 
        boolean "3.5 inch 320x240 Samsung LCD" 
        depends on FB_S3C24X0 
        help 
           3.5 inch 320x240 Samgsung LCD 
config FB_S3C24X0_W320340 
        boolean "3.5 inch 320x240 WanXin LCD" 
        depends on FB_S3C24X0 
        help 
           3.5 inch 320x240 WanXin LCD 
config FB_S3C24X0_T240320 
        boolean "3.5 inch 240x320 Toshiba LCD" 
        depends on FB_S3C24X0 
        help 
           3.5 inch 240x320 Toshiba LCD 
config FB_S3C24X0_TFT480272 
        boolean "4.3 inch 480x272 TFT LCD" 
        depends on FB_S3C24X0 
        help 
           4.3 inch 480x272 TFT LCD 
config FB_S3C24X0_TFT640480 
        boolean "VGA 640x480" 
        depends on FB_S3C24X0 
        help 
           VGA 640x480 
config FB_S3C24X0_TFT800480 
        boolean "7 inch 800x480 LCD" 
        depends on FB_S3C24X0 
        help 
           7.0 inch 800x480 LCD 
config FB_S3C24X0_TFT800600 
        boolean "10.4 inch 800x600 TFT LCD" 
        depends on FB_S3C24X0 
        help 
           10.4 inch 800x600 TFT LCD 
endchoice 
 
config FB_S3C2410_DEBUG 
        bool "S3C24X0 lcd debug messages" 
        depends on FB_S3C24X0 
        help 
          Turn on debugging messages. Note that you can set/unset at run time 
          through sysfs 
5、再修改drivers/video/Makefile文件: 
obj-$(CONFIG_FB_BROADSHEET)       += broadsheetfb.o 
obj-$(CONFIG_FB_S1D13XXX)          += s1d13xxxfb.o 
obj-$(CONFIG_FB_SH7760)                  += sh7760fb.o 
obj-$(CONFIG_FB_IMX)              += imxfb.o 
obj-$(CONFIG_FB_S3C)                  += s3c-fb.o 
 
obj-$(CONFIG_FB_S3C24X0)          += s3c2410fb.o        //这是根据要求修改的 
 
obj-$(CONFIG_TQ2440_BACKLIGHT)          +=EmbedSky_backlight.o 
obj-$(CONFIG_FB_FSL_DIU)          += fsl-diu-fb.o 
obj-$(CONFIG_FB_COBALT)           += cobalt_lcdfb.o 
obj-$(CONFIG_FB_PNX4008_DUM)          += pnx4008/ 
obj-$(CONFIG_FB_PNX4008_DUM_RGB)  += pnx4008/ 
obj-$(CONFIG_FB_IBM_GXT4500)          += gxt4500.o 
obj-$(CONFIG_FB_PS3)                  += ps3fb.o 
obj-$(CONFIG_FB_SM501)            += sm501fb.o 
obj-$(CONFIG_FB_XILINX)           += xilinxfb.o 
 
6、制作Linux开机logo之1--图片处理 
        这个肯定没问题! 
 
7、制作Linux开机logo之2--支持更多LCD设置 
 
        这个也肯定没问题 
8、内核配置:(手册上是15.6步,对照了好几遍,应该没有错误) 
  选择:3.5inch 320x240 WanXin LCD 
        Standard 224-color Linux logo 
然后编译出镜像,烧写进开发板(TQ2440)启动系统,LCD首先是同时显示各种颜色,过会儿,系统启动完就变成纯白色,然后一直这样子!!这是怎么回事呢?后来我用光盘内核源码镜像写进开发板,能够顺利地进入LCD触摸屏校正程序,最终能够出现操作界面!yaffs文件系统是我自己建立的,仅有的区别是linux内核不同!用我自己移植内核什么都进不了,超级终端能够操作,LCD一直显示纯白色!!! |   
 
 
 
 |