相关软件下载地址:http://pan.baidu.com/s/16yo8Y

fsc100开发板

交叉编译工具:arm-cortex_a8-linux-gnueabi-gcc

Ÿ   添加针对我们平台的Nand flash驱动

拷贝s3c_nand.c到drivers/mtd/nand下

拷贝regs-nand.h到arch/arm/mach-s5pc100/include/mach下

Ÿ   针对平台上的nand flash设备,修改drivers/mtd/nand/nand_base.c第2812行

for  (i = 0; i < 5; i++)

  • 添加内核配置选项

修改drivers/mtd/nand/Kconfig,在if  mtd_nand下面添加如下内容:

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

修改drivers/mtd/nand/Makefile添加如下内容:

obj-$(CONFIG_MTD_NAND_S3C)  +=  s3c_nand.o

  • 修改平台代码

修改arch/arm/mach-s5pc100/mach-smdkc100.c添加如下内容:

  • 添加头文件

#if defined (CONFIG_MTD_NAND_S3C)

#include <linux/mtd/partitions.h>

#include <linux/mtd/mtd.h>

#include <plat/nand.h>

#endif

  • 添加平台设备

#if defined(CONFIG_MTD_NAND_S3C)

/* Nand Flash Support */

static struct mtd_partition s5pc100_nand_part[] = {

        [0] = {

                .name        = "bootloader",

                .size        = SZ_1M,

                .offset        = 0,

        },

        [1] = {

                .name        = "kernel",

                .offset = MTDPART_OFS_APPEND,

                .size        = SZ_1M*3,

        },

        [2] = {

                .name        = "rootfs",

                .offset               = MTDPART_OFS_APPEND,

                .size        = SZ_4M,

        },

        [3] = {

                .name        = "usrfs",

                .offset        = MTDPART_OFS_APPEND,

                .size        = MTDPART_SIZ_FULL,

        },

};

struct s3c_nand_mtd_info s5pc100_nand_mtd_part_info = {

        .chip_nr = 1,

        .mtd_part_nr = ARRAY_SIZE(s5pc100_nand_part),

        .partition = s5pc100_nand_part,

};

 

static struct resource s5pc100_nand_resource[] = {

        [0] = {

                .start = 0xE7200000,

                .end   = 0xE7200000 + SZ_1M,

                .flags = IORESOURCE_MEM,

        }

};

 

struct platform_device s5pc100_device_nand = {

        .name                  = "s5pc100-nand",

        .id                  = -1,

        .num_resources          = ARRAY_SIZE(s5pc100_nand_resource),

        .resource          = s5pc100_nand_resource,

        .dev = {

                .platform_data = &s5pc100_nand_mtd_part_info,

        }

};

#endif

 

  • 添加平台设备列表

在smdkc100_device[]结构体数组中添加如下内容:

#if defined(CONFIG_MTD_NAND_S3C)

        &s5pc100_device_nand,

#endif

  • 修改arch/arm/plat-samsung/include/plat/nand.h添加如下内容:

struct s3c_nand_mtd_info {

        uint chip_nr;

        uint mtd_part_nr;

        struct mtd_partition *partition;

};

  • 配置内核

$ make menuconfig

Device Drivers  --->

<*> Memory Technology Device (MTD) support  --->

[*]   MTD partitioning support

<*>   Caching block device access to MTD devices

<*>   NAND Device Support  --->

<*>   NAND Flash support for S3C SoC

[*]     S3C NAND Hardware ECC

File Systems  --->

Partition  Types  --->

[*]    Advanced partition selection

[*]    PC  BIOS  (MSDOS  partition  tables)  support

[*]         BSD  disklabel  (FreeBSD  partition  tables)  support

  • 编译内核并拷贝到tftpboot下

$ make  zImage

$ cp  arch/arm/boot/zImage  /tftpboot

  • 测试

启动目标板,在目标板上完成如下操作:

# cat  /proc/mtd

dev:        size       erasesize     name

mtd0: 00100000 00020000  "bootloader"

mtd1: 00300000 00020000  "kernel"

mtd2: 00400000 00020000  "rootfs"

mtd3: 0f800000 00020000  "usrfs"

