首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 系统运维 >

移栽cramfs文件系统时uboot不能使能硬件ECC

2013-04-12 
移植cramfs文件系统时uboot不能使能硬件ECC***********************************************************

移植cramfs文件系统时uboot不能使能硬件ECC

*****************************************************************************************************************

作        者:fulinux

版权所有:fulinux

装载声明:

http://blog.csdn.net/sonbai/article/details/8785038

http://blog.csdn.net/sonbai/article/details/8785146

http://blog.csdn.net/sonbai/article/details/8784808

http://blog.csdn.net/sonbai/article/details/8784046

*****************************************************************************************************************



Modified by fulinux for s3c2440/s3c2410 board.

 DRAM:  64 MiB
## Unknown FLASH on Bank 0: ID 0xffff, Size = 0x00000000 = 0 MB
Flash: 0 Bytes
NAND:  64 MiB
In:    serial
Out:   serial
Err:   serial
Net:   dm9000
Hit any key to stop autoboot:  0 


NAND read: device 0 offset 0x100000, size 0x600000
 6291456 bytes read: OK
## Booting kernel from Legacy Image at 30008000 ...
   Image Name:   Linux Kernel
   Created:      2013-04-10  11:27:41 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2051992 Bytes = 2 MiB
   Load Address: 30008000
   Entry Point:  30008040
   Verifying Checksum ... OK
   XIP Kernel Image ... OK
OK
OS entry point: 30008040
Image entry poit=30008040


Starting kernel ...


