Changes between Version 16 and Version 17 of linux/ubi


Ignore:
Timestamp:
04/24/2019 08:38:20 PM (7 months ago)
Author:
Tim Harvey
Comment:

added details on how to determine FLASH geometry at runtime from U-Boot and Linux

Legend:

Unmodified
Added
Removed
Modified
  • linux/ubi

    v16 v17  
    2626 * The 'Page Size', 'Block Size', and max blocks are specified by the NAND datasheet. The Logical Erase Block size can be calculated as: (Block Size) - 2 * (Page Size)
    2727
     28The geometry can also be determined at runtime in U-Boot using {{{nand info}}} and Linux using {{{sysfs}}}:
     29 * Cypress S34ML16G202 2GiB FLASH:
     30  - U-Boot:
     31{{{#!bash
     32Ventana > nand info
     33
     34Device 0: nand0, sector size 256 KiB
     35  Page size       4096 b
     36  OOB size         224 b
     37  Erase size    262144 b
     38  subpagesize     4096 b
     39  options     0x40000200
     40  bbt options 0x       0
     41}}}
     42   * U-Boot above shows a 4096 byte page size and a 256KiB erase block size which dictates a 248KiB logical erase block size
     43  - Linux (once device is attached via 'ubiattach /dev/ubi_ctrl -m 2' or via 'root=ubi  ubi=2' kernel cmdline params:
     44{{{#!bash
     45# cat /sys/devices/virtual/ubi/ubi0/min_io_size
     464096
     47# cat /sys/devices/virtual/ubi/ubi0/eraseblock_size
     48253952
     49# cat /sys/devices/virtual/ubi/ubi0/total_eraseblocks
     508124
     51}}}
     52   * above shows a 4096 byte page size, a 248KiB logical erase block size (which dictates a 256KiB physical erase block size) and a max of 8124 total erase blocks available in this ubi for a total usable space of 8124*248KiB still available for use by ubi volumes
     53 * Micron MT29F2G08 256MiB FLASH:
     54  - U-Boot:
     55{{{#!bash
     56Ventana > nand info
     57
     58Device 0: nand0, sector size 128 KiB
     59  Page size       2048 b
     60  OOB size         128 b
     61  Erase size    131072 b
     62  subpagesize     2048 b
     63  options     0x40000200
     64  bbt options 0x    8000
     65}}}
     66   * U-Boot aqbove shows a 2048 byte page size and a 128KiB erase block size which dictates a 124KiB logical erase block size
     67  - Linux (once device is attached via 'ubiattach /dev/ubi_ctrl -m 2' or via 'root=ubi  ubi=2' kernel cmdline params:
     68{{{#!bash
     69# cat /sys/devices/virtual/ubi/ubi0/min_io_size
     702048
     71# cat /sys/devices/virtual/ubi/ubi0/eraseblock_size
     72126976
     73# cat /sys/devices/virtual/ubi/ubi0/total_eraseblocks
     7416248
     75}}}
     76   * above shows a 2048 byte page size, a 124KiB logical erase block size (which dictates a 128KiB physical erase block size) and a max of 126976 total erase blocks available in this ubi for a total usable space of 126976*124KiB still available for use by ubi volumes
    2877
    2978mkfs.ubifs important arguments: