flash芯片替换SAMSUNG K9K8G08U0E替换K9K8G08U0B
首先拜謝一下這幾位作者
具體解決辦法
http://www.61ic.com/Article/DaVinci/TMS320DM3x/201307/49496.html
遇到類(lèi)似問(wèn)題?K9K8G08U0E替換K9K8G08U0B的blog
http://blog.csdn.net/daidi1989/article/details/32335331
 
如何編寫(xiě)linux下nand flash驅(qū)動(dòng)(具體講解)
http://www.crifan.com/files/doc/docbook/linux_nand_driver/release/html/linux_nand_driver.html#nand_flash_page
 
 
本文主要講述flash的替換SAMSUNG K9K8G08U0E替換K9K8G08U0B中遇到的問(wèn)題
一、出現(xiàn)的問(wèn)題
主要是兩點(diǎn)
1.boot能夠燒入,但是kernel,rootfs燒不進(jìn)去,使用nand read/write 會(huì)報(bào)-74錯(cuò),校驗(yàn)錯(cuò)誤
2.使用ubi文件系統(tǒng),同樣會(huì)報(bào)錯(cuò)
UBI error: ubi_io_read: error -74 while reading 64 bytes from PEB 0:0, read 64 bytes
 
 
二、解決辦法
下面說(shuō)一下解決辦法
我的u-boot版本:u-boot-2009.11-rc1
linux kernel版本:2.6.29.6
前面改法作廢。
?
1.????代碼修改
?
u-boot,kernel都需要改,改法相同,如下:
?
/drivers/mtd/nand/nand_base.c???修改函數(shù)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參數(shù)
?
例如:
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
?
說(shuō)明:
第1步是將小頁(yè)模式關(guān)閉,使同時(shí)兼容兩種芯片
第2步是因?yàn)榇箜?yè)模式下,UBI可擦除邏輯塊大小少了2個(gè)page(2048),(64-2)*2KiB=124KiB
?K9K8G08U0D應(yīng)該是與?K9K8G08U0B差不多,所以改法應(yīng)該一樣
 
三、問(wèn)題解決過(guò)程
1.原廠(chǎng)咨詢(xún)
? ? ? 1)?新芯片不支持小頁(yè)模式寫(xiě)入,驅(qū)動(dòng)里面的讀寫(xiě)方式需要修改
(老芯片一個(gè)塊為2048,可以分多次寫(xiě)入,新芯片一個(gè)塊為2048+64,只能一次寫(xiě)入)
? ? ? 2)?Device id不同
2.通過(guò)對(duì)比datasheet,兩flash的功能塊表和 陣列組織相同,如下
 
 
3.繼續(xù)對(duì)比手冊(cè),如下不同:
 
4.Program/Erase Characteristics Nop有差異
 
對(duì)比參考上面鏈接
三星原廠(chǎng)就K9K8G08U0D升級(jí)為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 ?
 
總共就這幾點(diǎn)差異,1.讀寫(xiě)的時(shí)鐘,2.nop差異導(dǎo)致小頁(yè)模式失效(這一點(diǎn)與當(dāng)初技術(shù)支持的溝通相同)
關(guān)于時(shí)鐘,網(wǎng)上大神修改過(guò),還是不行,基本就定位在第二點(diǎn)
相對(duì)于以前版本0D版本來(lái)說(shuō),時(shí)序變寬, NOP由以前的4個(gè)變成一個(gè)NOP,好像是512的子頁(yè)操作取消了: 以前的一個(gè)頁(yè)面可以分成4個(gè)子頁(yè)來(lái)寫(xiě),每個(gè)子頁(yè)就是512,但是U0E的NOP是1,所以應(yīng)該說(shuō)就不支持子頁(yè)操作了。 ?關(guān)于子頁(yè)操作
 
后來(lái)遇到這篇文章:http://www.61ic.com/Article/DaVinci/TMS320DM3x/201307/49496.html
按照他的步驟以及nand操作過(guò)程http://www.cnblogs.com/dyllove98/archive/2013/07/16/3194139.html
修改后已基本跑起來(lái)了,中間遇到需要調(diào)整ubi的問(wèn)題,將在《ubi問(wèn)題匯總》進(jìn)行總結(jié)。
具體步驟參照如下鏈接
http://blog.csdn.net/davion_zhang/article/details/47400419
 
 
 
 
 
 
 
總結(jié)
以上是生活随笔為你收集整理的flash芯片替换SAMSUNG K9K8G08U0E替换K9K8G08U0B的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
 
                            
                        - 上一篇: matlab上能仿真功率吗,基于MATL
- 下一篇: 计算机体系结构(复习资料)
