Manufacture du Son
On this page

SPI NAND Partitioning

Flash layout of the 128 MiB SPI NAND used by U-Boot and Linux

Edit on GitHub

SPI NAND Partitioning

The 128 MiB SPI NAND is split into four MTD partitions. The first holds the SPL + U-Boot; the others are UBI volumes used at runtime.

NameSizeMTDSize (hex)Offset (hex)Content
boot1 MiBmtd00x01000000x0000000SPL + U-Boot (spi-nand.bin)
fota15 MiBmtd10x0f000000x0100000UBI: recovery uImage, DTB and uboot.env
rootfs56 MiBmtd20x38000000x1000000UBI: main rootfs.ubifs (the actual operating system)
data56 MiBmtd30x38000000x4800000UBI: scratch space for downloaded firmware images
Σ128 MiB0x8000000

The exact byte sizes come from kernel_defconfig and the device-tree partitions node; double-check both if you change the layout.

Why this split

This layout supports the A/B firmware update strategy:

  • boot is updated in place when reflashing the bootloader.
  • fota carries a minimal recovery image (initramfs + kernel) able to reflash rootfs even when the main system is broken.
  • rootfs is the running system; it is mounted read-write as UBIFS.
  • data is used as a staging area to drop a new rootfs.ubifs before applying it (over ubiupdatevol).

UBI parameters

Measured on the board:

PEB size:        131072 bytes (128 KiB)
LEB size:        126976 bytes
min I/O size:    2048
sub-page size:   2048
VID header off:  2048
data offset:     4096
good PEBs:       448 (rootfs / data), 1016 (full chip)

When generating a UBIFS image in Buildroot, the LEB size of the image must match the LEB size of the runtime UBI device, otherwise mounting fails with:

UBIFS error: LEB size mismatch: 129024 in superblock, 126976 real

Set the Buildroot UBIFS LEB size accordingly under Filesystem images → ubifs.