天嵌 ARM开发社区

 找回密码
 注册
查看: 2726|回复: 0

如何移植JFFS2文件系统到Nor Flash

[复制链接]
zhujunfengx 发表于 2010-11-18 21:03:41 | 显示全部楼层 |阅读模式
drivers/mtd/chips/jedec_probe.c 中添加如下代码:

#define MX29GL128E    0x2271    // 118行

#define SIZE_8MiB  23    //  265行
#define SIZE_16MiB  24


{
        .mfr_id        = MANUFACTURER_MACRONIX,
        .dev_id        = MX29GL128E,
        .name        = "Macronix MX29GL128E",
        .uaddr        = {
            [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
            [1] = MTD_UADDR_0x0555_0x02AA /* x16 */
        },
        .DevSize    = SIZE_16MiB,
        .CmdSet        = P_ID_AMD_STD,
        .NumEraseRegions= 1,
        .regions    = {
            ERASEINFO(0x20000,128),
                    
        }
    },


内核启动打印信息如下:
Uncompressing Linux................................................................. done, booting the kernel.
Kernel Early-Debug on Level 5
Linux version 2.6.14 (root@localhost.localdomain) (gcc version 3.4.3 (release) (CodeSourcery ARM Q3cvs 2004)) #3 Thu Nov 18 20:23:44 HKT 2010
CPU: ARM926EJ-Sid(wb) [41069265] revision 5 (ARMv5TEJ)
Machine: Hi3511v100
Memory policy: ECC disabled, Data cache writeback
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
CPU0: D cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
Built 1 zonelists
Kernel command line: mem=32M noinitrd root=1f02 rootfstype=jffs2 console=ttyAMA0 init=/linuxrc mtdparts=phys_mapped_flash:512K(uboot),1M(kernel),6M(rootfs),8M(app),512K(parameter) pciclksel=16
PID hash table entries: 256 (order: 8, 4096 bytes)
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: 32MB = 32MB total
Memory: 30208KB available (1645K code, 393K data, 84K init)
Mount-cache hash table entries: 512
HI_VERSION=LINUX_2_6_14-M05C0303B0103 @Hi3511v110_OSDrv_1_0_0_1 2008-11-03 18:33:31
CPU: Testing write buffer coherency: ok
softlockup thread 0 started up.
NET: Registered protocol family 16
Hisilicon clock system V0.01
Hisilicon PCI work at slave mode.
NetWinder Floating Point Emulator V0.97 (double precision)
devfs: 2004-01-31 Richard Gooch (rgooch@atnf.csiro.au)
devfs: boot_options: 0x0
JFFS2 version 2.2. (NAND) (C) 2001-2003 Red Hat, Inc.
Initializing Cryptographic API
Serial: AMBA PL011 UART driver
ttyAMA0 at MMIO 0x101f1000 (irq = 12) is a AMBA/PL011
ttyAMA1 at MMIO 0x101f2000 (irq = 13) is a AMBA/PL011
ttyAMA2 at MMIO 0x101f3000 (irq = 14) is a AMBA/PL011
io scheduler noop registered
RAMDISK driver initialized: 4 RAM disks of 8192K size 1024 blocksize
physmap flash device: 4000000 at 34000000
phys_mapped_flash: Found 1 x16 devices at 0x0 in 8-bit bank
Amd/Fujitsu Extended Query Table at 0x0040
phys_mapped_flash: CFI does not contain boot bank location. Assuming top.
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
5 cmdlinepart partitions found on MTD device phys_mapped_flash
Creating 5 MTD partitions on "phys_mapped_flash":
0x00000000-0x00080000 : "uboot"
0x00080000-0x00180000 : "kernel"
0x00180000-0x00780000 : "rootfs"
0x00780000-0x00f80000 : "app"
0x00f80000-0x01000000 : "parameter"
NET: Registered protocol family 2
IP route cache hash table entries: 512 (order: -1, 2048 bytes)
TCP established hash table entries: 2048 (order: 3, 32768 bytes)
TCP bind hash table entries: 2048 (order: 3, 40960 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
TCP bic registered
kgdb: Could not setup core I/O for KGDB.
kgdb: Defering I/O setup to kernel module.
Empty flash at 0x0000fffc ends at 0x00010000
CLEANMARKER node found at 0x00010000, not first node in block (0x00000000)
Empty flash at 0x0002fffc ends at 0x00030000
CLEANMARKER node found at 0x00030000, not first node in block (0x00020000)
Empty flash at 0x0004fffc ends at 0x00050000
CLEANMARKER node found at 0x00050000, not first node in block (0x00040000)
Empty flash at 0x0006fffc ends at 0x00070000
CLEANMARKER node found at 0x00070000, not first node in block (0x00060000)
Empty flash at 0x0008fffc ends at 0x00090000
CLEANMARKER node found at 0x00090000, not first node in block (0x00080000)
Empty flash at 0x000afffc ends at 0x000b0000
CLEANMARKER node found at 0x000b0000, not first node in block (0x000a0000)
Empty flash at 0x000c7af8 ends at 0x000d0000
CLEANMARKER node found at 0x000d0000, not first node in block (0x000c0000)
VFS: Mounted root (jffs2 filesystem).
Freeing init memory: 84K

/bin/sh: can't access tty; job control turned off
/ $ l

当我要保存文件的时候,它出现如下错误:
MTD do_write_buffer(): software timeout
Write of 68 bytes at 0x000d000c failed. returned -5, retlen 0
Not marking the space at 0x000d000c as dirty because the flash driver returned retlen zero
MTD do_write_buffer(): software timeout
Write of 68 bytes at 0x000d000c failed. returned -5, retlen 0
Not marking the space at 0x000d000c as dirty because the flash driver returned retlen zero

出现如上错误的话,是哪个地方没移植对呢?谢谢!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号-2 )

GMT+8, 2024-9-12 17:54 , Processed in 1.019571 second(s), 18 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表