http://www.linux-mtd.infradead.org/doc/ubi.html#L_subpage

NAND flash sub-pages

As it is said here, all UBI I/O should be done in fractions of min. I/O unit size, which is equivalent to NAND page size in case of NAND flash. However, some SLC NAND flashes allow for smaller I/O units, which are called sub-pages in MTD terminology. Not all NANDs have sub-pages.

  • MLC NANDs do not have sub-pages, at least to the date of writing of this piece of documentation (April 2009).
  • SLC NANDs usually do have sub-pages. E.g., 512-byte NAND pages usually consist of 2x256-byte sub-pages, and 2048-byte NAND pages consist of 4x512-byte sub-pages.
  • SLC OneNAND chips with 2048 bytes NAND page size have 4x512-byte sub-pages.

If the NAND flash supports sub-pages, then what can be done is ECC codes can be calculated on per-sub-page basis, instead of per-NAND page basis. In this case it becomes possible to read and write sub-pages independently.

But obviously, even though the NAND chip may support sub-pages, the NAND controller may disallow them. Indeed, if the flash is managed by a controller which calculates ECC codes on per-NAND page basis, then it is impossible to do I/O in sub-page fractions. E.g. this is the case for the OLPC XO-1 laptop) - its NAND chip supports sub-pages, but the NAND controller does not.

Note, sub-page is an MTD term, but this is also referred to as "NOP" which stands for "number of partial programs". NOP1 NAND flashes have no sub-pages - UBI treats them as NANDS with sub-page size equivalent to NAND page size. NOP2 NAND flashes have 2 sub-pages (half a NAND page each), NOP4 flashes have 4 sub-pages (quarter of a NAND page each).

UBI utilizes sub-pages to lessen flash space overhead. The overhead is less if NAND flash supports sub-pages (see here). Indeed, let's consider a NAND flash with 128KiB eraseblocks and 2048-byte pages. If it does not have sub-pages, UBI puts the the VID header at physical offset 2048, so LEB size becomes 124KiB (128KiB minus one NAND page which stores the EC header and minus another NAND page which stores the VID header. In opposite, if the NAND flash does have sub-pages, UBI puts the VID header at physical offset 512 (the second sub-page), so LEB size becomes 126KiB (128KiB minus one NAND page which is used for storing both UBI headers). See this section for more information about where the UBI headers are stored.

Sub-pages are used by UBI only internally, and only for storing the headers. UBI API does not allow users doing I/O in sub-page units. One of the reasons for this is that sub-page writes may be slow. To write a sub-page, the driver may actually write whole NAND page, but put 0xFF bytes to the sub-pages which are not relevant to this operation. E.g., this means that writing 4 sub-pages may be 4 times slower than writing whole NAND page at once. Thus, UBI does use sub-pages for the headers, but this notion does not exist in the UBI API.

最新文章

  1. 分布式系统之Quorum (NRW)算法
  2. MVVM架构~knockoutjs系列之正则表达式使规则更灵活
  3. PHP数据访问
  4. (object sender,EventArgs e)是什么?
  5. __declspec,__cdecl,__stdcall区别和作用
  6. SOAPUI请求及mockservice 使用
  7. 使用Bundle在Activity之间交换数据
  8. string::npos,一个很大的数
  9. UVA 10881 - Piotr's Ants【模拟+思维】
  10. ToastMiui【仿MIUI的带有动画的Toast】
  11. 第八次作业:聚类--K均值算法:自主实现与sklearn.cluster.KMeans调用
  12. Day6------------软连接和硬链接
  13. fiddler抓包url有乱码
  14. gcc和gdb使用笔记
  15. IIS7配置HTTPS+默认访问https路径
  16. WIN10系统如何使用传统WIN7开始菜单
  17. HTTP 返回码 400
  18. Ext.data.association.hasMany一对多模型使用示例
  19. 【工具】PC端调试手机端 Html 页面的工具
  20. 平滑重启php

热门文章

  1. mysqli链接数据库:面向对象
  2. 新版macbook air OS X El Capitan 10.11安装WIN找不到驱动介质???
  3. 27-React Lists and Keys
  4. Angular Mobile UI API文档
  5. F12定义到元数据问题解决
  6. 求System.arraycopy的用法
  7. Android studio Gradle 教程
  8. P与NP问题
  9. CSUOJ_1001
  10. Python 启动本地服务