移植2.6.13支持2440
creator
sz111@126.com
1.首先下载最新的linux2.6.13内核源码。
2.更改makefile:
ARCH = arm
CROSS_COMPILE = /usr/local/arm/3.4.1/bin/arm-linux-
3.添加nandflash的分区说明。
在mach-smdk2440.c中加入:
#include
#include
#include
#include
#include
#include
#include
static int chip0_map[] = { 0 }; //add by lili
struct mtd_partition bit_default_nand_part[] = {
[0] = {
.name = "bootloader",
.offset = 0x00000000,
.size = 0x00060000,
},
[1] = {
.name = "kernel",
.offset = 0x00060000,
.size = 0x00200000,
},
[2] = {
.name = "root",
.offset = 0x00260000,
.size = 0x03d9c000,
}
};
/* the bit has 1 selectable slots for nand-flash, the three
* on-board chip areas, as well as the external SmartMedia
* slot.
*
* Note, there is no current hot-plug support for the SmartMedia
* socket.
*/
static struct s3c2410_nand_set bit_nand_sets[] = {
[0] = {
.name = "chip0",
.nr_chips = 1,
.nr_map = chip0_map,
.nr_partitions = ARRAY_SIZE(bit_default_nand_part),
.partitions = bit_default_nand_part
},
};
static struct s3c2410_platform_nand bit_nand_info = {
.tacls = 0,
.twrph0 = 30,
.twrph1 = 0,
.nr_sets = ARRAY_SIZE(bit_nand_sets),
.sets = bit_nand_sets,
};
加入s3c_device_nand
static struct platform_device *smdk2440_devices[] __initdata = {
&s3c_device_usb,
&s3c_device_lcd,
&s3c_device_wdt,
&s3c_device_i2c,
&s3c_device_iis,
&s3c_device_nand,
};
在函数smdk2440_map_io中加入:
s3c_device_nand.dev.platform_data = &bit_nand_info;
禁止ecc校验
修改linux-2.6.13\drivers\mtd\nand\s3c2410.c
NAND_ECC_SOFT改为NAND_ECC_NONE
把频率s3c24xx_init_clocks(16934400);改为s3c24xx_init_clocks(12000000);
4.下载yaffs2
解压后执行./patch-ker.sh c /home/linux/linux-2.6.13 搭上yaffs的补丁。
5.然后修改FS下的 KConfig
在785行加入:
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.
6.编译
先make s3c2410_defconfig
之后编译的时候要选择DEVFS,YAFFS.
yaffs文件系统一定要在pseudo filesystem下选择 [*] Virtual memory file system support (former shm fs)
阅读(2828) | 评论(0) | 转发(0) |