娇小w搡bbbb搡bbb,《第一次の人妻》,中国成熟妇女毛茸茸,边啃奶头边躁狠狠躁视频免费观看

nand驅動移植

發布者:EnchantedDreams最新更新時間:2025-01-14 來源: cnblogs關鍵字:nand  驅動移植  S5PV210 手機看文章 掃描二維碼
隨時隨地手機看文章

首先下載nand flash驅動 s3c_nand.c ,此文件包含著nand flash驅動具體的實現,將其復制到drivers/mtd/nand下;


在s3c_nand.c中添加nand flash分區信息,分區內容可以自由設定。

#if defined(CONFIG_ARCH_S5PV210)

struct mtd_partition s3c_partition_info[] = {

{

.name= 'misc',

.offset= (768*SZ_1K),          /* for bootloader */

.size= (256*SZ_1K),

.mask_flags= MTD_CAP_NANDFLASH,

},

{

.name= 'recovery',

.offset= MTDPART_OFS_APPEND,

.size= (5*SZ_1M),

},

{

.name= 'kernel',

.offset= MTDPART_OFS_APPEND,

.size= (5*SZ_1M),

},

{

.name= 'ramdisk',

.offset= MTDPART_OFS_APPEND,

.size= (3*SZ_1M),

},


{

.name= 'system',

.offset= MTDPART_OFS_APPEND,

.size= MTDPART_SIZ_FULL,

}


{

.name= 'system',

.offset= MTDPART_OFS_APPEND,

.size= (110*SZ_1M),

},

{

.name= 'cache',

.offset= MTDPART_OFS_APPEND,

.size= (80*SZ_1M),

},

{

.name= 'userdata',

.offset= MTDPART_OFS_APPEND,

.size= MTDPART_SIZ_FULL,

}

#endif

};


struct s3c_nand_mtd_info s3c_nand_mtd_part_info = {

.chip_nr = 1,

.mtd_part_nr = ARRAY_SIZE(s3c_partition_info),

.partition = s3c_partition_info,

};

 

結構體s3c_nand_mtd_info在源代碼是沒有的,所以要將其添加進去;

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

struct s3c_nand_mtd_info {

uint chip_nr;

uint mtd_part_nr;

struct matd_partition *partition;

};

 

為了能使s3c_nand.c正確編譯,還要修改該目錄下,也就是的drivers/mtd/nand的Makefile和Kconfig:

修改driver/mtd/nand/Kconfig添加如下內容:

config MTD_NAND_S3C

  tristate 'NAND Flash support for S3C Soc'

  depends on ARCH_S5PV210 && 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  www.2cto.com  

  Enable the use of the S3C's internal ECC generator when 

  using NAND. Early versons 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, the 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


 在Mach-smdkv210.c (archarmmach-s5pv210) 中添加nand flash source,platform_device,需要頭文件map.h map.h下載,下載將其放在(archarmmach-s5pv210includemach),在Mach-smdkv210.c中加入#include 。替換掉map.h文件

 

添加nand flash source

/* NAND Controller */

static struct resource s3c_nand_resource[] = {

[0] = {

.start= S5PV210_PA_NAND,

.end= S5PV210_PA_NAND + S5PV210_SZ_NAND - 1,

.flags= IORESOURCE_MEM,

}

};


struct platform_device s3c_device_nand = {

.name= 's5pv210-nand',

.id= -1,

.num_resources= ARRAY_SIZE(s3c_nand_resource),

.resource= s3c_nand_resource,

};

 

添加platform_device

 找到static struct platform_device *smdkv210_devices[] __initdata

 添加

#if defined(CONFIG_MTD_NAND_S3C)

&s3c_device_nand,

#endif

 

 添加時鐘信息

在Clock.c (archarmmach-s5pv210) 中找到static struct clk init_clocks_off[],添加

{
  .name  = 'nand',
  .id  = -1,
  .parent  = &clk_hclk_psys.clk,
  .enable  = s5pv210_clk_ip1_ctrl,
  .ctrlbit = ((1 << 28) | (1 << 24)),
 },

添加之后,nand flash驅動才能正確獲取時鐘。

 

以上操作完成后,開始配置內核

根目錄下make menuconfig

 

Device Drivers --->

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

<*> Caching block device access to MTD devices

<*> NAND Device Support --->

<*> NAND Flash support for S3C SoCs

[*] S3C NAND Hardware ECC

 

到了這里,開發板已經支持nand flash驅動。

接下來

配置后保存,make clean ,make zImage

將zImage下載進開發板。從串口信息可以看出nand flash驅動是否完成:

 

S3C NAND Driver, (c) 2008 Samsung Electronics
S3C NAND Driver is using hardware ECC.
NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)
Creating 5 MTD partitions on 's5pv210-nand':
0x0000000c0000-0x000000100000 : 'misc'
0x000000100000-0x000000600000 : 'recovery'
0x000000600000-0x000000b00000 : 'kernel'
0x000000b00000-0x000000e00000 : 'ramdisk'
0x000000e00000-0x000010000000 : 'system'


關鍵字:nand  驅動移植  S5PV210 引用地址:nand驅動移植

上一篇:修改 Linux 內核 DM9000 支持 tiny210 開發板
下一篇:tiny210V2 Uboot kernel filesystem 燒寫和啟動

小廣播
設計資源 培訓 開發板 精華推薦

最新單片機文章
何立民專欄 單片機及嵌入式寶典

北京航空航天大學教授,20余年來致力于單片機與嵌入式系統推廣工作。

 
EEWorld訂閱號

 
EEWorld服務號

 
汽車開發圈

 
機器人開發圈

電子工程世界版權所有 京ICP證060456號 京ICP備10001474號-1 電信業務審批[2006]字第258號函 京公網安備 11010802033920號 Copyright ? 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
主站蜘蛛池模板: 濮阳市| 牟定县| 永胜县| 三门峡市| 大港区| 永丰县| 隆安县| 剑川县| 灵台县| 荆门市| 曲水县| 噶尔县| 华亭县| 剑河县| 琼结县| 昂仁县| 宜川县| 宾川县| 镇康县| 登封市| 莱芜市| 鄄城县| 烟台市| 如皋市| 静乐县| 龙江县| 福建省| 大埔县| 获嘉县| 尚志市| 五台县| 灵山县| 全南县| 阜康市| 河源市| 讷河市| 合江县| 利辛县| 长白| 清镇市| 原阳县|