我按照最新mini2440 linux移植开发指南时,在操作“移植Nand 驱动并更改分区信息”时,按照文档修改后,再编译zImage时,总是编译通不过,下面是出错信息
arch/arm/mach-s3c2440/mach-mini2440.c:155: error: array type has incomplete element type
arch/arm/mach-s3c2440/mach-mini2440.c:156: error: array index in non-array initializer
arch/arm/mach-s3c2440/mach-mini2440.c:156: error: (near initialization for 'mini2440_default_nand_part')
arch/arm/mach-s3c2440/mach-mini2440.c:158: error: field name not in record or union initializer
arch/arm/mach-s3c2440/mach-mini2440.c:158: error: (near initialization for 'mini2440_default_nand_part')
arch/arm/mach-s3c2440/mach-mini2440.c:160: error: field name not in record or union initializer
arch/arm/mach-s3c2440/mach-mini2440.c:160: error: (near initialization for 'mini2440_default_nand_part')
arch/arm/mach-s3c2440/mach-mini2440.c:162: error: field name not in record or union initializer
arch/arm/mach-s3c2440/mach-mini2440.c:162: error: (near initialization for 'mini2440_default_nand_part')
arch/arm/mach-s3c2440/mach-mini2440.c:165: error: array index in non-array initializer
arch/arm/mach-s3c2440/mach-mini2440.c:165: error: (near initialization for 'mini2440_default_nand_part')
arch/arm/mach-s3c2440/mach-mini2440.c:166: error: field name not in record or union initializer
arch/arm/mach-s3c2440/mach-mini2440.c:166: error: (near initialization for 'mini2440_default_nand_part')
arch/arm/mach-s3c2440/mach-mini2440.c:168: error: field name not in record or union initializer
arch/arm/mach-s3c2440/mach-mini2440.c:168: error: (near initialization for 'mini2440_default_nand_part')
arch/arm/mach-s3c2440/mach-mini2440.c:170: error: field name not in record or union initializer
arch/arm/mach-s3c2440/mach-mini2440.c:170: error: (near initialization for 'mini2440_default_nand_part')
arch/arm/mach-s3c2440/mach-mini2440.c:173: error: array index in non-array initializer
arch/arm/mach-s3c2440/mach-mini2440.c:173: error: (near initialization for 'mini2440_default_nand_part')
arch/arm/mach-s3c2440/mach-mini2440.c:174: error: field name not in record or union initializer
arch/arm/mach-s3c2440/mach-mini2440.c:174: error: (near initialization for 'mini2440_default_nand_part')
arch/arm/mach-s3c2440/mach-mini2440.c:176: error: field name not in record or union initializer
arch/arm/mach-s3c2440/mach-mini2440.c:176: error: (near initialization for 'mini2440_default_nand_part')
arch/arm/mach-s3c2440/mach-mini2440.c:178: error: field name not in record or union initializer
arch/arm/mach-s3c2440/mach-mini2440.c:178: error: (near initialization for 'mini2440_default_nand_part')
arch/arm/mach-s3c2440/mach-mini2440.c:180: error: array index in non-array initializer
arch/arm/mach-s3c2440/mach-mini2440.c:180: error: (near initialization for 'mini2440_default_nand_part')
arch/arm/mach-s3c2440/mach-mini2440.c:181: error: field name not in record or union initializer
arch/arm/mach-s3c2440/mach-mini2440.c:181: error: (near initialization for 'mini2440_default_nand_part')
arch/arm/mach-s3c2440/mach-mini2440.c:183: error: field name not in record or union initializer
arch/arm/mach-s3c2440/mach-mini2440.c:183: error: (near initialization for 'mini2440_default_nand_part')
arch/arm/mach-s3c2440/mach-mini2440.c:185: error: field name not in record or union initializer
arch/arm/mach-s3c2440/mach-mini2440.c:185: error: (near initialization for 'mini2440_default_nand_part')
arch/arm/mach-s3c2440/mach-mini2440.c:187: error: array index in non-array initializer
arch/arm/mach-s3c2440/mach-mini2440.c:187: error: (near initialization for 'mini2440_default_nand_part')
arch/arm/mach-s3c2440/mach-mini2440.c:188: error: field name not in record or union initializer
arch/arm/mach-s3c2440/mach-mini2440.c:188: error: (near initialization for 'mini2440_default_nand_part')
arch/arm/mach-s3c2440/mach-mini2440.c:190: error: field name not in record or union initializer
arch/arm/mach-s3c2440/mach-mini2440.c:190: error: (near initialization for 'mini2440_default_nand_part')
arch/arm/mach-s3c2440/mach-mini2440.c:192: error: field name not in record or union initializer
arch/arm/mach-s3c2440/mach-mini2440.c:192: error: (near initialization for 'mini2440_default_nand_part')
arch/arm/mach-s3c2440/mach-mini2440.c:197: error: array type has incomplete element type
arch/arm/mach-s3c2440/mach-mini2440.c:198: error: array index in non-array initializer
arch/arm/mach-s3c2440/mach-mini2440.c:198: error: (near initialization for 'mini2410_nand_sets')
arch/arm/mach-s3c2440/mach-mini2440.c:199: error: field name not in record or union initializer
arch/arm/mach-s3c2440/mach-mini2440.c:199: error: (near initialization for 'mini2410_nand_sets')
arch/arm/mach-s3c2440/mach-mini2440.c:200: error: field name not in record or union initializer
arch/arm/mach-s3c2440/mach-mini2440.c:200: error: (near initialization for 'mini2410_nand_sets')
arch/arm/mach-s3c2440/mach-mini2440.c:201: error: field name not in record or union initializer
arch/arm/mach-s3c2440/mach-mini2440.c:201: error: (near initialization for 'mini2410_nand_sets')
arch/arm/mach-s3c2440/mach-mini2440.c:201: warning: type defaults to 'int' in declaration of 'type name'
arch/arm/mach-s3c2440/mach-mini2440.c:201: warning: type defaults to 'int' in declaration of 'type name'
arch/arm/mach-s3c2440/mach-mini2440.c:201: error: negative width in bit-field '<anonymous>'
arch/arm/mach-s3c2440/mach-mini2440.c:202: error: field name not in record or union initializer
arch/arm/mach-s3c2440/mach-mini2440.c:202: error: (near initialization for 'mini2410_nand_sets')
arch/arm/mach-s3c2440/mach-mini2440.c:205: error: variable 'mini2440_nand_info' has initializer but incomplete type
arch/arm/mach-s3c2440/mach-mini2440.c:206: error: unknown field 'tacls' specified in initializer
arch/arm/mach-s3c2440/mach-mini2440.c:206: warning: excess elements in struct initializer
arch/arm/mach-s3c2440/mach-mini2440.c:206: warning: (near initialization for 'mini2440_nand_info')
arch/arm/mach-s3c2440/mach-mini2440.c:207: error: unknown field 'twrph0' specified in initializer
arch/arm/mach-s3c2440/mach-mini2440.c:207: warning: excess elements in struct initializer
arch/arm/mach-s3c2440/mach-mini2440.c:207: warning: (near initialization for 'mini2440_nand_info')
arch/arm/mach-s3c2440/mach-mini2440.c:208: error: unknown field 'twrph1' specified in initializer
arch/arm/mach-s3c2440/mach-mini2440.c:208: warning: excess elements in struct initializer
arch/arm/mach-s3c2440/mach-mini2440.c:208: warning: (near initialization for 'mini2440_nand_info')
arch/arm/mach-s3c2440/mach-mini2440.c:209: error: unknown field 'nr_sets' specified in initializer
arch/arm/mach-s3c2440/mach-mini2440.c:209: error: 'mini2440_nand_sets' undeclared here (not in a function)
arch/arm/mach-s3c2440/mach-mini2440.c:209: warning: type defaults to 'int' in declaration of 'type name'
arch/arm/mach-s3c2440/mach-mini2440.c:209: warning: type defaults to 'int' in declaration of 'type name'
arch/arm/mach-s3c2440/mach-mini2440.c:209: error: negative width in bit-field '<anonymous>'
arch/arm/mach-s3c2440/mach-mini2440.c:209: warning: excess elements in struct initializer
arch/arm/mach-s3c2440/mach-mini2440.c:209: warning: (near initialization for 'mini2440_nand_info')
arch/arm/mach-s3c2440/mach-mini2440.c:210: error: unknown field 'sets' specified in initializer
arch/arm/mach-s3c2440/mach-mini2440.c:210: warning: excess elements in struct initializer
arch/arm/mach-s3c2440/mach-mini2440.c:210: warning: (near initialization for 'mini2440_nand_info')
arch/arm/mach-s3c2440/mach-mini2440.c:211: error: unknown field 'ignore_unset_ecc' specified in initializer
arch/arm/mach-s3c2440/mach-mini2440.c:211: warning: excess elements in struct initializer
arch/arm/mach-s3c2440/mach-mini2440.c:211: warning: (near initialization for 'mini2440_nand_info')
网上看了很多博客、论坛,终于找到适合我的答案:
更改drivers/mtd/nand/s3c2410.c关闭ecc校验
chip->ecc.mode = NAND_ECC_SOFT;
改为:chip->ecc.mode = NAND_ECC_NONE;
注:上面这一步我没有做,不知道行不行,以后做实验看看。
然后:
在macn-mini2440中添加头文件
#include <plat/common-smdk.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/nand.h>
#include <linux/mtd/nand_ecc.h>
#include <linux/mtd/partitions.h>
#include <plat/nand.h>
再编译zImage就OK了……
链接:http://www.arm9home.net/simple/index.php?t7611.html