分类: LINUX
2010-05-25 16:24:24
4、 修改NANDFlash驱动:
a) 修改arch/arm/plat-s
static struct mtd_partition smdk_default_nand_part[] = {
[0] = {
.name = "Boot Agent", //分区名字
.offset = 0, //分区起始地址
.size = SZ_64K*3, //分区大小,这里第一个分区的大小我是
//根据uboot中start.S中重定向代码段 //拷贝的大小确定为192KB,0x30000
}, // 对于SZ_64K这些定义大小的宏定义在arch/arm/include/asm/Sizes.h
[1] = {
.name = "BootLoader Param Agent",
.offset = SZ_64K*3,
//由uboot中/include/configs/hgateway.h中
//#define CONFIG_ENV_OFFSET 0x30000得到
.size = SZ_64K,
//由uboot中/include/configs/hgateway.h中
//#define CONFIG_ENV_SIZE 0x10000得到
},
[2] = {
.name = "Kernel Agent",
.offset = SZ_256K,
.size = SZ_
},
[3] = { //剩下的划为一个区
.name = "File System Agent",
.offset = SZ_256K+ SZ_
.size = 0x03cc0000, //60MB+744KB
}
};
static struct s
.tacls = 20,
.twrph0 = 60,
.twrph1 = 20,
.nr_sets = ARRAY_SIZE(smdk_nand_sets),
.sets = smdk_nand_sets,
};
//此三个参数根据芯片手册知晓,看了老半天了没有看明白这三个值到底怎么确认
c) 在配置菜单中添加对NANDFlash的支持, #make menuconfig然后在配置菜单中选“Device Drivers——Memory Techonlogy Device(MTC)support——MTD partitioning support——NAND Device Support——NAND Flash support for S