Uncompressing Linux... done, booting the kernel.
Linux version 3.0.0 (lingyun@localhost.localdomain) (gcc version 4.5.4 (Buildroot 2012.08) ) #11 Wed Apr 10 19:27:38 CST 2013
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
CPU: VIVT data cache, VIVT instruction cache
Machine: SMDK2440
Memory policy: ECC disabled, Data cache writeback
CPU S3C2440A (id 0x32440001)
S3C24XX Clocks, Copyright 2004 Simtec Electronics
S3C244X: core 405.000 MHz, memory 101.250 MHz, peripheral 50.625 MHz
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: noinitrd root=/dev/mtdblock2 rootfstype=cramfs init=/linuxrc console=ttyS0,115200 mem=64M loglevel=7
PID hash table entries: 256 (order: -2, 1024 bytes)
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: 60792k/60792k available, 4744k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
    vmalloc : 0xc4800000 - 0xf6000000   ( 792 MB)
    lowmem  : 0xc0000000 - 0xc4000000   (  64 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .init : 0xc0008000 - 0xc0024000   ( 112 kB)
      .text : 0xc0024000 - 0xc03c0000   (3696 kB)
      .data : 0xc03c0000 - 0xc03deb40   ( 123 kB)
       .bss : 0xc03deb64 - 0xc0405884   ( 156 kB)
NR_IRQS:85
irq: clearing pending ext status 00080000
irq: clearing subpending status 00000002
Console: colour dummy device 80x30
console [ttyS0] enabled
Calibrating delay loop... 201.52 BogoMIPS (lpj=503808)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
gpiochip_add: gpios 288..303 (GPIOK) failed to register
gpiochip_add: gpios 320..334 (GPIOL) failed to register
gpiochip_add: gpios 352..353 (GPIOM) failed to register
NET: Registered protocol family 16
S3C Power Management, Copyright 2004 Simtec Electronics
S3C2440: Initialising architecture
S3C2440: IRQ Support
S3C244X: Clock Support, DVS off
bio: create slab <bio-0> at 0
SCSI subsystem initialized
s3c-i2c s3c2440-i2c: slave address 0x10
s3c-i2c s3c2440-i2c: bus frequency set to 98 KHz
s3c-i2c s3c2440-i2c: i2c-0: S3C I2C adapter
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
NetWinder Floating Point Emulator V0.97 (extended precision)
NTFS driver 2.1.30 [Flags: R/O].
JFFS2 version 2.2. (NAND) ? 2001-2006 Red Hat, Inc.
msgmni has been set to 118
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
Console: switching to colour frame buffer device 30x40
fb0: s3c2410fb frame buffer device
s3c2440-uart.0: ttyS0 at MMIO 0x50000000 (irq = 70) is a S3C2440
s3c2440-uart.1: ttyS1 at MMIO 0x50004000 (irq = 73) is a S3C2440
s3c2440-uart.2: ttyS2 at MMIO 0x50008000 (irq = 76) is a S3C2440
brd: module loaded
loop: module loaded
Uniform Multi-Platform E-IDE driver
ide-gd driver 1.18
ide-cd driver 5.00
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c24xx-nand s3c2440-nand: Tacls=3, 29ns Twrph0=7 69ns, Twrph1=3 29ns
s3c24xx-nand s3c2440-nand: NAND hardware ECC
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)
Scanning device for bad blocks
Creating 3 MTD partitions on "NAND":
0x000000000000-0x000000100000 : "u-boot"
0x000000100000-0x000000b00000 : "kernel"
0x000000b00000-0x000004000000 : "rootfs"
dm9000 Ethernet Driver, V1.31
eth0: dm9000e at c4862300,c4864304 IRQ 51 MAC: 08:00:3e:26:0a:11 (chip)
mousedev: PS/2 mouse device common for all mice
S3C24XX RTC, (c) 2004,2006 Simtec Electronics
i2c /dev entries driver
TCP cubic registered
NET: Registered protocol family 17
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
end_request: I/O error, dev mtdblock2, sector 0
Buffer I/O error on device mtdblock2, logical block 0
end_request: I/O error, dev mtdblock2, sector 0
Buffer I/O error on device mtdblock2, logical block 0
end_request: I/O error, dev mtdblock2, sector 8
Buffer I/O error on device mtdblock2, logical block 1
end_request: I/O error, dev mtdblock2, sector 8
Buffer I/O error on device mtdblock2, logical block 1
end_request: I/O error, dev mtdblock2, sector 16
Buffer I/O error on device mtdblock2, logical block 2
end_request: I/O error, dev mtdblock2, sector 16
Buffer I/O error on device mtdblock2, logical block 2
end_request: I/O error, dev mtdblock2, sector 24
Buffer I/O error on device mtdblock2, logical block 3
end_request: I/O error, dev mtdblock2, sector 24
Buffer I/O error on device mtdblock2, logical block 3
List of all partitions:
1f00            1024 mtdblock0  (driver?)
1f01           10240 mtdblock1  (driver?)
1f02           54272 mtdblock2  (driver?)
No filesystem could mount root, tried:  cramfs
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,2)
Backtrace: 
[<c0033590>] (dump_backtrace+0x0/0x10c) from [<c02d5eec>] (dump_stack+0x18/0x1c)
 r6:00008000 r5:c3892007 r4:c03defc0 r3:ffffffff
[<c02d5ed4>] (dump_stack+0x0/0x1c) from [<c02d5f50>] (panic+0x60/0x18c)
[<c02d5ef0>] (panic+0x0/0x18c) from [<c0008df0>] (mount_block_root+0x1d8/0x218)
 r3:c3819f2c r2:00000020 r1:c3819f58 r0:c036b94c
 r7:c036b9b4
[<c0008c18>] (mount_block_root+0x0/0x218) from [<c0008fdc>] (mount_root+0xac/0xd0)
[<c0008f30>] (mount_root+0x0/0xd0) from [<c0009160>] (prepare_namespace+0x160/0x1b8)
 r4:c03debe0
[<c0009000>] (prepare_namespace+0x0/0x1b8) from [<c00089d4>] (kernel_init+0xe4/0x118)
 r5:c001f028 r4:c03deb80
