flash芯片替换SAMSUNG K9K8G08U0E替换K9K8G08U0B

首先拜谢一下这几位作者

具体解决办法

http://www.61ic.com/Article/DaVinci/TMS320DM3x/201307/49496.html

遇到类似问题 K9K8G08U0E替换K9K8G08U0B的blog

http://blog.csdn.net/daidi1989/article/details/32335331

如何编写linux下nand flash驱动(具体讲解)

http://www.crifan.com/files/doc/docbook/linux_nand_driver/release/html/linux_nand_driver.html#nand_flash_page


本文主要讲述flash的替换SAMSUNG K9K8G08U0E替换K9K8G08U0B中遇到的问题

一、出现的问题

主要是两点

1.boot能够烧入,但是kernel,rootfs烧不进去,使用nand read/write 会报-74错,校验错误

2.使用ubi文件系统,同样会报错

UBI error: ubi_io_read: error -74 while reading 64 bytes from PEB 0:0, read 64 bytes


二、解决办法

下面说一下解决办法

我的u-boot版本:u-boot-2009.11-rc1

linux kernel版本:2.6.29.6

前面改法作废。

 

1.    代码修改

 

u-boot,kernel都需要改,改法相同,如下:

 

/drivers/mtd/nand/nand_base.c   修改函数nand_get_flash_type

 

       /* Get chip options, preserve non chip based options */

       chip->options &= ~NAND_CHIPOPTIONS_MSK;

 

       /*Add by zhangjj 2015-8-6*/

        chip->options |= NAND_NO_SUBPAGE_WRITE;       /*close subpage write mode to compatibale K9K8G08U0B with K9K8G08U0E*/

       /*add end*/

       chip->options |= type->options & NAND_CHIPOPTIONS_MSK;

 

2.    修改mkfs.ubifs  -e参数

 

例如:

mkfs.ubifs -r ./bin -m 2048 -e 129024 -c 300 -o kernel.img

改为:

mkfs.ubifs -r ./bin -m 2048 -e 126976 -c 300 -o kernel.img

 

说明:

1步是将小页模式关闭,使同时兼容两种芯片

2步是因为大页模式下,UBI可擦除逻辑块大小少了2page2048),(64-2*2KiB=124KiB


 K9K8G08U0D应该是与 K9K8G08U0B差不多,所以改法应该一样


三、问题解决过程

1.原厂咨询

      1) 新芯片不支持小页模式写入,驱动里面的读写方式需要修改

(老芯片一个块为2048,可以分多次写入,新芯片一个块为2048+64,只能一次写入)

      2) Device id不同

2.通过对比datasheet,两flash的功能块表和 阵列组织相同,如下



3.继续对比手册,如下不同:


4.Program/Erase Characteristics Nop有差异


对比参考上面链接

三星原厂就K9K8G08U0D升级为K9K8G08U0E的回信


 1. please check the below timing first.
K9F1G08U0E vs K9F1G08U0D Timing difference
  tR tPROG tBERS NOP
K9F1G08U0E Max. 40us Max. 900us Max. 16ms 1
K9F1G08U0D Max. 40us Max. 750us Max. 10ms 4
 
2. if timing is OK, please kindly know the 21nm SLC NOP=1 , not 4
    it means every NAND page you can just  write one time,
     if you want to write the data in the same page again, you need to erase first
 
3. please note : 
   due to 21nm SLC NOP=1, it means you can not use "Partial Program"  for it
   if you use this function in our 42 nm SLC and want to change to 21nm SLC
    the way to solve it is modify host FTL algorithm 
     
 there is FTL (flash transfer layer) between file-system and raw NAND
 ( FTL : flash transfer layer ; such as bad blocks, page size write /read, ECC , wearleveling.....)
 in solution base such as eMMC or SSD, the inside controller handle FTL
 but for Raw NAND, it has NO controller inside and needs host to handle this algorithm 
 
4.   image-partition FAT table error
     please kindly check the physcial to logical table
     in logical, you can write the data in the same area
     but, in physical, when you want to write or update the new data to the same page
     you can not write directly in the same page due to NOP=1
     you need to write to another page  

总共就这几点差异,1.读写的时钟,2.nop差异导致小页模式失效(这一点与当初技术支持的沟通相同)

关于时钟,网上大神修改过,还是不行,基本就定位在第二点

相对于以前版本0D版本来说,时序变宽, NOP由以前的4个变成一个NOP,好像是512的子页操作取消了:
以前的一个页面可以分成4个子页来写,每个子页就是512,但是U0E的NOP是1,所以应该说就不支持子页操作了。  

关于子页操作


后来遇到这篇文章:http://www.61ic.com/Article/DaVinci/TMS320DM3x/201307/49496.html

按照他的步骤以及nand操作过程http://www.cnblogs.com/dyllove98/archive/2013/07/16/3194139.html

修改后已基本跑起来了,中间遇到需要调整ubi的问题,将在《ubi问题汇总》进行总结。

具体步骤参照如下链接

http://blog.csdn.net/davion_zhang/article/details/47400419







  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值