Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1952665
  • 博文数量: 261
  • 博客积分: 8073
  • 博客等级: 中将
  • 技术积分: 2363
  • 用 户 组: 普通用户
  • 注册时间: 2006-04-10 15:23
文章分类

全部博文(261)

文章存档

2013年(1)

2012年(1)

2011年(50)

2010年(34)

2009年(4)

2008年(17)

2007年(55)

2006年(99)

分类:

2007-04-08 15:46:58

    嵌入式的路真是坎坷不平啊,用yaffs2和jffs2做rootfs不能启动(现在用cramfs+jffs2),cs8900
 
驱动的移植失败,LCD驱动的移植同样失败
 
   在这里记录一下LCD驱动移植的过程吧
 
   板子用的是不知道倒了多少道手的一块烂板子(三年以前买的,学校老师还整的跟个宝贝似的,就是用来
 
摆着看的),内核用的是2.6.20.3。由于2.6的内核里面已经有了lcd的驱动,理论上只是在linux-
 
source/arch/arm/mach-s3c2410/common-smdk.中添加LCD的配置文件就可以了。
 
我添加的内容如下

/* S */
/* LCD driver info */
PNR
#include
#include
static struct s3c2410fb_mach_info s3c2410_lcd_cfg __initdata = {
  .regs = {
   .lcdcon1= S3C2410_LCDCON1_TFT16BPP |S3C2410_LCDCON1_TFT |S3C2410_LCDCON1_CLKVAL(4) | (0<<7) | 0,
    .lcdcon2= S3C2410_LCDCON2_VBPD((2-1)&0xff) |S3C2410_LCDCON2_LINEVAL(319) |S3C2410_LCDCON2_VFPD((3-1)&0xff) |S3C2410_LCDCON2_VSPW(2),
   .lcdcon3= S3C2410_LCDCON3_HBPD((7-1)&0x7f) |S3C2410_LCDCON3_HOZVAL(239) |S3C2410_LCDCON3_HFPD((3-1)&0xff),
   .lcdcon4= S3C2410_LCDCON4_MVAL(13) |S3C2410_LCDCON4_HSPW((4-1)&0xff),
   .lcdcon5= S3C2410_LCDCON5_FRM565 |S3C2410_LCDCON5_INVVLINE |S3C2410_LCDCON5_INVVFRAME,
   },
  /* currently setup by downloader */
  .gpccon = 0xaaaaaaaa,
  .gpccon_mask = 0xffffffff,
  .gpcup = 0xffffffff,
  .gpcup_mask = 0xffffffff,
  .gpdcon = 0xaaaaaaaa,
  .gpdcon_mask = 0xffffffff,
  .gpdup = 0xffffffff,
  .gpdup_mask = 0xffffffff,

   .lpcsel = 0x0,

   .width = 240,
   .height = 320,

   .xres = {
    .min = 240,
    .max = 240,
    .defval = 240,
   },

   .yres = {
    .min = 320,
    .max = 320,
    .defval = 320,
   },

   .bpp = {
    .min = 16,
    .max = 16,
    .defval = 16,
   },
 };
/* E */

   其中寄存器的值参考的是三星公司测试程序中lcdlib.h中的Lcd_Init()函数,这个函

数中给出了STN TFT CSTN三种不同屏在320X240和640X480下的8、16色的相应寄存器的典型

值。

同时在smdk_machine_init函数中添加

 /* S */
 s3c24xx_fb_set_platdata(&s3c2410_lcd_cfg);
 /* E */

在mach-smdk2410.c中的smdk2410_iodesc[]这个结构中添加

IODESC_ENT(LCD)

但是启动内核后在

