download kernel 2.6.14 from
cross-compiler version: 3.4.1
yaffs2文件系统补丁: yaffs2.tar.gz
1. 解压内核
tar -zxvf linux2.6.14.tar.bz2
2.修改Makefile文件
ARCH ?= arm
CROSS_COMPILE ?= arm-linux-
3.加入对devfs 文件系统的支持(在2.6.14中还保留着devfs的代码,好像20后的版本将devfs的代码清除了代码树,但是可以使用udev)(udev的使用有待了解)
加入fs/Kconfig
找到 menu "Pseudo filesystems"
添加
config DEVFS_FS
bool "/dev filesystem support (OBSOLETS)"
default y
config DEVFS_MOUNT
bool "mount at boot time"
default y
depends on DEVFS_FS
4.应用内核yaffs文件补丁
解压文件: yaffs2.tar.gz, 进入yaffs的目录
运行 ./patch-ker.sh c /linux2.6.14/
5.修改devs.c文件 /* header file definition*/
#include
#include
#include
/*add nand flash partition infomation*/
static struct mtd_partition partition_info[]= {
{
name:"bootloader",
size:0x00030000,
offset:0,
},
{
name:"kernel",
offset:0x00050000,
size:0x00200000,
},
{
name:"root",
offset:0x00250000,
size:0x03dac000,
}
};
//add partition table
修改结构体
struct s3c2410_platform_nand superlpplatform={
tacls:0,
twrph0:30,
twrph1:0,
sets:&nandset,
nr_sets:1,
};
sets: 支持分区集
nr_sets:设备个数
加入分区集结构体
//add partition table
struct s3c2410_nand_set nandset={
nr_partitions:3, ---> 分区个数
partitions:partition_info,
};
修改结构体
struct platform_device s3c_device_nand = {
.name = "s3c2410-nand",
.id = -1,
.num_resources = ARRAY_SIZE(s3c_nand_resource),
.resource = s3c_nand_resource,
/*add devices here*/
.dev= {
.platform_data=&superlpplatform
}
/*end here*/
};
指定驱动初始化 : arch/arm/mach-s3c2410/mach-smdk2410.c
static struct platform_device *smdk2410_devices[] __initdata = {
...
&s3c_device_nand,
};
6.修改文件drivers/mtd/nand/s3c2410.c文件
禁止ECC校验
找到 chip->ecc.mode = NAND_ECC_SOFT;
修改为 chip->ecc.mode = NAND_ECC_NONE;
7.对系统晶振的设置
修改文件 arch/arm/mach-s3c2440/mach-smdk2440.c
找到
static void __init smdk2440_map_io(void)
{
s3c24xx_init_io(smdk2440_iodesc, ARRAY_SIZE(smdk2440_iodesc));
s3c24xx_init_clocks(16934400);
s3c24xx_init_uarts(smdk2440_uartcfgs, ARRAY_SIZE(smdk2440_uartcfgs));
}
修改
static void __init smdk2440_map_io(void)
{
s3c24xx_init_io(smdk2440_iodesc, ARRAY_SIZE(smdk2440_iodesc));
s3c24xx_init_clocks(12000000);
s3c24xx_init_uarts(smdk2440_uartcfgs, ARRAY_SIZE(smdk2440_uartcfgs));
}
8.make menuconfig 对选项进行配置
(略)
注意:boot option 中的内核启动参数设置
noinitrd root=31:2 ro init=/linuxrc console=ttySAC0
一定要选上:MTD partition support
S3C2410 RTC driver
//set 启动mach_type = 193
;--------------------------------------------------------------------------------------------------------------------------------
Kernel : linux 2.6.24 移植记录:
arch/arm/plat-s3c24xx/common-smdk.c
/* NAND parititon from 2.4.18-swl5 */
static struct mtd_partition smdk_default_nand_part[] = {
[0] = {
.name = "Boot Agent",
.size = SZ_16K,
.offset = 0,
},
[1] = {
.name = "S3C2410 flash partition 1",
.offset = 0,
.size = SZ_2M,
},
…………………………….
}
};
/* choose a set of timings which should suit most 512Mbit
* chips and beyond.
*/
static struct s3c2410_platform_nand smdk_nand_info = {
.tacls = 20,
.twrph0 = 60,
.twrph1 = 20,
.nr_sets = ARRAY_SIZE(smdk_nand_sets),
.sets = smdk_nand_sets,
};
change these two function to
static struct mtd_partition smdk_default_nand_part[] = {
[0] = {
.name = "bootloader",
.size = 0x00030000,
.offset = 0,
},
[1] = {
.name = "kernel",
.offset = 0x00050000,
.size = 0x00200000,
},
[2] = {
.name = "root",
.offset = 0x00250000,
.size = 0x03dac000,
}
};
static struct s3c2410_platform_nand smdk_nand_info = {
.tacls = 0,
.twrph0 = 30,
.twrph1 = 0,
.nr_sets = ARRAY_SIZE(smdk_nand_sets),
.sets = smdk_nand_sets,
};
其他类似于 linux2.6.14 内核
;-------------------------------------------------------------
错误记录:
VGA console 应该不选上
阅读(724) | 评论(0) | 转发(0) |