/************************************************
* Configuring Nandflash on Eilian6410
************************************************
*/
struct mtd_partition eilian6410_nand_part[] = {
{
.name = "Bootloader",
.offset = 0,
.size = (1 * SZ_1M),
.mask_flags = MTD_CAP_NANDFLASH,
},
{
.name = "Kernel",
.offset = (1 * SZ_1M),
.size = (5*SZ_1M) ,
.mask_flags = MTD_CAP_NANDFLASH,
},
{
.name = "User",
.offset = (6 * SZ_1M),
.size = (200*SZ_1M) ,
},
{
.name = "File System",
.offset = MTDPART_OFS_APPEND,
.size = MTDPART_SIZ_FULL,
}
};
//将NANDFLASH分成四个区域,这些分区大小必须要和你的UBOOT中NAND的分区要一致,否则后果自负。。
static struct s3c2410_nand_set eilian6410_nand_sets[] = {
[0] = {
.name = "nand",
.nr_chips = 1,
.nr_partitions = ARRAY_SIZE(eilian6410_nand_part),
.partitions = eilian6410_nand_part,
},
};
//在arch/arm/plat-samsung/include/plat/目录下的nand.h文件中有两个结构体
这两个结构体都是与具体的芯片相关的,里面的有些东西需要我们在板层文件中给他们传值
/********************************************************************************
定义芯片信息
struct s3c2410_nand_set {
unsigned int disable_ecc:1;
unsigned int flash_bbt:1;
unsigned int options;
int nr_chips;
int nr_partitions;
char *name;
int *nr_map;
struct mtd_partition *partitions;
struct nand_ecclayout *ecc_layout;
};
/***对于NANDFLASH作为平台设备的一些时序信息等
struct s3c2410_platform_nand {
/* timing information for controller, all times in nanoseconds */
int tacls; /* time for active CLE/ALE to nWE/nOE */
int twrph0; /* active time for nWE/nOE */
int twrph1; /* time for release CLE/ALE from nWE/nOE inactive */
unsigned int ignore_unset_ecc:1;
int nr_sets;
struct s3c2410_nand_set *sets;
void (*select_chip)(struct s3c2410_nand_set *,
int chip);
};
/**********************************************************************************