关闭

Linux3.4内核Nand Flash驱动的移植

发表于:2014-4-11 10:23

字体: | 上一篇 | 下一篇 | 我要投稿

 作者:vichie2008    来源:51Testing软件测试网采编

  【实验目的】
  Nand flash 是嵌入式系统最常用的内部存储设备,通过移植Nand flash驱动,了解Linux内核Nand Flash的实现。
  说明:在本系统移植课程实验中命令行提示符“$”表示是在主机上执行,“#”表示在目标板执行。
  【实验环境】
  ● 主机:Ubuntu 10.10 (64bit);
  ● 目标机:FS_S5PC100平台;
  ● 交叉编译工具链:arm-eabi-4.4.0(Android4.0.4自带交叉工具链);
  【实验步骤】
  1. 添加驱动文件
  添加针对我们平台的Nand flash驱动。
  ● 拷贝s3c_nand.c到drivers/mtd/nand下;
  ● 拷贝regs-nand.h到arch/arm/mach-s5pc100/include/mach下;
  cp s3c_nand.c drivers/mtd/nand
  cpregs-nand.h arch/arm/mach-s5pc100/include/mach
  2. 修改文件
  针对平台上的nand flash设备,修改drivers/mtd/nand/nand_base.c第2975行。
  for (i = 0; i< 5; i++)
  3. 配置文件修改
  ● 修改drivers/mtd/nand/Kconfig,在if mtd_nand(216行)下面添加如下内容:
config MTD_NAND_S3C
tristate "NAND Flash support for S3C SoC"
depends on (ARCH_S3C64XX || ARCH_S5P64XX || ARCH_S5PC1XX
|| ARCH_S5PC100) && MTD_NAND
help
This enables the NAND flash controller on the S3C.
No board specfic support is done by this driver, each board
must advertise a platform_device for the driver to attach.
config MTD_NAND_S3C_DEBUG
bool "S3C NAND driver debug"
depends on MTD_NAND_S3C
help
Enable debugging of the S3C NAND driver
config MTD_NAND_S3C_HWECC
bool "S3C NAND Hardware ECC"
depends on MTD_NAND_S3C
help
Enable the use of the S3C's internal ECC generator when
using NAND. Early versions of the chip have had problems with
incorrect ECC generation, and if using these, the default of
software ECC is preferable.
If you lay down a device with the hardware ECC, then you will
currently not be able to switch to software, as there is no
implementation for ECC method used by the S3C
21/212>
《2023软件测试行业现状调查报告》独家发布~

关注51Testing

联系我们

快捷面板 站点地图 联系我们 广告服务 关于我们 站长统计 发展历程

法律顾问:上海兰迪律师事务所 项棋律师
版权所有 上海博为峰软件技术股份有限公司 Copyright©51testing.com 2003-2024
投诉及意见反馈:webmaster@51testing.com; 业务联系:service@51testing.com 021-64471599-8017

沪ICP备05003035号

沪公网安备 31010102002173号