你好,游客 登录 注册 搜索
背景:
阅读新闻

S3C6410(arm11核)的nandflash移植

[日期:2013-03-14] 来源:Linux社区  作者:h32dong809 [字体:大 中 小]

第一步,配置内核

<*>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 <linux/mtd/nand.h>
#include <linux/mtd/partitions.h>
#include <linux/mtd/physmap.h>
#include <linux/mtd/partitions.h>
#include <plat/nand.h>

(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,

};

linux
相关资讯       S3C6410  S3C6410 arm11  nandflash 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款