| 28 | The 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 |
| 32 | Ventana > nand info |
| 33 | |
| 34 | Device 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 |
| 46 | 4096 |
| 47 | # cat /sys/devices/virtual/ubi/ubi0/eraseblock_size |
| 48 | 253952 |
| 49 | # cat /sys/devices/virtual/ubi/ubi0/total_eraseblocks |
| 50 | 8124 |
| 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 |
| 56 | Ventana > nand info |
| 57 | |
| 58 | Device 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 |
| 70 | 2048 |
| 71 | # cat /sys/devices/virtual/ubi/ubi0/eraseblock_size |
| 72 | 126976 |
| 73 | # cat /sys/devices/virtual/ubi/ubi0/total_eraseblocks |
| 74 | 16248 |
| 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 |