我用的内核版本是linux-3.0.1,yaffs是飞凌linux-3.0.1根目录里的那个,按照此教程刷入后会报错,解决方法如下:
用飞凌的对应目录文件替换
替换:linux-3.0.1\fs\yaffs2\yaffs_vfs.c
替换:linux-3.0.1\include\linux\mtd\partitions.h
正确配置内核方法:
cp arch/arm/configs/s3c6400_defconfig .config
make menuconfig
1.System Type,取消SMDK6400 ,A&W6410,SMDK6410等平台,只选择OK6410
2.Device Drivers --> Generic Driver Options选择
[*] Maintain a devtmpfs filesystem to mount at /dev
[*] Automount devtmpfs at /dev, after the kernel mounted the ....
3.Device Drivers-->Memory Technology Device (MTD) support -->Caching block device access to MTD devices,(先选择 然后才能够在File Systems--->Miscellaneous filesystem下面找到YAFFS2。)
4.Device Drivers --> Memory Technology Device (MTD) support --->NAND Device Support ---> 取消NAND Flash support for Samsung S3C SoCs ,选择 NAND support for Samsung S3C64xx S5P64xx
<*> NAND support for Samsung S3C64xx S5P64xx │ │
│ │ [*] Samsung S3C64xx S5P64xx NAND driver debug │ │
│ │ [*] Samsung S3C64xx S5P64xx NAND Hardware ECC 8BITS (不选会出错)
5.File Systems 配置 取消 Second extended fs support 和 Ext3 journalling file system support , [*] Miscellaneous filesystems --->选择
<*> yaffs2 file system support │ │
│ │ -*- 512 byte / page devices │ │
│ │ [ ] Use older-style on-NAND data format with pageStatus byt│ │
│ │ [ ] Lets yaffs do its own ECC │ │
│ │ -*- 2048 byte (or larger) / page devices │ │
│ │ [*] Autoselect yaffs2 format │ │
│ │ [*] Disable yaffs from doing ECC on tags by default
│ [ ] Force chunk erase check │ │
│ │ [ ] Empty lost and found on boot │ │
│ │ [ ] Disable yaffs2 block refreshing │ │
│ │ [ ] Disable yaffs2 background processing │ │
│ │ [*] Enable yaffs2 xattr support
备注:我的虚拟机使用的是ubuntu10,所以选项都用*,不能用M,
错误:make[3]: *** No rule to make target `drivers/mtd/nand/s3c_nand.o', needed by `drivers/mtd/nand/built-in.o'. Stop.
解决方法:复制linux-3.0.1\drivers\mtd\nand\s3c_nand.c
错误:drivers/mtd/nand/s3c_nand.c:1400: error: implicit declaration of function 'add_mtd_partitions'
解决方法:替换:linux-3.0.1\include\linux\mtd\partitions.h
linux-3.0.1\fs\yaffs2\yaffs_vfs.c
yaffs_vfs.c这个文件如下地方增加了东西才能正常工作,飞凌用//gjl做了标记
param->no_tags_ecc = 1; // gjl
yaffs2文件系统的故障
用文件内容比较软件分析很方便:Beyond Compare 4
错误:make[3]: *** No rule to make target `drivers/mtd/nand/s3c_nand.o', needed by `drivers/mtd/nand/built-in.o'. Stop.
解决方法:复制linux-3.0.1\drivers\mtd\nand\s3c_nand.c
错误:drivers/mtd/nand/s3c_nand.c:1400: error: implicit declaration of function 'add_mtd_partitions'
解决方法:替换:linux-3.0.1\include\linux\mtd\partitions.h