Calculating the Arguments for mkfs.ubifs and ubinize - 2021.2 English

PetaLinux Tools Documentation: Reference Guide

Document ID
UG1144
Release Date
2021-10-27
Version
2021.2 English

After calculating the arguments for mkfs.ubifs and ubinize, which are used in the creation of the UBI file system, the final values need to be added to the petalinux-config options.

Calculating mkfs.ubifs Arguments

Table 1. mkfs.ubifs Args
Argument Description
-m / --min-io-size
The minimum I/O unit. Values are static based on the Flash type.
  • QSPI single and dual stacked value is 1
  • QSPI dual parallel value is 2
  • OSPI value is 1
-e / --leb-size
The logical erase block size of the UBI volume.

leb-size/-e = PEB size - EC - VID

= 128K - 64bytes - 64 bytes

= 130944 bytes

-c / --max-leb-cnt
Specifies maximum file-system size in logical erase blocks
  • PEB(physical erase block) size = 128 Kbytes . Spi datasheet or
    sf probe 0 0 0
    command from U-boot terminal provide this.
  • EC header for spi flash = 64 bytes. The link shows the default values for QSPI.

max-leb-cnt/-c = QSPI ubifs partition size√∑(division) leb-size

= 50MB √∑ 130944 bytes

= 400 bytes

The final expanded values for
mkfs.ubifs  arguments are -m 2 -e 130944 -c 400

Calculating ubinize Arguments

mkfs.ubifs Arguments

Table 2. mkfs.ubifs Args
Argument Description
-m / --min-io-size
The minimum I/O unit. The following values are static based on the Flash type.
  • QSPI single and dual stacked value is 1
  • QSPI dual parallel value is 2
  • OSPI value is 1
-p / --peb-size
Tells ubinize that the physical erase block size of the flash chip for which the UBI image is created is 128KiB. -peb-size / -p = 128 Kbytes . The SPI datasheet or
sf probe 0 0 0
command from u-boot terminal provide this value.
-s / --sub-page-size
Tells ubinize that the flash supports sub-pages. This should not be more that the min-io-size. --sub-page-size / -s = 1 based on the min-io-size.
The final expanded values for ubinize arguments are -m 2 -p 128KiB -s 1
Note: The specified mkfs.ubifs arguments and ubinize arguments are based on QSPI 128KB erase size