[<c00088f0>] (kernel_init+0x0/0x118) from [<c0045900>] (do_exit+0x0/0x6d0)

 r5:c00088f0 r4:00000000


如果移植cramfs文件系统时,出现上面的情况请确认你的uboot的硬件ECC和内核的软硬件ECC没有开启。

(uboot添加硬件ECC校验可以参考这个文档http://blog.csdn.net/sonbai/article/details/8737129)

第一部分uboot修改:

要做哪些修改呢在include/configs/fl2440.h文件中如下红色部分

/*-----------------------------------
 * NAND flash settings
 */
#if defined(CONFIG_CMD_NAND)
#define CONFIG_NAND_S3C2410
#define CONFIG_SYS_MAX_NAND_DEVICE  1   /* Max number of NAND devices       */
#define CONFIG_SYS_NAND_BASE 0 
#define SECTORSIZE 512
#define SECTORSIZE_2K 2048
#define NAND_SECTOR_SIZE SECTORSIZE
#define NAND_SECTOR_SIZE_2K SECTORSIZE_2K
#define NAND_BLOCK_MASK 511
#define NAND_BLOCK_MASK_2K 2047
#define NAND_MAX_CHIPS 1
#define CONFIG_MTD_NAND_VERIFY_WRITE 
#define CONFIG_SYS_64BIT_VSPRINTF       /* needed for nand_util.c */
#undefCONFIG_S3C2440_NAND_HWECC
#define CONFIG_SYS_NAND_ECCSIZE 512
#define CONFIG_SYS_NAND_ECCBYTES 4
#endif  /* CONFIG_CMD_NAND */

第二部分kernel修改:

在文件drivers/mtd/nand/s3c2410.c中

855     } else {
 856         //chip->ecc.mode        = NAND_ECC_SOFT;
 857         chip->ecc.mode      = NAND_ECC_NONE;
 858     }

同时配置内核时关掉nand的软硬件ECC校验

最后看看这个成功的信息

NAND read: device 0 offset 0x100000, size 0x600000
 6291456 bytes read: OK
## Booting kernel from Legacy Image at 30008000 ...
   Image Name:   Linux Kernel
   Created:      2013-04-10  11:46:38 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2045308 Bytes = 2 MiB
   Load Address: 30008000
   Entry Point:  30008040
   Verifying Checksum ... OK
   XIP Kernel Image ... OK
OK
OS entry point: 30008040
Image entry poit=30008040


Starting kernel ...


