分类: LINUX
2010-05-14 14:11:07
Mini2440移植nand驱动并更改分区信息
1.创建自己的mini2440驱动:
(1)
cp arch/arm/plat-s
cp arch/arm/plat-s
(2)
修改common-mini2440.c文件内容如下:
/* NAND parititon
from
//替换 :%s/smdk/mini2440/g
//删除LED的无关代码
//common-mini2440.c
static struct
mtd_partition mini2440_default_nand_part[] = {
[0] = {
.name = "superviv",
.size = 0x00030000,
.offset = 0,
},
[1] = {
.name = "kernel",
.offset = 0x00050000,
.size = 0x00200000,
},
[2] = {
.name = "root",
.offset = 0x00250000,
.size = 0x03dac000,
}
};
static struct s
[0] = {
.name = "NAND",
.nr_chips = 1,
.nr_partitions = ARRAY_SIZE(mini2440_default_nand_part),
.partitions = mini2440_default_nand_part,
},
};
/* choose a set of
timings which should suit most 512Mbit
* chips and beyond.
*/
static struct s
.tacls = 20,
.twrph0 = 60,
.twrph1 = 20,
.nr_sets = ARRAY_SIZE(mini2440_nand_sets),
.sets = mini2440_nand_sets,
};
/* devices we
initialise */
static struct
platform_device __initdata *mini2440_devs[] = {
&s
&s
&s
};
void __init
mini2440_machine_init(void)
{
s
platform_add_devices(mini2440_devs,
ARRAY_SIZE(mini2440_devs));
s
}
(3)修改mini2440.h内容如下:
/*
linux/include/asm-arm/plat-s
*
* This program is free software; you can
redistribute it and/or modify
* it under the terms of the GNU General Public
License version 2 as
* published by the Free Software Foundation.
*/
extern void
mini2440_machine_init(void);
(4)修改 arch/arm/plat-s3cxx/Kconfig
,添加:
config
MACH_MINI2440
bool
help
Common machine code for MINI2440 and
MINI2440
~
(5)修改arch/arm/plat-s3cxx/Makefile
,添加
obj-$(CONFIG_MACH_MINI2440) += common-mini2440.o