u-boot支持下列NAND ECC算法:

1.S/W ECC(Hamming code),软件ECC校验。

2.H/W ECC(Hamming code,BCH8)。

BCH Flash OOB Layout

For any ECC scheme we need to add some extra data while writing so as to detect and correct (if possible) the errors introduced by the NAND part. In case of BCH scheme some bytes are needed to store the ECC related info.

The section of NAND memory where addition info like ECC data is stored is referred to as Out Of Band or OOB section.

The first 2 bytes are used for Bad block marker – 0xFFFF => Good block

The next ‘N’ bytes is used for BCH bytes

N = B * <Number of 512-byte sectors in a page>

>>B = 8 bytes per 512 byte sector in BCH4

>>B = 14 bytes per 512 byte sector in BCH8

>>B = 26 bytes per 512 byte sector in BCH16

So for a 2k page-size NAND flash with 64-byte OOB size, we will use BCH8. This will consume 2 + (14*4) = 58 bytes out of 64 bytes available.

The NAND flash part used in EVM does not have enough spare area to support BCH16.

To select ECC algorithm for NAND:

U-Boot# nandecc [sw | hw <hw_type>]

Usage:

sw - Set software ECC for NAND.

hw <hw_type> - Set hardware ECC for NAND <hw_type> - 0 for Hamming code, 1 for bch4, 2 for bch8, 3 for bch16

Currently we support only Software, Hamming Code and BCH8. We do not support BCH4 and BCH16.

注:am335x采用NandFlash:K9F2G08UOC,此flash特性:

page: 2K=2048 bytes

oob: 64 bytes

block: 128K = 64page

从目前u-boot命令可知,u-boot在烧写nandflash时,MLO、U-boot、Linux、Rootfs都采用了BCH8(nandecc hw 2),而EVM和Log采用了Hamming(nandecc hw 0)。yaffs2文件系统本身占用oob空间28字节(实际25字节),而oob空间共64字节,显然不能采用BCH8(空间不足)。yaffs2中oob布局为:2bytes + 28bytes tags + 16ECC(根据好的yaffs镜像推测)。具体如何实现需找到源码后进一步确认。

参考:AM335x U-Boot User's Guide

http://blog.csdn.net/pengrui18/article/details/18326275

http://read.pudn.com/downloads128/sourcecode/embed/541512/yaffs2/utils/mkyaffs2image.c__.htm

最新文章

  1. maven整理——初步
  2. JavaScript 中 申明变量的方式--let 语句
  3. POI文件导出至EXCEL,并弹出下载框
  4. FastSocket客户端/服务端通讯示例
  5. UML时序图总结
  6. linux里用cmake安装的软件要怎么卸载?
  7. 详解Asp.net MVC DropDownLists
  8. AspNetPager 的使用
  9. JQUERY1.9学习笔记 之基本过滤器(一) 动态选择器
  10. JqueryeasyUI选项卡选择判定更改内部Iframe地址
  11. PHP实现zip压缩打包下载
  12. Pycharm配置支持vue语法
  13. grafna与饼状图
  14. 基于Material-Design的Gank-IO客户端
  15. 【Python】TF环境
  16. quic协议实时视频直播
  17. text-align真的只是让文本居中吗?
  18. Matplotlib外观和基本配置笔记
  19. Elasticsearch 全字段搜索_all,query_string查询,不进行分词
  20. Flash流媒体服务器软件

热门文章

  1. HDU 3966 Aragorn&#39;s Story(树链剖分)(线段树区间修改)
  2. 【状态压缩DP】【BZOJ1087】【SCOI2005】互不侵犯king
  3. sql-----STR 函数
  4. java内存缓存,节省内存
  5. Tomcat服务器多域名配置(转载)
  6. numpy 多维数组的存取
  7. linux系统清理僵尸进程记录
  8. 倍福TwinCAT(贝福Beckhoff)基础教程4.2 TwinCAT如何读写CSV文件
  9. 【菜鸟学注入】之MySQL报错注入详解
  10. 图解HTTP第六章:HTTP首部