2.6.14在s3c2410上的移植问题(续)
时间:2007-07-02 来源:lengxb
按照下面的方法还是没有通过,bootm后出错
linux 2.6.14支持yaffs2文件系统移植心得
分类:linux文件系统 2.6.14内核移植的总结
一、首先下载内核2.6.14和交叉编译工具3.4.1,详细参考这个文档:
http://www.hfrk.net/S3C2410/kaifa/05122311085973789_56.htm
可以看到其实要修改部分不多,主要是加上nandflash的支持和mtd分区表的填写(为了怕你们链接不上,把nandflash部分的修改拷贝下来),如下:
1. 修改arch\arm\mach-s3c2410\devs.c文件
增加头文件定义
/***********add here***********/
#include
#include
#include
/**************end add********/
增加nand flash分区信息
/***********add here***********/
static struct mtd_partition partition_info[] ={
{
name: "loader",
size: 0x00020000,
offset: 0,
}, {
name: "param",
size: 0x00010000,
offset: 0x00020000,
}, {
name: "kernel",
size: 0x001c0000,
offset: 0x00030000,
}, {
name: "root",
size: 0x00200000,
offset: 0x00200000,
mask_flags: MTD_WRITEABLE,
}, {
name: "user",
size: 0x03af8000,
offset: 0x00400000,
}
};
struct s3c2410_nand_set nandset ={
nr_partitions: 5 ,
partitions: partition_info ,
};
struct s3c2410_platform_nand superlpplatform={
tacls:0,
twrph0:30,
twrph1:0,
sets: &nandset,
nr_sets: 1,
};
/**************end add********/
struct platform_device s3c_device_nand = {
.name = "s3c2410-nand",
.id = -1,
.num_resources = ARRAY_SIZE(s3c_nand_resource),
.resource = s3c_nand_resource,
/***********add here****************/
.dev = {
.platform_data = &superlpplatform
}
/**************end here************/
};
2. 修改arch\arm\mach-s3c2410\mach-smdk2410.c文件
Startic struct platform_device *smdk2410_devices[] __initdata={
&s3c_device_usb,
&s3c_device_lcd;
&s3c_device_wdt,
&s3c_device_i2c;
&s3c_device_iis,
&s3c_device_nand, /*add here*/
};
注:分区表信息要根据你板上的实际来填写,我的就只分了4个区^_^。
二、为了支持yaffs2文件系统,需要帮内核加上对yaffs2文件系统的支持,详细请看这个贴:
http://www.hfrk.net/S3C2410/kaifa/061400335345164_30.htm
主要是把yaffs2文件系统的文件拷贝到fs目录,并修改Makefile 和 Kconfig文件。
在配置方面有些地方要注意一下,以下是我的配置信息:
1,首先make menuconfig,进入配置窗口,然后选择”load an Alternate Configuration File”
把arch/arm/configs/smdk2410_defconfig配置文件load进来。
2,进入Device Drivers->Memory Technology Devices(MTD)目录,配置界面如下:
Memory Technology Device (MTD) support
[ ] Debugging │ │
[ ] MTD concatenating support │ │
[*] MTD partitioning support │ │
[ ] RedBoot partition table parsing │ │
[ ] Command line partition table parsing │ │
[ ] ARM Firmware Suite partition parsing │ │
--- User Modules And Translation Layers │ │
[*] Direct char device access to MTD devices │ │
[*] Caching block device access to MTD devices │ │
[ ] FTL (Flash Translation Layer) support │ │
[ ] NFTL (NAND Flash Translation Layer) support │ │
[ ] INFTL (Inverse NAND Flash Translation Layer) support │ │
RAM/ROM/Flash chip drivers ---> │ │
Mapping drivers for chip access ---> │ │
Self-contained MTD device drivers ---> │ │
NAND Flash Device Drivers ---> │ │
3,进入NAND Flash Device Drivers目录,配置界面如下:
[*] NAND Device Support │ │
[ ] Verify NAND page writes │ │
[*] NAND Flash support for S3C2410/S3C2440 SoC │ │
[*] S3C2410 NAND driver debug │ │
[ ] S3C2410 NAND Hardware ECC │ │
[ ] DiskOnChip 2000, Millennium and Millennium Plus (NAND reimplement│ │
[ ] Support for NAND Flash Simulator │ │
回到File systems->Miscellaneous filesystems目录,配置信息如下:
[*] YAFFS2 file system support │ │
--- 512 byte / page devices │ │
[*] Lets Yaffs do its own ECC │ │
[*] Use the same ecc byte order as Steven Hill's nand_ecc.c │ │
--- 2048 byte (or larger) / page devices │ │
[*] Autoselect yaffs2 format │ │
[*] Disable lazy loading │ │
[*] Turn off wide tnodes │ │
[*] Turn off debug chunk erase check │ │
[*] Cache short names in RAM
可以看到,我基本上把yaffs2的所有选项都选了,因为我还不知道哪些是必要的^_^
差不多了,其它就按照默认的吧。
三、现在轮到郁闷我了很久的devfs的问题,因为2.6.12内核以后取消了devfs的配置选项,具体为了什么我不清楚,不过缺少了它内核问题抱怨找不到mtdblock设备,以下是hn斑竹提供的解决方法:
http://www.hhcn.com/cgi-bin/topic.cgi?forum=3&topic=221&show=25
在他给的pdf文件里面有介绍,不过好像我试过打开不了链接,不知道什么原因,不过不怕,我把里面的内容拷贝出来就是了:
从2.6.12的fs/Kconfig中拷贝下面几项到2.6.14的fs/Kconfig中去:
config DEVFS_FS
bool "/dev file system support (OBSOLETE)"
depends on EXPERIMENTAL
help
This is support for devfs, a virtual file system (like /proc) which
provides the file system interface to device drivers, normally found
in /dev. Devfs does not depend on major and minor number
allocations. Device drivers register entries in /dev which then
appear automatically, which means that the system administrator does
not have to create character and block special device files in the
/dev directory using the mknod command (or MAKEDEV script) anymore.
This is work in progress. If you want to use this, you *must* read
the material in , especially
the file README there.
Note that devfs no longer manages /dev/pts! If you are using UNIX98
ptys, you will also need to mount the /dev/pts filesystem (devpts).
Note that devfs has been obsoleted by udev,
.
It has been stripped down to a bare minimum and is only provided for
legacy installations that use its naming scheme which is
unfortunately different from the names normal Linux installations
use.
If unsure, say N.
config DEVFS_MOUNT
bool "Automatically mount at boot"
depends on DEVFS_FS
help
This option appears if you have CONFIG_DEVFS_FS enabled. Setting
this to 'Y' will make the kernel automatically mount devfs onto /dev
when the system is booted, before the init thread is started.
You can override this with the "devfs=nomount" boot option.
If unsure, say N.
config DEVFS_DEBUG
bool "Debug devfs"
depends on DEVFS_FS
help
If you say Y here, then the /dev file system code will generate
debugging messages. See the file
for more
details.
If unsure, say N.
重新make menuconfig 在File systems->Pseudo filesystems目录里面可以后到devfs的配置选项如下:
[*] /proc file system support │ │
[*] /dev file system support (OBSOLETE) │ │
[*] Automatically mount at boot │ │
[*] Debug devfs │ │
[*] Virtual memory file system support (former shm fs) │ │
[ ] Relayfs file system support
好了,应该完成了,保存配置后,make 生成的zImage下载到flash中就可以成功挂载yaffs2文件系统了(我现在用的是原来2.4内核用的yaffs2文件系统,所以,我现在只是帮我的板换了个2.6的内核而已,下一步打算搞一个属于自己的文件系统,呵呵)。
总结如下,希望能对你有帮助!呵呵,这里还有dozec大侠贡献的文章:
http://www.hhcn.com/cgi-bin/topic.cgi?forum=6&topic=793&show=0
也是2.6.14的内核。
你的vivi的源代码能给我一份吗,谢谢
[email protected]
和我同一块板的话可以到这里下载:
http://www.arm9.com.cn/customer_more.asp?id=1132
还有使用方法。
如果下载不了的话再发给你好了^_^
过去了...
突然想起来某篇文章说到,写某些具有命令参数的代码时~要以tab键做缩进,否则会出现莫名其妙的错误~~我也不记得具体是说哪些文件的了,总之~ 我这样一试就好了
所以,希望楼主在这篇文章加进两点,这样就更"通俗易懂"啦^^
1. 如果是从2.6.12的fs/Kconfig直接拷贝到2.6.14的fs/Kconfig中的话,加到menu "Pseudo filesystems" 下合适的地方(config TMPFS 之前 )就行了.
2. 如果是在这里将代码复制了放到2.6.14的fs/Kconfig中的话,记得按照Kconfig的格式调整复制过去的代码, 要是不清楚的话,那就让config XXX这一行不缩进,其他的都用tab键缩进对齐~~~ 我也不清楚为什么会是这样的规定,总之.只要我的If 项比前面的凸出的话,make menuconfig就出错.
不知道有没有人遇到这个情况.呵呵////得了luo兄的帮助,我也来写点自己的小小心得^_^
PS:我是前面的andan,不小心注册了两个号了....~_~
"mount_devfs_fs(): unable to mount devfs, err: -2"一个困扰了我很久的问题,主要是ecc的问题。在此我把我的理解说一下好了:
请搞清楚你在driver/mtd/nand/s3c2410.c文件中有没有把NAND_ECC_SOFT改成NAND_ECC_NONE,这个网上不少的人都会做(听说会与yaffs文件系统有冲突,但我发现反而和cramfs文件系统有冲突)。这个地方我那时候没有交代清楚,不好意思^_^
假设你把NAND_ECC_SOFT改成NAND_ECC_NONE,那[*] Lets Yaffs do its own ECC 这一步是必需的。
最后,如果你把NAND_ECC_SOFT改成NAND_ECC_NONE的话,那你下载yaffs文件系统的时候就不应该加上-e的参数了。
这个东西我可是经历了无数次的"mount_devfs_fs(): unable to mount devfs, err: -2"才悟出来的,本来想不讲出来的,但实在太多人问这个问题了,实在不忍^_^
最后给点建议:先让内核挂载cramfs试试看(记得把NAND_ECC_SOFT改成NAND_ECC_NONE哦),因为这个文件系统只 要用下载内核的命令下载就行,成功挂载cramfs的话将会是你最大的鼓舞^_^










