real6410 v6开发板
uboot2012.10
linux2.6.39.4
arm-linux-gcc4.4.3(友善光盘)
ubuntu14.04
----------------------------
修改 arch/arm/mach-s3c64xx/mach-smdk6410.c
增加头文件
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <plat/nand.h>
增加nand数据定义
static struct mtd_partition smdk6410_nand_part[] = {
[0] = {
.name = "uboot",
.size = SZ_2M,
.offset = 0,
},
[1] = {
.name = "kernel",
.size = SZ_4M,
.offset = SZ_2M,
},
[2] = {
.name = "rootfs",
.size = MTDPART_SIZ_FULL,
.offset = SZ_2M + SZ_4M,
},
};
static struct s3c2410_nand_set smdk6410_nand_sets[] = {
[0] = {
.name = "nand",
.nr_chips = 1,
.nr_partitions = ARRAY_SIZE(smdk6410_nand_part),
.partitions = smdk6410_nand_part,
},
};
static struct s3c2410_platform_nand smdk6410_nand_info = {
.tacls = 25,
.twrph0 = 55,
.twrph1 = 40,
.nr_sets = ARRAY_SIZE(smdk6410_nand_sets),
.sets = smdk6410_nand_sets,
};
在static struct platform_device *smdk6410_devices[] __initdata = {
..
&s3c_device_nand,
..
}
在static void __init smdk6410_machine_init(void)
{
..
s3c_nand_set_platdata(&smdk6410_nand_info);
...
}
修改 arch/arm/plat-samsung/dev-nand.c,增加-1,这里应该是源码的错误。
static struct resource s3c_nand_resource[] = {
[0] = {.start = S3C_PA_NAND,
.end = S3C_PA_NAND + SZ_1M - 1,
.flags = IORESOURCE_MEM,
}
};
修改内核配置
CONFIG_MTD=y
CONFIG_MTD_BLOCK=y
CONFIG_MTD_PARTITIONS=y
CONFIG_MTD_NAND_S3C2410=y