|
发表于 2005-7-15 14:58:24
|
显示全部楼层
我的是SamSung FS44B0X ,nand flash 是 16M 的 K9F2808
nand flash 的 pagesize 應是512,blocksize 應是 16K
我都nand flash分了四份︰
Block 1 是 192K
Block 2 是 2M-192K
Block 3 是 8M-(2M) = 6M
Block 4 是 16M-(8M) = 8M
我是可以用yaffs來mount的,可以讀寫的,所以我想我的nand flash driver應沒問題的(不過不知對不對)
不過以jffs2來mount,問題就出來了,只能讀,不能寫
jffs2 的 image我是用
「mkfs.jffs2 -l --pagesize=0x200 --eraseblock=0x4000 --pad=0x30000 -d jffs2 -o jffs2.img」來製的
我把那image mount到block 1 (192K) 那裡
以下是error message:
**************************************
* *
* BIOS for FS44B0 CORE Board V3.30 *
* Http://www.uCdragon.com *
* *
***************************************
Nor Flash ID is : 234B00BF
SST39VF1601 Found
Nand Flash ID is 0xEC73, Size = 16M, Status = 0xC0
Build date : Oct 23 2004--13:57:11
Machine Number is 0
IP address : 192.168.3.100
IP MASK : 255.255.255.0
IP GATE : 192.168.3.1
Serial baud : 115,200
Program save in nor flash
Program save address 0x10000
Program run address 0xC300000
Program boot params : root=/dev/rom0 console=ttyS0,115200
CPU clock is 61,000,000Hz
Current date is 2005-7-15 [FRI]
Current time is 14:44:19
\>mrun
Run program from 0xC300000
Set boot params = root=/dev/rom0 console=ttyS0,115200
Uncompressing Linux............................................................... done, booting the kernel.
Linux version 2.4.24-uc0 (root@localhost) (gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http://fiddes.net/coldfire/)(uClinux XIP and shared lib patches from http://www.snapgear.com/)) #4 Fri Jul 15 14:46:20 HKT 2005
Processor: Samsung S3C44B0X revision 0
Architecture: S3C44B0X
On node 0 totalpages: 2048
zone(0): 0 pages.
zone(1): 2048 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/rom0 console=ttyS0,115200
Console: colour dummy device 80x30
Calibrating delay loop... 30.31 BogoMIPS
Memory: 8MB = 8MB total
Memory: 5916KB available (1750K code, 309K data, 76K init)
Dentry cache hash table entries: 1024 (order: 1, 8192 bytes)
Inode cache hash table entries: 512 (order: 0, 4096 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 2048 (order: 1, 8192 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
devfs: v1.12c (2002081 Richard Gooch ([email protected])
devfs: boot_options: 0x0
NTFS driver v1.1.22 [Flags: R/O]
JFFS2 version 2.2. (C) 2001-2003 Red Hat, Inc.
LCD buffer : 0c3c0000
fbcon_setup: No support for fontwidth 8
fbcon_setup: type 0 (aux 0, depth 0) not supported
Console: switching to colour frame buffer device 80x30
err=0
pty: 256 Unix98 ptys configured
ads7843_ts initialized
ttyS%d0 at I/O 0x1d00000 (irq = 3) is a S3C44B0
ttyS%d1 at I/O 0x1d04000 (irq = 2) is a S3C44B0
ne.c:v1.10 9/23/94 Donald Becker ([email protected])
Last modified Nov 1, 2000 by Paul Gortmaker
NE*000 ethercard probe at 0x6000000:NE2000 driver modified by antisle, Http://www.uCdragon.com
00 49 34 00 00 00
eth0: NE2000 found at 0x6000000, using IRQ 24
Blkmem copyright 1998,1999 D. Jeff Dionne
Blkmem copyright 1998 Kenneth Albanowski
Blkmem 1 disk images:
0: 100000-1D8BFF [VIRTUAL 100000-1D8BFF] (RO)
RAMDISK driver initialized: 16 RAM disks of 1024K size 1024 blocksize
loop: loaded (max 8 devices)
Uniform Multi-Platform E-IDE driver Revision: 7.00beta4-2.4
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
SCSI subsystem driver Revision: 1.00
NAND device: Manufacturer ID: 0xec, Chip ID: 0x73 (Samsung NAND 16MiB 3,3V)
Using static partition definition
Creating 4 MTD partitions on "NAND 16MiB 3,3V":
0x00000000-0x00030000 : "Block1"
mtd: Giving out device 0 to Block1
0x00030000-0x00200000 : "Block2"
mtd: Giving out device 1 to Block2
0x00200000-0x00800000 : "Block3"
mtd: Giving out device 2 to Block3
0x00800000-0x01000000 : "Block4"
mtd: Giving out device 3 to Block4
No NAND device found!!!
usb.c: registered new driver usbdevfs
usb.c: registered new driver hub
sl811.c: v0.30 : Sl811 USB Host Controller Alternate Driver
usb.c: new USB bus registered, assigned bus number 1
sl811.c: USB SL811 at a000000,a000001, IRQ 21
hub.c: USB hub found
hub.c: 1 port detected
usb.c: registered new driver hid
hid-core.c: v1.8.1 Andreas Gal, Vojtech Pavlik <[email protected]>
hid-core.c: USB HID support drivers
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
USB Mass Storage support registered.
mice: PS/2 mouse device common for all mice
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 512 bind 512)
NetWinder Floating Point Emulator V0.95 (c) 1998-1999 Rebel.com
cramfs: wrong magic
FAT: bogus logical sector size 19216
FAT: bogus logical sector size 19216
yaffs: dev is 7936 name is "1f:00"
VFS: Mounted root (romfs filesystem) readonly.
Freeing init memory: 76K
Welcome to
____ _ _
/ __| ||_|
_ _| | | | _ ____ _ _ _ _
| | | | | | || | _ \| | | |\ \/ /
| |_| | |__| || | | | | |_| |/ \
| ___\____|_||_|_| |_|\____|\_/\_/
| |
|_|
For further information check:
http://www.uclinux.org/
BusyBox v0.60.5 (2005.07.15-06:52+0000) Built-in shell (msh)
Enter 'help' for a list of built-in commands.
# mount -t jffs2 /dev/mtdblock0 /mnt
mtdblock_open
ok
nand_read_ecc: from = 0x00000000, len = 1024
Reading data from NAND FLASH without ECC is not recommended
nand_read_ecc: from = 0x00000400, len = 4096
nand_read_ecc: from = 0x00001400, len = 4096
nand_read_ecc: from = 0x00002400, len = 4096
nand_read_ecc: from = 0x00003400, len = 3072
nand_read_ecc: from = 0x00004000, len = 1024
nand_read_ecc: from = 0x00008000, len = 1024
nand_read_ecc: from = 0x0000c000, len = 1024
nand_read_ecc: from = 0x00010000, len = 1024
nand_read_ecc: from = 0x00014000, len = 1024
nand_read_ecc: from = 0x00018000, len = 1024
nand_read_ecc: from = 0x0001c000, len = 1024
nand_read_ecc: from = 0x00020000, len = 1024
nand_read_ecc: from = 0x00024000, len = 1024
nand_read_ecc: from = 0x00028000, len = 1024
nand_read_ecc: from = 0x0002c000, len = 1024
nand_read_ecc: from = 0x00000170, len = 44
nand_read_ecc: from = 0x00000100, len = 44
nand_read_ecc: from = 0x00000088, len = 44
nand_read_ecc: from = 0x0000000c, len = 44
nand_read_ecc: from = 0x00000038, len = 68
nand_read_ecc: from = 0x0000007c, len = 12
nand_read_ecc: from = 0x00000038, len = 68
# nand_read_ecc: from = 0x000000b4, len = 68
nand_read_ecc: from = 0x000000f8, len = 8
nand_read_ecc: from = 0x000000b4, len = 68
nand_read_ecc: from = 0x0000012c, len = 68
nand_read_ecc: from = 0x0000012c, len = 68
nand_read_ecc: from = 0x0000019c, len = 68
nand_read_ecc: from = 0x0000019c, len = 68
#
# cat /proc/mounts
rootfs / rootfs rw 0 0
/dev/root / romfs ro 0 0
/proc /proc proc rw 0 0
none /var ramfs rw 0 0
dev/mtdblock0 /mnt jffs2 rw 0 0
#
# cd mnt
# ls
nand_read_ecc: from = 0x000000b4, len = 68
Reading data from NAND FLASH without ECC is not recommended
nand_read_ecc: from = 0x000000b4, len = 68
nand_read_ecc: from = 0x00000038, len = 68
nand_read_ecc: from = 0x00000038, len = 68
nand_read_ecc: from = 0x0000012c, len = 68
nand_read_ecc: from = 0x0000012c, len = 68
nand_read_ecc: from = 0x0000019c, len = 68
nand_read_ecc: from = 0x0000019c, len = 68
aa b f1 f2 <--------可以讀檔案
#
# ls > c <--------卻不能寫
nand_writev: to = 0x000001e0, len = 68, count = 1
nand_write_ecc: Attempt to write not page aligned data
Write of 68 bytes at 0x000001e0 failed. returned -22, retlen 201991292
nand_writev: to = 0x00000224, len = 68, count = 1
nand_write_ecc: Attempt to write not page aligned data
Write of 68 bytes at 0x00000224 failed. returned -22, retlen 201991292
c: cannot create (Invalid argument)
BusyBox v0.60.5 (2005.07.15-06:52+0000) Built-in shell (msh)
Enter 'help' for a list of built-in commands.
#
請各大俠幫幫忙,謝謝 |
|