主题 : u-boot引导linux内核出现问题,在SDRAM里面可以跑,但是在nand里面就不行 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 12865
精华: 0
发帖: 37
金钱: 190 两
威望: 38 点
综合积分: 74 分
注册时间: 2010-01-14
最后登录: 2018-02-08
楼主  发表于: 2010-04-23 10:17

 u-boot引导linux内核出现问题,在SDRAM里面可以跑,但是在nand里面就不行

为了尊重作者,以上三个连接是我的参考.
1.http://www.aiothome.net/read.php?tid-5610-fpage-0-toread--page-1.html 从ramdisk根文件系统启动Linux成功,总结一下
2.http://blog.chinaunix.net/u3/101649/showart_2105215.html  嵌入式Linux之我行——u-boot-2009.08在2440上的移植详解(一)
3.http://blog.chinaunix.net/u1/34474/showart_2212066.html u-boot移植详细文档
4.我的环境变量的offset 0x60000 size 0x20000,我的分区设置:
[0]=
{
   .name="supervivi"
  .size=0x80000
  .offset=0x,
},
[1]=
{
  .name='''kernel',
  .offset=0x80000,
  .size=0x200000,
}
[2]=
{
  .name=''root',
  .offset=0x280000,
.size=1024*1024*1024;
}
[3]=
{
.name=''nand',
  .offset=0x00000,
.size=1024*1024*1024;
}
5.按照1的步骤,在SDRAM里面可以跑起来,打印如下:
1)[u-boot@MINI2440]# printenv
bootdelay=1
baudrate=115200
ethaddr=08:08:11:18:12:27
ipaddr=192.168.0.3
gatewayip=192.168.0.1
netmask=255.255.255.0
tekkaman=bmp d 70000
stdin=serial
stdout=serial
stderr=serial
ethact=dm9000
bootargs=initrd=0x31000000,0x200000 root=/dev/ram rw init=/linuxrc console=ttySA
C0 mem=128M
bootcmd=nand read 0x32000000 0x80000 0x200000;bootm 0x32000000
serverip=192.168.0.220
2)[u-boot@MINI2440]# tftp 0x32000000 uImage
3)Starting kernel ...tocol family 2x10c/

Uncompressing Linux.............................................................96 bytes)                                                              
TCP esta
..................................................................... done, bootxec)r bad          
[<c000842c>] (kern
TCP bind hash table entries: 4096 (order
ing the kernel.)B 3,3V 8-bit":
Linux version 2.6.30.10-FriendlyARM (root@localhost.localdomain) (gcc version 4.hed 4096 bind 4096)          
DMA channe          
[<c02bad24>] (panic+0x44
TCP
3.2 (Sourcery G++ Lite 2008q3-72) ) #1 Wed Apr 21 01:29:33 CST 2010fc) from [<00000000>] (0x0)008f34
Trying to unpack rootfs image as
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
rootfs image is not initramfs (junk in compressed archi
CPU: VIVT data cache, VIVT instruction cache      

modified by tekkamanninja (tekkaman
Machine: MINI2440Freeing initrd me
Memory policy: ECC disabled, Data cache writeback been set to 245system initia            
    
Console: colour dummy device 80x30driver rt73usbw USB device strin  
console [ttySAC0] enabled  
S3C24XX NAND Driver, (
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)t:    
0x30
s3c2440-nand s3c2440-nand: Tacls=3, 29ns Twrph0=7
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)                          
NAND device: Manufacturer ID: 0x
Memory: 128MB = 128MB totalAND 128MiB 3,3V 8-bi      
Memory: 123448KB available (3632K code, 378K data, 124K init, 0K highmem)t)  
Scanning device for bad blocksx6000000000002 --   0% complet
Creatin
SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Writing to Nand... donerve  
0x000000000000-0x000000080000 : "superviv
Calibrating delay loop... 201.93 BogoMIPS (lpj=504832)80000-0x000000280000 : "Kernel"NI2440]# printenv 3, 32
Mount-cache hash table entries: 51200040280000 : "root"l su          
CPU: Testing write buffer coherency: okroot" extends beyond the end of device
net_namespace: 296 bytes  

                    
oh
DMA channel 1 at c8808040, irq 34ller (OHCI) Driver              
DMA channel 2 at c8808080, irq 35rgs=i
s3c2410-ohci s3c2410-ohci:
DMA channel 3 at c88080c0, irq 36=ttySAC0registere
s3c2410-ohci s3
S3C244X: Clock Support, DVS offed, assigned bus number 1      
bio: create slab <bio-0> at 0ey to stop auto              
SCSI subsystem initialized0-ohci: irq 42, io mem 0x4
usbcore: registered new interface driver usbfsM: device  
usb usb1: New USB device found, i
usbcore: registered new interface driver hub No                                        
usbcore: registered new device driver usbProduct=2, Serface driver                
        (5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)                                    
mice: PS/2 mouse device common
        (5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)(c) 2004,2006 Simtec Electronics27nterface driver spca500          
        (5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)capture interface: v2.00                            
stdin=
gspca:
cfg80211: Calling CRDA for country: UStdout=serial
usbcore: registered new i
NET: Registered protocol family 2 dr                          
eth
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)erface driver etoms068 bytes                                  
TCP established hash table entries: 4096 (order: 3, 32768 bytes)terface driver finepixtenv bootcmd 'nand read 0x32000000 0x80000
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)istered new interface driver mars                        
TCP: Hash tables configured (established 4096 bindc24
                                            
Freeing initrd memory: 2048Kegisteredbootdelay=1 root=/

msgmni has been set to 245erface driver pac7311stere
alg: No test for stdrng (krng)  
ethaddr=0
pac7311: register
io scheduler noop registered (default)ed new interface driver sonixbetmask=2
Console: switching to colour frame buffer device 30x20red        
usb  
i
usbcore: registered new interfac
fb0: s3c2410fb frame buffer device  
serverip=192.168.0.220
sonixj
s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440a50000000,0x200000 root=/dev/ram0 init=/linuxrc cons
spca500: registeredce
s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 7pca501                                                
  
0x000000000000-0x000000080000 : "supervivi"e: registered new interface driver vc032xet
0x000000080000-0x000000280000 : "Kernel"    
vc032x: registered                
0x000000280000-0x000040280000 : "root"ver zc3xx              
DMA  
server
mtd: partition "root" extends beyond the end of device "NAND 128MiB 3,3V 8-bit"erface driver ALi m5602000000,0x200000 root=/dev/ram0 init=/linuxrc conso
ALi m
-- size truncated to 0x7d80000      
usbcore: registered new
0x000000000000-0x000040000000 : "nand"el 2 at c8808080,                
STV
mtd: partition "nand" extends beyond the end of device "NAND 128MiB 3,3V 8-bit"video                  
mem=128M8080c0, i          
USB Video Class driver (
-- size truncated to 0x8000000ootm 0x
S3C2410 Watchdog Timer
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver                        
s3c2410-wdt s3c2410-wdt: wat
s3c2410-ohci s3c2410-ohci: S3C24XX OHCIled                  

Environment siz
s3c2410-ohci s3c2410-ohci: new USB bu                                    
usbcore: registered new interface driver usbserialImage at 32000000 ...acktrace+0x0/0xe
e case sensi
usbserial: USB Serial Driver core partitions:                    
USB Serial support registered for pl2303?)              
   Image Name:   Linux-
usbcore: registered new interface driver pl2303                                  
1f02      
pl2303: Prolific PL2303 USB to serial adaptor driverng Checksum ...
1f03          131072 mtdblock3 (dri
mice: PS/2 mouse device common for all mice
No filesystem could mount root, tried:  e
S3C24XX RTC, (c) 2004,2006 Simtec Electronics          
Kernel panic - not syncing: VFS:
i2c /dev entries driveron unknown-block(1,0)  
Linux video capture interface: v2.00ressing Linux.......................
gspca: main v2.5.0 registeredrace+0x0/0xe8) from [<c02bad2
usbcore: registered new interface driver conex                            
NET: Registered p
conex: registered                
[<c0
mars: registered_namespace+0x10c
usbcore: registered new interface driver ov51930.10-FriendlyARM (root@localhost.localdomain)
ov519: registered            
/0xe
usbcore: registered new interface driver ov534rom [<c003cb3c>] (do_exit+0x0/0x5fc)          
ov534: registered      

Console:
usbcore: registered new interface driver pac207xit+0x0/0x5fc) from [<00000000>] (0x0)        
pac207: registered              
con
usbcore: registered new interface driver pac7311ied by tekkamanninja (tekkamanninja@163.com)    
pac7311: registeredable entries: 16384
usbcore: registered new interface driver sonixb  

I2C:   ready            
DRAM:  64 MB      
(tekk
usbcore: registered new interface driver spca501nux forever!! 4 MTD part        
Hit any key to
spca501: registered          
Memory:
usbcore: registered new interface driver spca50568.0.220highmem)1age star                      
spca505: registered40]# printenv      
usbcore: registered new interface driver spca506rate=115200              
ethaddr=08:08:11:18:1
spca506: registered        
ipaddr=19
usbcore: registered new interface driver spca508000000,0x200000 root=
netmask=255.255.255.0    
spca508: registeredkaman=bmp d 70000  
usbcore: registered new interface driver spca561out=seriallock2 (driver
stderr=serial          
spca561: registeredDIS      
        
usbcore: registered new interface driver vc032x        
DM
DM9000: running in 16 bit mode: u
vc032x: registered      
MAC: 08:08
usbcore: registered new interface driver zc3xx device  
s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled
usbcore: registered new interface driver usbhid
usbhid: v2.6:USB HID core driver
Advanced Linux Sound Architecture Driver Version 1.0.20.
No device for DAI UDA134X
No device for DAI s3c24xx-i2s
ALSA device list:
  No soundcards found.
TCP cubic registered
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
lib80211: common routines for IEEE802.11 drivers
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
RAMDISK: gzip image found at block 0
VFS: Mounted root (ext2 filesystem) on device 1:0.
Freeing init memory: 124K

Processing /etc/profile... Done

# ls
bin         lib         mnt         sys         var
dev         linuxrc     proc        tmp
etc         lost+found  sbin        usr
#
6.将数据COPY到NAND里面去.
1)tftp 0x32000000 uImage
2)nand erase 0x80000 0x200000
3)nand write 0x32000000 0x80000 0x200000
上面就可以把核文件copy
4)tftp 0x31000000 ramdisk.gz
5)nand erase 0x28000000 0x800000
6)nand wite 0x31000000 0x280000 0x80000
7.关电重新启动,打印如下:

U-Boot 2009.08              

modified by tekkamanninja (tekkamanninja@163.com)                                                  
Love Linux forever!!                    

I2C:   ready            
DRAM:  64 MB            
Flash:  2 MB            
NAND:  128 MiB              
Video: 240x320x16 20kHz 62Hz                            
In:    serial            
Out:   serial            
Err:   serial            
Net:   dm9000            
U-Boot 2009.08              
modified by tekkamanninja                        
(tekkamanninja@163.com)                      
Love Linux forever!!                    
Hit any key to stop autoboot:  0                
Flash:  2 MBn'

NAND read: device 0 offset 0x80000, size 0x200000Video: 240x320x16 20kHz 62Hz                    
2097152 bytes read: OKng to col              
## Booting kernel from Legacy Image at 32000000 ...            
Out:   serialistered   rea            
   Image Name:   Linux-2.6.30.10-FriendlyARM:   dm9000            
U-Boot 2009.08      
   Created:      2010-04-20  17:29:40 UTCe                                  
(tekk
   Image Type:   ARM Linux Kernel Image (uncompressed)                                
Love Linux forever!!
   Data Size:    2073500 Bytes =  2 MB autoboot:  0                        
   Load Address: 30008000# tftp 0x32000000        
   Entry Point:  30008000
s3c2440-uart.1: s3c2410_
   Verifying Checksum ... OKrq =                        
   Loading Kernel Image ... OK  
Filename 'uImage'. spca50  
OK  

Starting kernel ...ad address: 0x32000

Uncompressing Linux........................T T T T T T                            


Using dm9000 d
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177r IP address is 192.168.0.3                            
CPU: VIVT data cache, VIVT instruction cache: module loaded............                
Machine: MINI2440name 'uImage'.  
Memory policy: ECC disabled, Data cache writebackne, boot.                                        
CPU S3C2440A (id 0x32440001)              


modified
S3C24XX Clocks, (c) 2004 Simtec Electronics                                          
i
modified by tekkamanninja              
onsole=ttySAC0 mem=128M      
(tekkamanninja@1
NR_IRQS:85CIe      
irq: clearing subpending status 00000002r!!                    
usbcore: registe
PID hash table entries: 512 (order: 9, 2048 bytes)                              
console      


NA
Console: colour dummy device 80x30ize 0x2                          
console [ttySAC0] enabledAddress: 30008000=1d6b, i
Dentry cache hash table entries: 16384 (order: 4, 6              
   Entry Point:  3                
DMA channel 2 at c8808080, irq 35g in 16 bit moden                
DMA channel 3 at c88080c0, irq 362:27                      
g
Usi
S3C244X: Clock Support, DVS off                              
bio: create slab <bio-0> at 05; our IP address is 192.168.
SCSI subsystem initialized                          
usbcore: registered new interface driver usbfsver co                                        
usbcore: registered new interface driver hubLoad address: 0x32000000                    
usbcore: registered new device driver usb                    
co  
Retry count exc
s3c2440-i2c s3c2440-i2c: slave address 0x10
Retry count exceeded; starting again    
s3c2440-i2c s3c2440-i2c: bus frequency set to 98 KHzew interfac                                
dm9000 i
s3c2440-i2c s3c2440-i2c: i2c-0: S3C I2C adapter,                                              
Filename 'uImage'.          
        (5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)  
Loading: T T T T T T                    
pac7311: registered    
        (5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)                
Using dm9000 deviceegistered new inter            
        (5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)ss is 192.168.0.3Bm) R                                              
        (5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm) 0x32000000                        
(tekkama        
              
TCP bind hash table entries: 4096 (order: 2, 16384 bytes); our IP address is 192.168.0.3                          
TCP: Hash tables configured (established 4096 bind 4096)eredRegi                              
1f03    
Retry c
TCP reno registereding againpca506: re
NET: Registered protocol family 1                                
Trying to unpack rootfs image as initramfs...20000300, id: 0x90000a46                    
io scheduler noop registered (default)                          
Filename 'u
Console: switching to colour frame buffer device 30x20s: 0x32000000                        
Loading: T T T T
fb0: s3c2410fb frame buffer device                                  
s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440                                            
dm9000 i/o: 0x20000300, id:
s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440                                                
DM9000: running in 16 bi
s3c2440-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440      

Using dm9000 device                  

sunplus: reg            

A
Filename 'uIm
s3c2440-nand s3c2440-nand: Tacls=3, 29ns Twrph0=7 69ns, Twrph1=3 29nsss: 0x320000008532: r                              
Loading: T T T T
NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-biainxec,                                        
dm9000 i/o: 0x20000300, id: 0x90
t)a4
Scanning device for bad blocks                        
DM900
Creating 4 MTD partitions on "NAND 128MiB 3,3V 8-bit":                                                      
0x000000000000-0x000000080000 : "supervivi"      
RPC:    
Using dm9000 deviceport  
Flash:  2
usb usb1: New USB device found, idVendor=1d6b, idProduct=0001      
Video: 240x320x16 20kHz 62Hz08f34>] (mount_block_root+
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1erial MB0 Watchdog                          
Out:   serial        
usb usb1: Product: S3C24XX OHCI  
Net:   dm90000008f34>] (mo
usb usb1: Manufacturer: Linux 2.6.30.10-FriendlyARM ohci_hcd                    
modified by tekkamanninjanamespace    
usb usb1: SerialNumber: s3c24xxtekkamanninja@163.com)cd: USB 1
usb usb1: configuration #1 chosen from 1 choice            
Love Linux forever!!10c/0x1cc)mage
hub 1-0:1.0: USB hub found                  
Hit an
hub 1-0:1.0: 2 ports detectedx10c/0x1cc) from [<c000842c>
Initializing USB Mass Storage driver...                      
[u-boot@MINI244
usbcore: registered new interface driver usb-storagehann                
bootdelay=1          
s3c  

I2C
mice: PS/2 mouse device common for all mice
DRAM:  64 MB0x49000000el                
S3C24XX RTC, (c) 2004,2006 Simtec Electronics  
NAND:  1        
bootcmd=nand read 0x3200
i2c /dev entries driverotm 0x32000000c2410-ohc
Linux video capture interface: v2.00                                    
gspca: main v2.5.0 registered    
Out:   serial usb1:    
usbcore: registered new interface driver conexytest:   dm90000001.........                  
conex: registered                
..........  
usbcore: registered new interface driver ov534...found, idV                                
ov534: registered
[u-boot@MINI2440
usbcore: registered new interface driver pac207      
usb usb1:        
bootdelay=1          
pac207: registeredce0.10-FriendlyARM
usbcore: registered new interface driver pac7311om server 192.168.0.220; our IP address is 192.1
pac7311: registered                  
usbcore: registered new interface driver sonixbite 2008q3-72) ) #                            
spca501: registered              
Mac
usbcore: registered new interface driver spca505      
Memory polic            
         ######
spca505: registeredkw int            
usbcore: registered new interface driver spca506ferred = 2073564 (1fa3dc hex)C2440A (id 0x324400
spca506: registered                  
usbcore: registered new interface driver spca508        
[u-boot@MINI2440]# tftp 0x32000000 ram
spca508: registered                  
usbcore: registered new interface driver spca561core: regis              
dm9000 i/o: 0x20000300
spca561: registered1.250 MHz          
stk014: registered      
donendin  
usbcore: registered new interface driver t613edmodifie                                    
t613: registered hash table entr
usbcore: registered new interface driver tv8532 0x32000000d new interface driver spca50020000
tv8532: registered                  
usbcore: registered new interface driver vc032xmat for bootm command 80x30                    
vc032x: registered  
NR_IRQS:      
usbcore: registered new interface driver zc3xxtered0 at c                                  
zc3xx: registered
Dentr    
[u-b
usbcore: registered new interface driver ALi m5602                                                  
ALi m5602: registeredace                  
usbcore: registered new interface driver STV06xx              
                              
fi
s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled                
usbcore:        
gatewayip=192.168.0.1ce d          
usbcore: registered new interface driver usbhidnetmask=255.255.255.0                    
ipad
usbhid: v2.6:USB HID core driver                                
RPC: Registered tcp transport module.
lib80211: common routines for IEEE802.11 drivers
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
RAMDISK: gzip image found at block 0
uncompression error
FAT: utf8 is not a recommended IO charset for FAT filesystems, filesystem will b
e case sensitive!
List of all partitions:
1f00             512 mtdblock0 (driver?)
1f01            2048 mtdblock1 (driver?)
1f02          128512 mtdblock2 (driver?)
1f03          131072 mtdblock3 (driver?)
No filesystem could mount root, tried:  ext2 vfat
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)
[<c002d9b0>] (unwind_backtrace+0x0/0xe8) from [<c02bad24>] (panic+0x44/0x124)
[<c02bad24>] (panic+0x44/0x124) from [<c0008f34>] (mount_block_root+0x1c8/0x224)

[<c0008f34>] (mount_block_root+0x1c8/0x224) from [<c0009188>] (prepare_namespace
+0x10c/0x1cc)
[<c0009188>] (prepare_namespace+0x10c/0x1cc) from [<c000842c>] (kernel_init+0xc0
/0xec)
[<c000842c>] (kernel_init+0xc0/0xec) from [<c003cb3c>] (do_exit+0x0/0x5fc)
[<c003cb3c>] (do_exit+0x0/0x5fc) from [<00000000>] (0x0)
我是新手,真的不知道问题出在那里,请大哥们帮我看看,谢谢!!!
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2010-04-23 11:55
如果你用超级终端,用菜单里的"传送"->"获取文本"来保存串口调试信息。否则,你发的东西,没人可以看得懂。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 12865
精华: 0
发帖: 37
金钱: 190 两
威望: 38 点
综合积分: 74 分
注册时间: 2010-01-14
最后登录: 2018-02-08
2楼  发表于: 2010-04-23 12:06
不好意思,第一次发帖子.
我已经按照版主的方法做了.启动不了的打印信息见附件.由于附件大小问题只打印了关键部分.
描述:启动不了的打印信息
附件: 125.TXT (1 K) 下载次数:11
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
3楼  发表于: 2010-04-24 11:18
RAMDISK: Couldn't find valid RAM disk image starting at 0.

如果你用了initrd, 显然initrd没有正确加载

List of all partitions:
1f00             512 mtdblock0 (driver?)
1f01            2048 mtdblock1 (driver?)
1f02          128512 mtdblock2 (driver?)
1f03          131072 mtdblock3 (driver?)
No filesystem could mount root, tried:  ext2 vfat
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)

你在内核命令行上指定的root设备到底是什么?ram0?里面没有可以挂载的文件系统。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 12865
精华: 0
发帖: 37
金钱: 190 两
威望: 38 点
综合积分: 74 分
注册时间: 2010-01-14
最后登录: 2018-02-08
4楼  发表于: 2010-04-25 18:33
终于搞好了,明天发贴把过程写出来