s5pc100开发板Nand flash移植

相关软件下载地址: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"

时间: 2024-08-06 17:22:08

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

TI AM5728开发板QSPI FLASH测试

本次针对创龙TL5728-EasyEVM的QSPI FLASH进行测试.平台简单介绍:AM5728是TI Sitara系列高性能SOC,得益于异构多核处理架构,CPU内集成了多核DSP.多核PRU.IVA-HD.GPU等协处理单元,通过硬件加速的方式极大增强CPU的数据.多媒体处理能力,可满足工业协议支持.大数据计算.实时控制等应用需求,同时采用先进的28纳米生产工艺,极大降低处理器的功耗,能耗比更加突出.TL5728-EasyEVM 是一款广州创龙基于 TI AM5728(浮点双 DSP C6

x210v3开发板u-boot-2012.10移植之四---完善开发板配置,建立x210v3_config配置

先解决上篇的错误 make一下 /home/share/uboot/u-boot-2012.10/include/config.h:10: fatal error: configs/x210v3.h: No such file or directory compilation terminated. make: *** [lib/asm-offsets.s] 错误 1 [email protected]:/home/share/uboot/u-boot-2012.10# cp include/c

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

首先拷贝迅为提供的 libcanjni.tar.gz 压缩包到 android 源码的"iTop4412_ICS/device/samsung/common"目录下面,然后使用"tar -xvf libcanjni.tar.gz"命令解压这个压缩包,如下图所示: 然后修改"device/samsung/smdk4x12/device.mk"文件,在这个文件找到 "device/samsung/smdk4x12/ft5x0x_ts.idc

(转载)移植最新内核linux-3.14.6到mini2440开发板

1.建立目标平台1.1 添加机器码--LINGD2440在arch/arm/tools/mach-types 下,添加以下一行[email protected]:~/arm/linux-3.14.6$ vim arch/arm/tools/mach-types lingd2440 MACH_LINGD2440 LINGD2440 19981.2 添加平台文件--mach-lingd2440.c复制arch/arm/mach-s3c24xx目录下的 mach-smdk2440.c,命名为mach-

u-boot-2014.10移植第20天----添加nand flash命令支持(二)

继前一天移植的情况,运行后发现: Flash: 2 MiBNAND:  0 MiB 说明Nand flash没有移植成功,在文件drivers/mtd/nand/s3c2440_nand.c 中发现board_nand_init函数中: nand->select_chip = NULL 选择芯片函数为NULL,我们在board_nand_init函数上面加上s3c2440_nand_select函数,代码如下: static void s3c2440_nand_select(struct mtd

u-boot-2014.10移植第21天----添加nand flash命令支持(三)

硬件平台:tq2440 开发环境:Ubuntu-3.11 u-boot版本:2014.10 本文允许转载,请注明出处:http://blog.csdn.net/fulinus 虽说nand flash读写操作是可以了,但是我使用nand markbad命令将一个块标记为坏块时,再用nand scrub命令恢复出厂设置时,却出现了下面的错误: nand0: MTD Erase failure: -5 说明我们的nand flash移植是不完全正确的. 下面查找原因 在文件drivers/mtd/n

linux-2.6.32在mini2440开发板上移植(1)之移植Nand驱动并修改分区信息

编者:linux中的nand的移植由于使用了MTD技术,所以就没有想象的那么复杂了. 1 Linux-2.6.32.2 内核所支持的Nand Flash 类型 Linux2.6.32.2 已经自带了大部分Nand Flash 驱动, 在linux-2.6.32.2/drivers/mtd/nand/nand_ids.c 文件中,定义了所支持的各种Nand Flash 类型. 2 修改Nand Flash 分区表 但是系统默认的分区不是我们所需的,所以要自已修改,除此之外,还有Nand Flash

用J-LINK烧写Bootloader到ARM开发板的Nand Flash

一.起因和原理 起因:以往电脑烧写bootloader到 nand中是采用jtag以及jflash,jtag是使用并口连接的,目前电脑一般没有并口了,现今一般是使用较便宜入手的J-LINK,使用USB,就不能再使用以往的jflash烧写了.因此需要找到一个J-LINK烧写Nand的方法. 以下说明J-LINK烧写Nand的原理. 以realarm2410开发板为例子说明,该开发板要把跳线设置为Nand Flash启动模式才可以操作Nand,此时的内存映射如下图: 图1   如图1,内存中并没有对

移植u-boot-2015.10到JZ2440开发板(五)——设置nand分区,环境变量保存地址和其它默认参数

在下载内核或文件系统时,我们可以直接在命令中写明烧到nandflash的具体地址,但较麻烦,我们可以给nandflash分区,这样就可直接写烧到那个分区就行了,较为方便.如何设置呢?首先我们在uboot中输入mtdparts命令,看看默认的分区,结果提示mtdids not defined, no default present.搜索"mtdids not defined",定位到common/cmd_mtdparts.c的mtdparts_init函数中,分析发现是mtdids_de