设为首页 加入收藏

TOP

S3C6410(arm11核)的nandflash移植
2014-11-24 08:07:53 来源: 作者: 【 】 浏览:1
Tags:S3C6410 arm11 nandflash 移植

第一步,配置内核


<*>Memory Technology Device (MTD) support --->
[*] MTD partitioning support
<*> NAND Device Support --->
<*> NAND Flash support for Samsung S3C SoCs
<*> Support for generic platform NAND driver


第二步:配置资源,添加以下代码


(1)头文件
#include
#include
#include
#include
#include


(2)配置信息
#define SZ_1K 0x00000400
#define SZ_1M 0x00100000
/* NAND flash controller */
#define S3C64XX_PA_NAND (0x70200000)
#define S3C64XX_SZ_NAND SZ_1M

struct mtd_partition s3c_partition_info[] ={
{
.name = "Bootloader",
.offset = 0,
.size = (4 * 128 *SZ_1K),
.mask_flags = MTD_CAP_NANDFLASH,
},
{
.name = "Kernel",
.offset = (4 * 128 *SZ_1K),
.size = (5*SZ_1M) ,
.mask_flags = MTD_CAP_NANDFLASH,
},
{
.name = "File System",
.offset = MTDPART_OFS_APPEND,
.size = MTDPART_SIZ_FULL,
}

};

static struct s3c2410_nand_sets3c6410_nand_sets[] = {
[0]= {
.name = "nand",
.nr_chips = 1,
.nr_partitions = ARRAY_SIZE(s3c_partition_info),
.partitions = s3c_partition_info,
},
};

static struct s3c2410_platform_nands3c6410_nand_info = {
.tacls = 25,
.twrph0 = 55,
.twrph1 = 40,
.nr_sets = ARRAY_SIZE(s3c6410_nand_sets),
.sets = s3c6410_nand_sets,
};


(3)注册nandflah设备


1.在static void __init smdk6410_machine_init(void)函数中添加以下代码
s3c_nand_set_platdata(&s3c6410_nand_info);


2.添加平台设备


static struct platform_device*anw6410_devices[] __initdata = {


&s3c_device_fb,


&anw6410_lcd_powerdev,


&anw6410_device_eth,


//新添加


&s3c_device_nand,


};


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇yaffs2移植到内核Linux2.6.38 下一篇shell脚本--Linux终端运行Hadoop-..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·TCP/UDP协议_百度百科 (2025-12-26 12:20:11)
·什么是TCP和UDP协议 (2025-12-26 12:20:09)
·TCP和UDP详解 (非常 (2025-12-26 12:20:06)
·Python 教程 - W3Sch (2025-12-26 12:00:51)
·Python基础教程,Pyt (2025-12-26 12:00:48)