VIVI version 0.1.4 () (gcc version 2.95.3 20010315 (release))3
MMU table base address = 0x33DFC000                                            
Succeed memory mapping.                                                        
NAND device: Manufacture ID: 0xec, Chip ID: 0x76 (Samsung K9D1208V0M)          
Found saved vivi parameters.                                                   
Press Return to start the LINUX now, any other key for vivi                    
Copy linux kernel from 0x00030000 to 0x30008000, size = 0x00200000 ... done    
zImage magic = 0x016f2818                                                      
Setup linux parameters at 0x30000100                                           
linux command line is: "noinitrd root=31:03 init=/linuxrc console=ttySAC0,11520"
MACH_TYPE = 193                                                                
NOW, Booting Linux......                                                       
Uncompressing Linux.............................................................
Linux version 2.6.20.3 () (gcc version 3.4.1) #51 Sat7
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177                       
Machine: SMDK2410                                                              
ATAG_INITRD is deprecated; please update your bootloader.                      
Memory policy: ECC disabled, Data cache writeback                              
CPU S3C2410 (id 0x32410000)                                                    
S3C2410: core 200.000 MHz, memory 100.000 MHz, peripheral 50.000 MHz           
S3C24XX Clocks, (c) 2004 Simtec Electronics                                    
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on                           
CPU0: D VIVT write-back cache                                                  
CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets            
CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets            
Built 1 zonelists.  Total pages: 16256                                         
Kernel command line: noinitrd root=31:03 init=/linuxrc console=ttySAC0,115200  
irq: clearing pending ext status 00000200                                      
irq: clearing subpending status 00000003                                       
irq: clearing subpending status 00000002                                       
PID hash table entries: 256 (order: 8, 1024 bytes)                             
timer tcon=00000000, tcnt a2c1, tcfg 00000200,00000000, usec 00001eb8          
Console: colour dummy device 80x30                                             
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)                  
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)                   
Memory: 64MB = 64MB total                                                      
Memory: 61964KB available (2488K code, 302K data, 120K init)                   
Mount-cache hash table entries: 512                                            
CPU: Testing write buffer coherency: ok                                        
S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics                      
Registering sysclass                                                           
DMA channel 0 at c4800000, irq 33                                              
DMA channel 1 at c4800040, irq 34                                              
DMA channel 2 at c4800080, irq 35                                              
DMA channel 3 at c48000c0, irq 36                                              
NET: Registered protocol family 16                                             
start running platform_add_devices(smdk_devs, ARRAY_SIZE(smdk_devs))S3C2410 Pows
S3C2410: Initialising architecture                                             
 0:               xdreq0, channels 0---                                        
 1:               xdreq1, channels -1--                                        
 2:                  sdi, channels 0-23                                        
 3:                 spi0, channels -1--                                        
 4:                 spi1, channels ---3                                        
 5:                uart0, channels 0---                                        
 6:                uart1, channels -1--                                        
 7:                uart2, channels ---3                                        
 8:                timer, channels 0-23                                        
 9:              i2s-sdi, channels -12-                                        
10:              i2s-sdo, channels --2-                                        
11:               , channels ----                                        
12:               , channels ----                                        
13:               , channels ----                                        
14:              usb-ep1, channels 0---                                        
15:              usb-ep2, channels -1--                                        
16:              usb-ep3, channels --2-                                        
17:              usb-ep4, channels ---3                                        
usbcore: registered new interface driver usbfs                                 
usbcore: registered new interface driver hub                                   
usbcore: registered new device driver usb                                      
NET: Registered protocol family 2                                              
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)                 
TCP established hash table entries: 2048 (order: 1, 8192 bytes)                
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)                       
TCP: Hash tables configured (established 2048 bind 1024)                       
TCP reno registered                                                            
NetWinder Floating Point Emulator V0.97 (double precision)                     
JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.                          
io scheduler noop registered                                                   
io scheduler anticipatory registered(default)                                 
io scheduler deadline registered                                               
io scheduler cfq registered                          

就停住了,奇怪,继续寻找原因吧(难道内核配置有问题)

阅读(1739) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2009-02-25 11:38:27

好像根本没有看见你的LCD的启动信息哦。QQ:14946517