移植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 MiBr5: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
*****************************************************************************************************************