s5pc100开发板Nand flash移植的更多相关文章

  1. s5pc100开发板linux内核移植

    相关软件下载地址:http://pan.baidu.com/s/16yo8Y 应用于FSC100开发板 交叉编译工具:arm-cortex_a8-linux-gnueabi-gcc linux-2.6 ...

  2. s5pc100开发板uboot移植

    相关软件下载地址:http://pan.baidu.com/s/16yo8Y 适用于fsc100开发板 交叉编译器arm-cortex_a8-linux-gnueabi-gcc u-boot-2010 ...

  3. s5pc100开发板网卡驱动的移植

    相关软件下载地址:http://pan.baidu.com/s/16yo8Y fsc100开发板 交叉编译工具:arm-cortex_a8-linux-gnueabi-gcc 平台代码修改 vim   ...

  4. 小白自制Linux开发板 二. u-boot移植

    上一篇:小白自制Linux开发板 一. 瞎抄原理图与乱画PCB  中我们做了一个小型而没用的开发板,用的是Licheepi Nano的镜像,那从本篇开始我们开始自己构建它的灵魂吧. 我们都知道,PC在 ...

  5. [资料分享]迅为iTOP4412开发板-SDIO WiFi移植文档

    本文转自迅为:http://www.topeetboard.com 概述 近期需要把WiFi无线网络功能移植到iTOP-4412 开发平台,查阅了相关资料,经过一段时间的研究.调试,终于成功的将WiF ...

  6. 2440开发板linux系统移植3G拨号上网收发短信(三)

    一.用text查看模式 下面的“发”是指我敲的命令,“收”是指回车后显示的信息包括其他接收的信息. ~ >: microcom -s 115200 /dev/ttyUSB1 发:at 收:OK ...

  7. [正在学习开发板]分享--- iTOP-4412移植CAN

    首先拷贝迅为提供的 libcanjni.tar.gz 压缩包到 android 源代码的"iTop4412_ICS/device/samsung/common"文件夹以下,然后使用 ...

  8. 痞子衡嵌入式:把玩i.MXRT1062 TencentOS Tiny EVB_AIoT开发板(2) - 在Flash调试及离线启动

    大家好,我是痞子衡,是正经搞技术的痞子.今天痞子衡给大家介绍的是i.MXRT1062 TencentOS Tiny EVB_AIoT开发板在Flash调试与离线启动. 腾讯 TencentOS 团队于 ...

  9. linux2.6.30.4内核移植(2)——Nand Flash驱动移植

    内核源码:linux2.6.30.4 交叉编译工具:3.4.5 移植linux内核至:TQ2440 工作基础:http://www.cnblogs.com/nufangrensheng/p/36696 ...

随机推荐

  1. pdf.js-----后端返回utf-8数据流,前端处理数据展示pdf

    需求:做项目联调接口时,发现知识库展示pdf未果,经与后端人员沟通,发现以下问题: 1.接口返回的是utf-8数据流,但是前端调用的是base64解析方法: 导致功能有误: 方案一:将后端返回的utf ...

  2. pip3与pyttsx3文字语音转换

    今天想做个语音读取的小脚本,在网上查了一下发现python里有个pyttsx可以识别文字, 打算通过pip3 install pyttsx安装包,结果报错, 然后试了一下发现不行,去网上查了一下发现p ...

  3. python3的urllib以及urllib2的报错问题

    1. urllib.urlencode(params) 换成 urllib.parse.urlencode(params) 2. 在python3.3后urllib2已经不能再用,只能用urllib. ...

  4. VBS 脚本对象

    Dictionary对象(1) 1.        属性: a)        compareMode b)       count c)        key d)       item 2.    ...

  5. 富文本编辑器summernote的基本使用

    summernote比较突出的优点就是能保持复制过来的东西的原有样式,并且比较流畅. 官方文档地址:https://summernote.org/getting-started 我是用到cdn引入 & ...

  6. LIS问题

    LIS定义LIS(Longest Increasing Subsequence)最长上升子序列 .一个数的序列bi,当b1 < b2 < … < bS的时候,我们称这个序列是上升的. ...

  7. Link Analysis_1_Basic Elements

    1. Edge Attributes 1.1 Methods of category 1.1.1 Basic three categories in terms of number of layers ...

  8. 线程与FORK

    1.线程锁的问题 需要调用进程线程锁处理函数 prefork-----获取父亲进程锁----在fork掉用之前,目的是为了在子进程中获取到可释放的锁 parentfork----释放父亲进程锁 chi ...

  9. ubuntu 系统分配固定 ip--

    由于Ubuntu重启之后,ip很容易改变,可以用以下方式固定ip地址 1.设置ip地址 vi /etc/network/interface # The loopback network interfa ...

  10. Activity的生命周期及协同作用

    生命周期 onCreate:创建Activity的实例对象的方法 onStart:启动当前的activity实例的方法 onResume:如果该方法执行,页面的实例和用户即可以交互 onPause:如 ...