全部博文(118)
分类: LINUX
2008-06-16 14:57:35
1.download kernel source
2.install your cross compiling enviroment
(debian: apt-get install scratchbox...)
3.修改 arch/arm/mach-s3c2410/common-smdk.c 文件里的nand分区信息
默认是这样的:
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,
},
[2] = {
.name = "S3C2410 flash partition 2",
.offset = SZ_4M,
.size = SZ_4M,
},
[3] = {
.name = "S3C2410 flash partition 3",
.offset = SZ_8M,
.size = SZ_2M,
},
[4] = {
.name = "S3C2410 flash partition 4",
.offset = SZ_1M * 10,
.size = SZ_4M,
},
[5] = {
.name = "S3C2410 flash partition 5",
.offset = SZ_1M * 14,
.size = SZ_1M * 10,
},
[6] = {
.name = "S3C2410 flash partition 6",
.offset = SZ_1M * 24,
.size = SZ_1M * 24,
},
[7] = {
.name = "S3C2410 flash partition 7",
.offset = SZ_1M * 48,
.size = SZ_16M,
}
};
/* 改成你自己的分区大小 */
static struct mtd_partition smdk_default_nand_part[] = {
[0] = {
.name = "vivi",
.size = 0x00020000,
.offset = 0,
},
[1] = {
.name = "param",
.offset = 0x00020000,
.size = 0x00010000,
},
[2] = {
.name = "kernel",
.offset = 0x00030000,
.size = 0x001c0000,
},
[3] = {
.name = "root",
.offset = 0x001F0000,
.size = 0x00140000,
}
};
4. 加入 yaffs 文件系统
4.1 download yaffs source
export CVSROOT=:pserver:anonymous@cvs.aleph1.co.uk:/home/aleph1/cvs
cvs logon (Hit return when asked for a password)
cvs checkout yaffs
4.2 加入内核源码中
直接运行下载的yaffs/linux-kernel/patch-ker.sh,以你的内核目录为参数:
$> ./patch-ker.sh /path/to/linux-2.6.18.3/
这样就会在内核的 fs/ 目录下面生成一个 yaffs 的符号链接指向你的这个
/path/to/yaffs/linux-kernel/fs/yaffs 目录
4.3 在Make menuconfig 的时候在文件系统目录里选上 yaffs 就可以了,没有什么东西要你手动去改的。
5. 让DM9000也运行
5.1 在 arch/arm/mach-s3c2410/devs.c 里加入如下关于DM9000的代码,
改一下你的板子的 CS 和 EINIT,我用的是 CS1 和 EINIT0
/* DM9000 add by kf701 */
#define SMDK_PA_DM9000 0x300
static struct resource s3c_dm9k_resource[] = {
[0] = {
.start = S3C2410_CS1 + SMDK_PA_DM9000,
.end = S3C2410_CS1 + SMDK_PA_DM9000 + 0x3,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = S3C2410_CS1 + SMDK_PA_DM9000 + 0x4,
.end = S3C2410_CS1 + SMDK_PA_DM9000 + 0x4 + 0x3f,
.flags = IORESOURCE_MEM,
},
[2] = {
.start = IRQ_EINT0,
.end = IRQ_EINT0,
.flags = IORESOURCE_IRQ,
}
};
static struct dm9000_plat_data s3c_dm9k_platdata = {
.flags = DM9000_PLATF_16BITONLY,
};
struct platform_device s3c_device_dm9k = {
.name = "dm9000",
.id = 0,
.num_resources = ARRAY_SIZE(s3c_dm9k_resource),
.resource = s3c_dm9k_resource,
.dev = {
.platform_data = &s3c_dm9k_platdata,
}
};
EXPORT_SYMBOL(s3c_device_dm9k);
/**************end add *********************/
5.2 然后在 arch/arm/mach-s3c2410/mach-smdk2410.c 里加入上面文件定义的那个 dm9k 设备:
static struct platform_device *smdk2410_devices[] __initdata = {
&s3c_device_usb,
&s3c_device_lcd,
&s3c_device_wdt,
&s3c_device_i2c,
&s3c_device_iis,
/* add by kf701 */
&s3c_device_dm9k,
/* if kernel < 2.6.17,then */
//&s3c_device_nand,
};
5.3 在make menuconfig 的时候选上 dm9000 。
6. 文件系统自己想办法吧。