Uncompressing Linux... done, booting the kernel.
Linux version 3.0.0 (lingyun@localhost.localdomain) (gcc version 4.5.4 (Buildroot 2012.08) ) #13 Wed Apr 10 19:46:35 CST 2013
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
CPU: VIVT data cache, VIVT instruction cache
Machine: SMDK2440
Memory policy: ECC disabled, Data cache writeback
CPU S3C2440A (id 0x32440001)
S3C24XX Clocks, Copyright 2004 Simtec Electronics
S3C244X: core 405.000 MHz, memory 101.250 MHz, peripheral 50.625 MHz
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: noinitrd root=/dev/mtdblock2 rootfstype=cramfs init=/linuxrc console=ttyS0,115200 mem=64M loglevel=7
PID hash table entries: 256 (order: -2, 1024 bytes)
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: 60800k/60800k available, 4736k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
    vmalloc : 0xc4800000 - 0xf6000000   ( 792 MB)
    lowmem  : 0xc0000000 - 0xc4000000   (  64 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .init : 0xc0008000 - 0xc0024000   ( 112 kB)
      .text : 0xc0024000 - 0xc03bd000   (3684 kB)
      .data : 0xc03be000 - 0xc03dcb40   ( 123 kB)
       .bss : 0xc03dcb64 - 0xc0403884   ( 156 kB)
NR_IRQS:85
irq: clearing pending ext status 00080000
irq: clearing subpending status 00000003
irq: clearing subpending status 00000002
Console: colour dummy device 80x30
console [ttyS0] enabled
Calibrating delay loop... 201.52 BogoMIPS (lpj=503808)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
gpiochip_add: gpios 288..303 (GPIOK) failed to register
gpiochip_add: gpios 320..334 (GPIOL) failed to register
gpiochip_add: gpios 352..353 (GPIOM) failed to register
NET: Registered protocol family 16
S3C Power Management, Copyright 2004 Simtec Electronics
S3C2440: Initialising architecture
S3C2440: IRQ Support
S3C244X: Clock Support, DVS off
bio: create slab <bio-0> at 0
SCSI subsystem initialized
s3c-i2c s3c2440-i2c: slave address 0x10
s3c-i2c s3c2440-i2c: bus frequency set to 98 KHz
s3c-i2c s3c2440-i2c: i2c-0: S3C I2C adapter
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
NetWinder Floating Point Emulator V0.97 (extended precision)
NTFS driver 2.1.30 [Flags: R/O].
JFFS2 version 2.2. (NAND) ? 2001-2006 Red Hat, Inc.
msgmni has been set to 118
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
Console: switching to colour frame buffer device 30x40
fb0: s3c2410fb frame buffer device
s3c2440-uart.0: ttyS0 at MMIO 0x50000000 (irq = 70) is a S3C2440
s3c2440-uart.1: ttyS1 at MMIO 0x50004000 (irq = 73) is a S3C2440
s3c2440-uart.2: ttyS2 at MMIO 0x50008000 (irq = 76) is a S3C2440
brd: module loaded
loop: module loaded
Uniform Multi-Platform E-IDE driver
ide-gd driver 1.18
ide-cd driver 5.00
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c24xx-nand s3c2440-nand: Tacls=3, 29ns Twrph0=7 69ns, Twrph1=3 29ns
s3c24xx-nand s3c2440-nand: NAND ECC disabled
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)
NAND_ECC_NONE selected by board driver. This is not recommended !!
Scanning device for bad blocks
Creating 3 MTD partitions on "NAND":
0x000000000000-0x000000100000 : "u-boot"
0x000000100000-0x000000b00000 : "kernel"
0x000000b00000-0x000004000000 : "rootfs"
dm9000 Ethernet Driver, V1.31
eth0: dm9000e at c4862300,c4864304 IRQ 51 MAC: 08:00:3e:26:0a:11 (chip)
mousedev: PS/2 mouse device common for all mice
S3C24XX RTC, (c) 2004,2006 Simtec Electronics
i2c /dev entries driver
TCP cubic registered
NET: Registered protocol family 17
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
VFS: Mounted root (cramfs filesystem) readonly on device 31:2.
Freeing init memory: 112K


Copyright (C) 2012 fulinux<fulinux@sina.com>
Default Password:  12345
FL2440 login: root
Password: 
[root@FL2440 ~]#ls
dm9000_config.sh
[root@FL2440 ~]#ls
dm9000_config.sh
[root@FL2440 ~]#mount
rootfs on / type rootfs (rw)
/dev/root on / type cramfs (ro,relatime)
proc on /proc type proc (rw,relatime)
tmpfs on /dev type tmpfs (rw,relatime)
ramfs on /tmp type ramfs (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
[root@FL2440 ~]#cd /
[root@FL2440 /]#ls
apps     bin      etc      info     lib      media    proc     sys      usr
backup   dev      home     init     linuxrc  mnt      sbin     tmp      var
[root@FL2440 /]#touch xx
touch: xx: Read-only file system
[root@FL2440 /]#


*****************************************************************************************************************

作        者:fulinux

版权所有:fulinux

装载声明:

http://blog.csdn.net/sonbai/article/details/8785038

http://blog.csdn.net/sonbai/article/details/8785146

http://blog.csdn.net/sonbai/article/details/8784808

http://blog.csdn.net/sonbai/article/details/8784046

*****************************************************************************************************************


热点排行