*****************************************
定义芯片信息
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); };
/**********************************************************************************
static struct s3c2410_platform_nand eilian6410_nand_info = { .tacls = 25, .twrph0 = 55, .twrph1 = 40, .nr_sets = ARRAY_SIZE(eilian6410_nand_sets), .sets = eilian6410_nand_sets, }; /************************************************ * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ *^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ************************************************ */
该代码放在static struct platform_device *eilian6410_devices[] __initdata = {上面就行
同时记得添加如下头文件
#include #include #include
|